public class AccountsRequestBuilder extends RequestBuilder
RequestBuilder.Order
Constructor and Description |
---|
AccountsRequestBuilder(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl serverURI) |
Modifier and Type | Method and Description |
---|---|
AccountResponse |
account(okhttp3.HttpUrl uri)
Requests specific
uri and returns AccountResponse . |
AccountResponse |
account(java.lang.String account)
Requests
GET /accounts/{account} |
AccountsRequestBuilder |
cursor(java.lang.String token)
Sets
cursor parameter on the request. |
Page<AccountResponse> |
execute()
Build and execute request.
|
static Page<AccountResponse> |
execute(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl uri)
|
AccountsRequestBuilder |
forAsset(AssetTypeCreditAlphaNum asset)
Returns all accounts who are trustees to a specific asset.
|
AccountsRequestBuilder |
forLiquidityPool(java.lang.String liquidityPoolId)
Returns all accounts who have trustlines to the specified liquidity pool.
|
AccountsRequestBuilder |
forSigner(java.lang.String signer)
Returns all accounts that contain a specific signer.
|
AccountsRequestBuilder |
forSponsor(java.lang.String sponsor)
Returns all accounts who are sponsored by a given account or have subentries which are
sponsored by a given account.
|
AccountsRequestBuilder |
limit(int number)
Sets
limit parameter on the request. |
AccountsRequestBuilder |
order(RequestBuilder.Order direction)
Sets
order parameter on the request. |
SSEStream<AccountResponse> |
stream(EventListener<AccountResponse> listener)
An overloaded version of
stream(EventListener, long) with default reconnect timeout. |
SSEStream<AccountResponse> |
stream(EventListener<AccountResponse> listener,
long reconnectTimeout)
Allows to stream SSE events from horizon.
|
setAssetParameter, setAssetsParameter
public AccountsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI)
public AccountResponse account(okhttp3.HttpUrl uri)
uri
and returns AccountResponse
. This method is helpful
for getting the links.NetworkException
- All the exceptions below are subclasses of
NetworkErrorBadRequestException
- 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 AccountResponse account(java.lang.String account)
GET /accounts/{account}
account
- Account to fetchNetworkException
- All the exceptions below are subclasses of
NetworkErrorBadRequestException
- 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 AccountsRequestBuilder forSigner(java.lang.String signer)
signer
- Account IDAccountsRequestBuilder
instancepublic AccountsRequestBuilder forAsset(AssetTypeCreditAlphaNum asset)
asset
- An issued assetAccountsRequestBuilder
instancepublic AccountsRequestBuilder forLiquidityPool(java.lang.String liquidityPoolId)
liquidityPoolId
- Liquidity Pool IDAccountsRequestBuilder
instancepublic AccountsRequestBuilder forSponsor(java.lang.String sponsor)
sponsor
- Account IDAccountsRequestBuilder
instancepublic static Page<AccountResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri)
uri
and returns Page
of AccountResponse
. This
method is helpful for getting the next set of results.Page
of AccountResponse
NetworkException
- All the exceptions below are subclasses of
NetworkErrorBadRequestException
- 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 SSEStream<AccountResponse> stream(EventListener<AccountResponse> listener, long reconnectTimeout)
listener
- EventListener
implementation with AccountResponse
typereconnectTimeout
- Custom stream connection timeout in msclose()
connection when not needed anymorepublic SSEStream<AccountResponse> stream(EventListener<AccountResponse> listener)
stream(EventListener, long)
with default reconnect timeout.public Page<AccountResponse> execute()
Page
of AccountResponse
NetworkException
- All the exceptions below are subclasses of
NetworkErrorBadRequestException
- 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 AccountsRequestBuilder cursor(java.lang.String token)
RequestBuilder
cursor
parameter on the request. A cursor is a value that points to a
specific location in a collection of resources. The cursor attribute itself is an opaque value
meaning that users should not try to parse it.cursor
in class RequestBuilder
token
- A cursor is a value that points to a specific location in a collection of
resources.public AccountsRequestBuilder limit(int number)
RequestBuilder
limit
parameter on the request. It defines maximum number of records to
return. For range and default values check documentation of the endpoint requested.limit
in class RequestBuilder
number
- maxium number of records to returnpublic AccountsRequestBuilder order(RequestBuilder.Order direction)
RequestBuilder
order
parameter on the request.order
in class RequestBuilder
direction
- RequestBuilder.Order