public class AccountsRequestBuilder extends RequestBuilder
RequestBuilder.Order
Constructor and Description |
---|
AccountsRequestBuilder(OkHttpClient httpClient,
HttpUrl serverURI) |
Modifier and Type | Method and Description |
---|---|
AccountResponse |
account(HttpUrl uri)
Requests specific
uri and returns AccountResponse . |
AccountsRequestBuilder |
cursor(java.lang.String token)
Sets
cursor parameter on the request. |
Page<AccountResponse> |
execute()
Build and execute request.
|
static Page<AccountResponse> |
execute(OkHttpClient httpClient,
HttpUrl uri)
|
AccountsRequestBuilder |
limit(int number)
Sets
limit parameter on the request. |
AccountsRequestBuilder |
order(RequestBuilder.Order direction)
Sets
order parameter on the request. |
EventSource |
stream(EventListener<AccountResponse> listener)
Allows to stream SSE events from horizon.
|
public AccountsRequestBuilder(OkHttpClient httpClient, HttpUrl serverURI)
public AccountResponse account(HttpUrl uri) throws java.io.IOException
uri
and returns AccountResponse
.
This method is helpful for getting the links.java.io.IOException
public static Page<AccountResponse> execute(OkHttpClient httpClient, HttpUrl uri) throws java.io.IOException, TooManyRequestsException
uri
and returns Page
of AccountResponse
.
This method is helpful for getting the next set of results.Page
of AccountResponse
TooManyRequestsException
- when too many requests were sent to the Horizon server.java.io.IOException
public EventSource stream(EventListener<AccountResponse> listener)
listener
- EventListener
implementation with AccountResponse
typeclose()
connection when not needed anymorepublic Page<AccountResponse> execute() throws java.io.IOException, TooManyRequestsException
Page
of AccountResponse
TooManyRequestsException
- when too many requests were sent to the Horizon server.java.io.IOException
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
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