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