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