Package org.stellar.sdk.requests
Class EffectsRequestBuilder
java.lang.Object
org.stellar.sdk.requests.RequestBuilder
org.stellar.sdk.requests.EffectsRequestBuilder
Builds requests connected to effects.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.stellar.sdk.requests.RequestBuilder
RequestBuilder.Order -
Constructor Summary
ConstructorsConstructorDescriptionEffectsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI) -
Method Summary
Modifier and TypeMethodDescriptionSetscursorparameter on the request.execute()Build and execute request.static Page<EffectResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri) forAccount(@NonNull String account) Builds request toGET /accounts/{account}/effectsforLedger(long ledgerSeq) Builds request toGET /ledgers/{ledgerSeq}/effectsforLiquidityPool(String liquidityPoolID) Builds request toGET /liquidity_pools/{poolID}/effectsforLiquidityPool(LiquidityPoolID liquidityPoolID) Builds request toGET /liquidity_pools/{poolID}/effectsforOperation(long operationId) Builds request toGET /operation/{operationId}/effectsforTransaction(@NonNull String transactionId) Builds request toGET /transactions/{transactionId}/effectslimit(int number) Setslimitparameter on the request.order(RequestBuilder.Order direction) Setsorderparameter on the request.stream(EventListener<EffectResponse> listener) An overloaded version ofstream(EventListener, long)with default reconnect timeout.stream(EventListener<EffectResponse> listener, long reconnectTimeout) Allows to stream SSE events from horizon.Methods inherited from class org.stellar.sdk.requests.RequestBuilder
setAssetParameter, setAssetsParameter
-
Constructor Details
-
EffectsRequestBuilder
public EffectsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI)
-
-
Method Details
-
forAccount
Builds request toGET /accounts/{account}/effects- Parameters:
account- Account for which to get effects- See Also:
-
forLedger
Builds request toGET /ledgers/{ledgerSeq}/effects- Parameters:
ledgerSeq- Ledger for which to get effects- See Also:
-
forTransaction
Builds request toGET /transactions/{transactionId}/effects- Parameters:
transactionId- Transaction ID for which to get effects- See Also:
-
forLiquidityPool
Builds request toGET /liquidity_pools/{poolID}/effects- Parameters:
liquidityPoolID- Liquidity pool for which to get effects- See Also:
-
forLiquidityPool
Builds request toGET /liquidity_pools/{poolID}/effects- Parameters:
liquidityPoolID- Liquidity pool for which to get effects- See Also:
-
forOperation
Builds request toGET /operation/{operationId}/effects- Parameters:
operationId- Operation ID for which to get effects- See Also:
-
execute
public static Page<EffectResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri) throws IOException, TooManyRequestsException Requests specificuriand returnsPageofEffectResponse. This method is helpful for getting the next set of results.- Returns:
PageofEffectResponse- Throws:
TooManyRequestsException- when too many requests were sent to the Horizon server.IOException- if the request fails due to an IOException, including but not limited to a timeout, connection failure etc.
-
stream
public SSEStream<EffectResponse> stream(EventListener<EffectResponse> listener, long reconnectTimeout) Allows to stream SSE events from horizon. Certain endpoints in Horizon can be called in streaming mode using Server-Sent Events. This mode will keep the connection to horizon open and horizon will continue to return responses as ledgers close.- Parameters:
listener-EventListenerimplementation withEffectResponsetypereconnectTimeout- Custom stream connection timeout in ms- Returns:
- EventSource object, so you can
close()connection when not needed anymore - See Also:
-
stream
An overloaded version ofstream(EventListener, long)with default reconnect timeout. -
execute
Build and execute request.- Returns:
PageofEffectResponse- Throws:
TooManyRequestsException- when too many requests were sent to the Horizon server.IOException- if the request fails due to an IOException, including but not limited to a timeout, connection failure etc.
-
cursor
Description copied from class:RequestBuilderSetscursorparameter 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.- Overrides:
cursorin classRequestBuilder- Parameters:
token- A cursor is a value that points to a specific location in a collection of resources.- See Also:
-
limit
Description copied from class:RequestBuilderSetslimitparameter on the request. It defines maximum number of records to return. For range and default values check documentation of the endpoint requested.- Overrides:
limitin classRequestBuilder- Parameters:
number- maxium number of records to return
-
order
Description copied from class:RequestBuilderSetsorderparameter on the request.- Overrides:
orderin classRequestBuilder- Parameters:
direction-RequestBuilder.Order
-