AsyncRequest

public class AsyncRequest extends Object

Individual batched request wrapper as consumed by add(AsyncRequest)

Nested Class Summary

interface AsyncRequest.EventStartCallback Interface to record start of an event such as execution of batched request. 
class AsyncRequest.SettableFutureCallback<T> JsonBatchCallback wrapper which updates ListenableFuture associated with individual batched request. 

Public Constructor Summary

AsyncRequest(AbstractGoogleJsonClientRequest<T> requestToExecute, RetryPolicy retryPolicy, StatsManager.OperationStats operationStats)

Public Method Summary

void
cancel()
Cancel this request.
SettableFutureCallback<T>
getCallback()
Gets AsyncRequest.SettableFutureCallback instance associated with batched request.
ListenableFuture<T>
getFuture()
Gets ListenableFuture instance representing pending result from AsyncRequest execution.
AbstractGoogleJsonClientRequest<T>
getRequest()
Gets request to be batched.
int
getRetries()
Gets current number of retries for AsyncRequest.
AsyncRequest.Status
getStatus()
Gets ERROR(/Status) for batched request.
void
incrementRetries()
Increments retry count if batched request is retried.
void
setStatus(AsyncRequest.Status newStatus)
Sets status for batched request.

Inherited Method Summary

Public Constructors

public AsyncRequest (AbstractGoogleJsonClientRequest<T> requestToExecute, RetryPolicy retryPolicy, StatsManager.OperationStats operationStats)

Parameters
requestToExecute
retryPolicy
operationStats

Public Methods

public void cancel ()

Cancel this request.

public SettableFutureCallback<T> getCallback ()

Gets AsyncRequest.SettableFutureCallback instance associated with batched request.

Returns

public ListenableFuture<T> getFuture ()

Gets ListenableFuture instance representing pending result from AsyncRequest execution.

Returns

public AbstractGoogleJsonClientRequest<T> getRequest ()

Gets request to be batched.

Returns
  • request to be batched.

public int getRetries ()

Gets current number of retries for AsyncRequest.

Returns

public AsyncRequest.Status getStatus ()

Gets ERROR(/Status) for batched request.

Returns
  • status for batched request.

public void incrementRetries ()

Increments retry count if batched request is retried.

public void setStatus (AsyncRequest.Status newStatus)

Sets status for batched request.

Parameters
newStatus updated status for batched request.