public class Federation
extends java.lang.Object
| Constructor and Description |
|---|
Federation()
Creates a new
Federation instance with a default OkHttpClient. |
Federation(okhttp3.OkHttpClient httpClient)
Creates a new
Federation instance. |
| Modifier and Type | Method and Description |
|---|---|
FederationResponse |
resolveAccountId(java.lang.String accountId,
java.lang.String domain)
Resolves the given Stellar account ID to federation record if the user was found for a given
Stellar account ID.
|
FederationResponse |
resolveAddress(java.lang.String address)
Resolves the given address to federation record if the user was found for a given Stellar
address.
|
public Federation(okhttp3.OkHttpClient httpClient)
Federation instance.httpClient - OkHttpClientpublic Federation()
Federation instance with a default OkHttpClient.public FederationResponse resolveAddress(java.lang.String address)
address - Stellar address (e.g. `bob*stellar.org`).java.lang.IllegalArgumentException - Address is malformedNetworkException - All the exceptions below are subclasses of
NetworkErrorNotFoundException - Stellar address not found in the federation serverStellarTomlNotFoundInvalidException - Stellar.toml file not found or invalidNoFederationServerException - No federation server defined in stellar.toml fileFederationServerInvalidException - Federation server is invalidBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)TooManyRequestsException - if the request fails due to too many requests sent to the
serverRequestTimeoutException - When Horizon returns a Timeout
or connection timeout
occurredUnknownResponseException - if the server returns an unknown
status codeConnectionErrorException - When the request cannot be executed
due to cancellation or connectivity problems, etc.public FederationResponse resolveAccountId(java.lang.String accountId, java.lang.String domain)
accountId - Stellar account ID. (e.g. `GAVHK7L...`)domain - The domain to get the federation server URI from. (e.g. `example.com`)NetworkException - All the exceptions below are subclasses of
NetworkErrorNotFoundException - Stellar address not found in the federation serverStellarTomlNotFoundInvalidException - Stellar.toml file not found or invalidFederationServerInvalidException - Federation server is invalidNoFederationServerException - No federation server defined in stellar.toml fileBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)TooManyRequestsException - if the request fails due to too many requests sent to the
serverRequestTimeoutException - When Horizon returns a Timeout
or connection timeout
occurredUnknownResponseException - if the server returns an unknown
status codeConnectionErrorException - When the request cannot be executed
due to cancellation or connectivity problems, etc.