AsyncApiOperation

public class AsyncApiOperation extends Object

An ApiOperation that the Repository pushes asynchronously.

The Repository can push AsyncApiOperation objects using the EventBus passed in from its init(RepositoryContext) method. Typically, the Repository performs on-demand API operations whenever it implements a scheduled or event-driven change-detection mechanism.

The ListenableFuture result represents the future result of the operation accessible from getResult().

Sample usage:


 public MyRepository implements Repository {
  @Override
   public void init(RepositoryContext context) {
     this.context = context;
   }

   private void onDocumentRemoved(String docId) {
     AsyncApiOperation operation = new AsyncApiOperation(ApiOperations.deleteItem(docId));
     this.context.postAsyncOperation(operation);
   }

   // other implemented methods
 }
 

Public Constructor Summary

Public Method Summary

ApiOperation
ListenableFuture<List<GenericJson>>

Inherited Method Summary

Public Constructors

public AsyncApiOperation (ApiOperation operation)

Parameters
operation

Public Methods

public ApiOperation getOperation ()

public ListenableFuture<List<GenericJson>> getResult ()

Send feedback about...

Cloud Search
Cloud Search