Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / datastore / AsyncDatastoreService.java
blobc451da8a99b26901b4ed41dfe63cbe3d274461e1
1 // Copyright 2010 Google Inc. All Rights Reserved.
2 package com.google.appengine.api.datastore;
4 import java.util.List;
5 import java.util.Map;
6 import java.util.concurrent.Future;
8 /**
9 * An asynchronous version of {@link DatastoreService}. All methods return
10 * immediately and provide {@link Future Futures} as their return values.
11 * <p>
12 * The key difference between implementations of {@link AsyncDatastoreService}
13 * and implementations of {@link DatastoreService} is that async
14 * implementations do not perform implicit transaction management. The reason
15 * is that implicit transaction management requires automatic commits of some
16 * transactions, and without some sort of callback mechanism there is no way
17 * to determine that a put/get/delete that has been implicitly enrolled in a
18 * transaction is complete and therefore ready to be committed. See
19 * {@link ImplicitTransactionManagementPolicy} for more information.
22 public interface AsyncDatastoreService extends BaseDatastoreService {
23 /**
24 * @see DatastoreService#get(Key)
26 Future<Entity> get(Key key);
28 /**
29 * @see DatastoreService#get(Transaction, Key)
31 Future<Entity> get(Transaction txn, Key key);
33 /**
34 * @see DatastoreService#get(Iterable)
36 Future<Map<Key, Entity>> get(Iterable<Key> keys);
38 /**
39 * @see DatastoreService#get(Transaction, Iterable)
41 Future<Map<Key, Entity>> get(Transaction txn, Iterable<Key> keys);
43 /**
44 * @see DatastoreService#put(Entity)
46 Future<Key> put(Entity entity);
48 /**
49 * @see DatastoreService#put(Transaction, Entity)
51 Future<Key> put(Transaction txn, Entity entity);
53 /**
54 * @see DatastoreService#put(Iterable)
56 Future<List<Key>> put(Iterable<Entity> entities);
58 /**
59 * @see DatastoreService#put(Transaction, Iterable)
61 Future<List<Key>> put(Transaction txn, Iterable<Entity> entities);
63 /**
64 * @see DatastoreService#delete(Key...)
66 Future<Void> delete(Key... keys);
68 /**
69 * @see DatastoreService#delete(Transaction, Iterable)
71 Future<Void> delete(Transaction txn, Key... keys);
73 /**
74 * @see DatastoreService#delete(Iterable)
76 Future<Void> delete(Iterable<Key> keys);
78 /**
79 * @see DatastoreService#delete(Transaction, Iterable)
81 Future<Void> delete(Transaction txn, Iterable<Key> keys);
83 /**
84 * @see DatastoreService#beginTransaction()
86 Future<Transaction> beginTransaction();
88 /**
89 * @see DatastoreService#beginTransaction(TransactionOptions)
91 Future<Transaction> beginTransaction(TransactionOptions options);
93 /**
94 * @see DatastoreService#allocateIds(String, long)
96 Future<KeyRange> allocateIds(String kind, long num);
98 /**
99 * @see DatastoreService#allocateIds(Key, String, long)
101 Future<KeyRange> allocateIds(Key parent, String kind, long num);
104 * @see DatastoreService#getDatastoreAttributes()
106 Future<DatastoreAttributes> getDatastoreAttributes();
109 * @see DatastoreService#getIndexes()
111 Future<Map<Index, Index.IndexState>> getIndexes();