public class AppContext
extends java.lang.Object
Normally, there are only one application context for one application.
| Modifier and Type | Method and Description |
|---|---|
static AppContext |
build(AppContextProvider provider,
java.lang.String userDid)
Create the application context.
|
AppContextProvider |
getAppContextProvider()
Get the provider of the application context.
|
static java.util.concurrent.CompletableFuture<java.lang.String> |
getProviderAddress(java.lang.String targetDid)
Get the URL address of the provider throw the document of the user DID.
|
static java.util.concurrent.CompletableFuture<java.lang.String> |
getProviderAddress(java.lang.String targetDid,
java.lang.String preferredProviderAddress)
Get the URL address of the provider by the user DID.
|
java.lang.String |
getUserDid()
Get the user DID.
|
static void |
setupResolver(java.lang.String resolver,
java.lang.String cacheDir)
Setup the resolver for the DID verification.
|
public AppContextProvider getAppContextProvider()
public java.lang.String getUserDid()
public static void setupResolver(java.lang.String resolver,
java.lang.String cacheDir)
throws HiveException
resolver - The URL of the resolver.cacheDir - The local directory for DID cache.HiveException - See HiveExceptionpublic static AppContext build(AppContextProvider provider, java.lang.String userDid)
provider - The provider of the application context.userDid - The user DID.public static java.util.concurrent.CompletableFuture<java.lang.String> getProviderAddress(java.lang.String targetDid)
targetDid - The user DID.public static java.util.concurrent.CompletableFuture<java.lang.String> getProviderAddress(java.lang.String targetDid,
java.lang.String preferredProviderAddress)
targetDid - The user DID.preferredProviderAddress - The preferred URL address of the provider.