Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / datastore / DatastoreV4Proxy.java
blob6a28711bfdb5f026be52fdaedf1615e771b46541
1 package com.google.appengine.api.datastore;
3 import com.google.apphosting.datastore.DatastoreV4.AllocateIdsRequest;
4 import com.google.apphosting.datastore.DatastoreV4.AllocateIdsResponse;
5 import com.google.apphosting.datastore.DatastoreV4.BeginTransactionRequest;
6 import com.google.apphosting.datastore.DatastoreV4.BeginTransactionResponse;
7 import com.google.apphosting.datastore.DatastoreV4.CommitRequest;
8 import com.google.apphosting.datastore.DatastoreV4.CommitResponse;
9 import com.google.apphosting.datastore.DatastoreV4.ContinueQueryRequest;
10 import com.google.apphosting.datastore.DatastoreV4.ContinueQueryResponse;
11 import com.google.apphosting.datastore.DatastoreV4.LookupRequest;
12 import com.google.apphosting.datastore.DatastoreV4.LookupResponse;
13 import com.google.apphosting.datastore.DatastoreV4.RollbackRequest;
14 import com.google.apphosting.datastore.DatastoreV4.RollbackResponse;
15 import com.google.apphosting.datastore.DatastoreV4.RunQueryRequest;
16 import com.google.apphosting.datastore.DatastoreV4.RunQueryResponse;
17 import com.google.protobuf.InvalidProtocolBufferException;
19 import java.util.concurrent.Future;
21 /**
22 * The V4 RPC interface. The default implementation, {@link AppEngineDatastoreV4Proxy}, forwards
23 * RPCs to the App Engine general RPC proxy. Other implementations may handle RPCs differently.
25 * The use of an interface allows the SDKs to be used in contexts other than the App Engine
26 * runtime, without introducing a direct build dependence.
28 * Invoking a method sends out the supplied RPC and returns a Future which clients can
29 * block on to retrieve a result.
31 interface DatastoreV4Proxy {
32 Future<BeginTransactionResponse> beginTransaction(BeginTransactionRequest request);
33 Future<RollbackResponse> rollback(RollbackRequest request);
34 Future<RunQueryResponse> runQuery(RunQueryRequest request);
35 Future<ContinueQueryResponse> continueQuery(ContinueQueryRequest request);
36 Future<LookupResponse> lookup(LookupRequest request);
37 Future<AllocateIdsResponse> allocateIds(AllocateIdsRequest request);
38 Future<CommitResponse> commit(CommitRequest request);
40 /**
41 * Equivalent to {@link #commit(CommitRequest)} with a pre-serialized proto.
42 * Used by {@link InternalTransactionV4} to avoid a second serialization of the proto.
44 * @param request byte array which must be deserializable as a {@link CommitRequest}.
46 Future<CommitResponse> rawCommit(byte[] request) throws InvalidProtocolBufferException;