Class HttpResolverClient
java.lang.Object
smartrics.iotics.identity.resolver.HttpResolverClient
- All Implemented Interfaces:
ResolverClient
HTTP resolver client for resolving decentralized identifiers (DIDs) over HTTP.
-
Nested Class Summary
Nested classes/interfaces inherited from interface smartrics.iotics.identity.resolver.ResolverClient
ResolverClient.Result -
Constructor Summary
ConstructorsConstructorDescriptionHttpResolverClient(URL base) Constructs an HttpResolverClient with the specified base URL and default OkHttpClient.HttpResolverClient(URL base, okhttp3.OkHttpClient client) Constructs an HttpResolverClient with the specified base URL and OkHttpClient. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the document pointed by the DID by making an HTTP request to the resolver.protected okhttp3.OkHttpClientRetrieves the OkHttpClient used by this resolver client.
-
Constructor Details
-
HttpResolverClient
Constructs an HttpResolverClient with the specified base URL and default OkHttpClient.- Parameters:
base- The base URL of the resolver.
-
HttpResolverClient
Constructs an HttpResolverClient with the specified base URL and OkHttpClient.- Parameters:
base- The base URL of the resolver.client- The OkHttpClient to use for HTTP requests.
-
-
Method Details
-
getClient
protected okhttp3.OkHttpClient getClient()Retrieves the OkHttpClient used by this resolver client.- Returns:
- The OkHttpClient instance.
-
discover
Retrieves the document pointed by the DID by making an HTTP request to the resolver.- Specified by:
discoverin interfaceResolverClient- Parameters:
did- The decentralized identifier (DID) to discover.- Returns:
- The result of the discovery operation.
- Throws:
IOException- If an I/O error occurs during the HTTP request.
-