Skip to content

Commit 930a52d

Browse files
committed
Merge pull request #79 from aozarov/temp1
s/XXXService/XXX/g
2 parents e77e0bb + 19f3350 commit 930a52d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+345
-346
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ See the ``gcloud-java`` API [datastore documentation][datastore-api] to learn ho
5656
with the Cloud Datastore using this Client Library.
5757

5858
```java
59-
import com.google.gcloud.datastore.DatastoreService;
60-
import com.google.gcloud.datastore.DatastoreServiceFactory;
61-
import com.google.gcloud.datastore.DatastoreServiceOptions;
59+
import com.google.gcloud.datastore.Datastore;
60+
import com.google.gcloud.datastore.DatastoreFactory;
61+
import com.google.gcloud.datastore.DatastoreOptions;
6262
import com.google.gcloud.datastore.DateTime;
6363
import com.google.gcloud.datastore.Entity;
6464
import com.google.gcloud.datastore.Key;
6565
import com.google.gcloud.datastore.KeyFactory;
6666

67-
DatastoreServiceOptions options = DatastoreServiceOptions.builder().projectId(PROJECT_ID).build();
68-
DatastoreService datastore = DatastoreServiceFactory.instance().get(options);
67+
DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
68+
Datastore datastore = DatastoreFactory.instance().get(options);
6969
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
7070
Key key = keyFactory.newKey(keyName);
7171
Entity entity = datastore.get(key);

gcloud-java-datastore/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ See the ``gcloud-java`` API [datastore documentation][datastore-api] to learn ho
4040
with the Cloud Datastore using this Client Library.
4141

4242
```java
43-
import com.google.gcloud.datastore.DatastoreService;
44-
import com.google.gcloud.datastore.DatastoreServiceFactory;
45-
import com.google.gcloud.datastore.DatastoreServiceOptions;
43+
import com.google.gcloud.datastore.Datastore;
44+
import com.google.gcloud.datastore.DatastoreFactory;
45+
import com.google.gcloud.datastore.DatastoreOptions;
4646
import com.google.gcloud.datastore.DateTime;
4747
import com.google.gcloud.datastore.Entity;
4848
import com.google.gcloud.datastore.Key;
4949
import com.google.gcloud.datastore.KeyFactory;
5050

51-
DatastoreServiceOptions options = DatastoreServiceOptions.builder().projectId(PROJECT_ID).build();
52-
DatastoreService datastore = DatastoreServiceFactory.instance().get(options);
51+
DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
52+
Datastore datastore = DatastoreFactory.instance().get(options);
5353
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
5454
Key key = keyFactory.newKey(keyName);
5555
Entity entity = datastore.get(key);

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/BaseDatastoreBatchWriter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ protected void validateActive() {
195195
}
196196
}
197197

198-
protected DatastoreServiceException newInvalidRequest(String msg, Object... params) {
199-
return DatastoreServiceException.throwInvalidRequest(String.format(msg, params));
198+
protected DatastoreException newInvalidRequest(String msg, Object... params) {
199+
return DatastoreException.throwInvalidRequest(String.format(msg, params));
200200
}
201201

202202
protected DatastoreV1.Mutation.Builder toMutationPb() {
@@ -219,5 +219,5 @@ protected DatastoreV1.Mutation.Builder toMutationPb() {
219219
return mutationPb;
220220
}
221221

222-
protected abstract DatastoreService datastore();
222+
protected abstract Datastore datastore();
223223
}

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/BaseEntity.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,21 @@ public boolean contains(String name) {
242242
/**
243243
* Returns the {@link Value} for the given property {@code name}.
244244
*
245-
* @throws DatastoreServiceException if not such property.
245+
* @throws DatastoreException if not such property.
246246
*/
247247
public <V extends Value<?>> V getValue(String name) {
248248
@SuppressWarnings("unchecked")
249249
V property = (V) properties.get(name);
250250
if (property == null) {
251-
throw DatastoreServiceException.throwInvalidRequest("No such property %s", name);
251+
throw DatastoreException.throwInvalidRequest("No such property %s", name);
252252
}
253253
return property;
254254
}
255255

256256
/**
257257
* Returns true if property is instanceof NullValue.
258258
*
259-
* @throws DatastoreServiceException if not such property.
259+
* @throws DatastoreException if not such property.
260260
*/
261261
public boolean isNull(String name) {
262262
return getValue(name) instanceof NullValue;
@@ -266,7 +266,7 @@ public boolean isNull(String name) {
266266
/**
267267
* Returns the property value as a string.
268268
*
269-
* @throws DatastoreServiceException if not such property.
269+
* @throws DatastoreException if not such property.
270270
* @throws ClassCastException if value is not a string.
271271
*/
272272
@SuppressWarnings("unchecked")
@@ -277,7 +277,7 @@ public String getString(String name) {
277277
/**
278278
* Returns the property value as long.
279279
*
280-
* @throws DatastoreServiceException if not such property.
280+
* @throws DatastoreException if not such property.
281281
* @throws ClassCastException if value is not a long.
282282
*/
283283
@SuppressWarnings("unchecked")
@@ -288,7 +288,7 @@ public long getLong(String name) {
288288
/**
289289
* Returns the property value as a double.
290290
*
291-
* @throws DatastoreServiceException if not such property.
291+
* @throws DatastoreException if not such property.
292292
* @throws ClassCastException if value is not a double.
293293
*/
294294
@SuppressWarnings("unchecked")
@@ -299,7 +299,7 @@ public double getDouble(String name) {
299299
/**
300300
* Returns the property value as a boolean.
301301
*
302-
* @throws DatastoreServiceException if not such property.
302+
* @throws DatastoreException if not such property.
303303
* @throws ClassCastException if value is not a boolean.
304304
*/
305305
@SuppressWarnings("unchecked")
@@ -310,7 +310,7 @@ public boolean getBoolean(String name) {
310310
/**
311311
* Returns the property value as a DateTime.
312312
*
313-
* @throws DatastoreServiceException if not such property.
313+
* @throws DatastoreException if not such property.
314314
* @throws ClassCastException if value is not a DateTime.
315315
*/
316316
@SuppressWarnings("unchecked")
@@ -321,7 +321,7 @@ public DateTime getDateTime(String name) {
321321
/**
322322
* Returns the property value as a Key.
323323
*
324-
* @throws DatastoreServiceException if not such property.
324+
* @throws DatastoreException if not such property.
325325
* @throws ClassCastException if value is not a Key.
326326
*/
327327
@SuppressWarnings("unchecked")
@@ -332,7 +332,7 @@ public Key getKey(String name) {
332332
/**
333333
* Returns the property value as an entity.
334334
*
335-
* @throws DatastoreServiceException if not such property.
335+
* @throws DatastoreException if not such property.
336336
* @throws ClassCastException if value is not an entity.
337337
*/
338338
@SuppressWarnings("unchecked")
@@ -343,7 +343,7 @@ public <K extends IncompleteKey> FullEntity<K> getEntity(String name) {
343343
/**
344344
* Returns the property value as a list of values.
345345
*
346-
* @throws DatastoreServiceException if not such property.
346+
* @throws DatastoreException if not such property.
347347
* @throws ClassCastException if value is not a list of values.
348348
*/
349349
@SuppressWarnings("unchecked")
@@ -354,7 +354,7 @@ public List<? extends Value<?>> getList(String name) {
354354
/**
355355
* Returns the property value as a blob.
356356
*
357-
* @throws DatastoreServiceException if not such property.
357+
* @throws DatastoreException if not such property.
358358
* @throws ClassCastException if value is not a blob.
359359
*/
360360
@SuppressWarnings("unchecked")

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/Batch.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ interface Response {
4343
/**
4444
* Submit the batch to the Datastore.
4545
*
46-
* @throws DatastoreServiceException if there was any failure or if batch is not longer active
46+
* @throws DatastoreException if there was any failure or if batch is not longer active
4747
*/
4848
Response submit();
4949

5050
/**
51-
* Returns the batch associated {@link DatastoreService}.
51+
* Returns the batch associated {@link Datastore}.
5252
*/
53-
DatastoreService datastore();
53+
Datastore datastore();
5454
}

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/BatchImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class BatchImpl extends BaseDatastoreBatchWriter implements Batch {
2929

30-
private final DatastoreServiceImpl datastore;
30+
private final DatastoreImpl datastore;
3131
private final boolean force;
3232

3333
static class ResponseImpl implements Batch.Response {
@@ -49,7 +49,7 @@ public List<Key> generatedKeys() {
4949
}
5050
}
5151

52-
BatchImpl(DatastoreServiceImpl datastore, BatchOption... options) {
52+
BatchImpl(DatastoreImpl datastore, BatchOption... options) {
5353
super("batch");
5454
this.datastore = datastore;
5555
Map<Class<? extends BatchOption>, BatchOption> optionsMap = BatchOption.asImmutableMap(options);
@@ -76,7 +76,7 @@ public Batch.Response submit() {
7676
}
7777

7878
@Override
79-
public DatastoreService datastore() {
79+
public Datastore datastore() {
8080
return datastore;
8181
}
8282
}

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreService.java renamed to gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/Datastore.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
/**
2424
* An interface for Google Cloud Datastore.
2525
*/
26-
public interface DatastoreService extends Service<DatastoreServiceOptions>, DatastoreReaderWriter {
26+
public interface Datastore extends Service<DatastoreOptions>, DatastoreReaderWriter {
2727

2828
/**
2929
* Returns a new Datastore transaction.
3030
*
31-
* @throws DatastoreServiceException upon failure
31+
* @throws DatastoreException upon failure
3232
*/
3333
Transaction newTransaction(TransactionOption... options);
3434

@@ -47,15 +47,15 @@ interface TransactionCallable<T> {
4747

4848

4949
/**
50-
* Invokes the callback's {@link DatastoreService.TransactionCallable#run} method with a
50+
* Invokes the callback's {@link Datastore.TransactionCallable#run} method with a
5151
* {@link DatastoreReaderWriter} that is associated with a new transaction.
5252
* The transaction will be committed upon successful invocation.
5353
* Any thrown exception will cause the transaction to rollback and will be propagated
54-
* as a {@link DatastoreServiceException} with the original exception as its root cause.
54+
* as a {@link DatastoreException} with the original exception as its root cause.
5555
*
5656
* @param callable the callback to call with a newly created transactional readerWriter
5757
* @param options the options for the created transaction
58-
* @throws DatastoreServiceException upon failure
58+
* @throws DatastoreException upon failure
5959
*/
6060
<T> T runInTransaction(TransactionCallable<T> callable, TransactionOption... options);
6161

@@ -69,35 +69,35 @@ interface TransactionCallable<T> {
6969
* The returned key will have the same information (projectId, kind, namespace and ancestors)
7070
* as the given key and will have a newly assigned id.
7171
*
72-
* @throws DatastoreServiceException upon failure
72+
* @throws DatastoreException upon failure
7373
*/
7474
Key allocateId(IncompleteKey key);
7575

7676
/**
7777
* Returns a list of keys using the allocated ids ordered by the input.
7878
*
79-
* @throws DatastoreServiceException upon failure
79+
* @throws DatastoreException upon failure
8080
* @see #allocateId(IncompleteKey)
8181
*/
8282
List<Key> allocateId(IncompleteKey... key);
8383

8484
/**
8585
* {@inheritDoc}
86-
* @throws DatastoreServiceException upon failure
86+
* @throws DatastoreException upon failure
8787
*/
8888
@Override
8989
void update(Entity... entity);
9090

9191
/**
9292
* {@inheritDoc}
93-
* @throws DatastoreServiceException upon failure
93+
* @throws DatastoreException upon failure
9494
*/
9595
@Override
9696
void put(Entity... entity);
9797

9898
/**
9999
* {@inheritDoc}
100-
* @throws DatastoreServiceException upon failure
100+
* @throws DatastoreException upon failure
101101
*/
102102
@Override
103103
void delete(Key... key);

gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreBatchWriter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface DatastoreBatchWriter extends DatastoreWriter {
3131
* to submit time.
3232
*
3333
* @throws IllegalArgumentException if any of the given entities is missing a key
34-
* @throws com.google.gcloud.datastore.DatastoreServiceException if a given entity with a
34+
* @throws DatastoreException if a given entity with a
3535
* complete key was already added to this writer or if not active
3636
*/
3737
void addWithDeferredIdAllocation(FullEntity<?>... entity);
@@ -40,7 +40,7 @@ interface DatastoreBatchWriter extends DatastoreWriter {
4040
* {@inheritDoc}
4141
* For entities with complete keys that were marked for deletion in this writer the operation
4242
* will be changed to {@link #put}.
43-
* @throws com.google.gcloud.datastore.DatastoreServiceException if a given entity with the
43+
* @throws DatastoreException if a given entity with the
4444
* same complete key was already added to this writer, if writer is not active or
4545
* if id allocation for an entity with an incomplete key failed.
4646
*/
@@ -51,7 +51,7 @@ interface DatastoreBatchWriter extends DatastoreWriter {
5151
* {@inheritDoc}
5252
* This operation will be converted to {@link #put} operation for entities that were already
5353
* added or put in this writer
54-
* @throws com.google.gcloud.datastore.DatastoreServiceException if an entity is marked for
54+
* @throws DatastoreException if an entity is marked for
5555
* deletion in this writer or if not active
5656
*/
5757
@Override
@@ -61,15 +61,15 @@ interface DatastoreBatchWriter extends DatastoreWriter {
6161
* {@inheritDoc}
6262
* This operation will also remove from this batch any prior writes for entities with the same
6363
* keys
64-
* @throws com.google.gcloud.datastore.DatastoreServiceException if not active
64+
* @throws DatastoreException if not active
6565
*/
6666
@Override
6767
void delete(Key... key);
6868

6969
/**
7070
* {@inheritDoc}
7171
* This operation will also remove from this writer any prior writes for the same entities.
72-
* @throws com.google.gcloud.datastore.DatastoreServiceException if not active
72+
* @throws DatastoreException if not active
7373
*/
7474
@Override
7575
void put(Entity... entity);

0 commit comments

Comments
 (0)