Skip to content

Commit 89814bb

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 2437 b: refs/heads/update-datastore c: ad12f41 h: refs/heads/master i: 2435: f38185d
1 parent 9485c92 commit 89814bb

14 files changed

Lines changed: 41 additions & 26 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: 98e9c036b1e4b7a3b1f964e6dff23ceefa2e6100
8+
refs/heads/update-datastore: ad12f4143bbcb5d6557055452717c7380cf54959
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ If you are using Maven, add this to your pom.xml file
2525
<dependency>
2626
<groupId>com.google.gcloud</groupId>
2727
<artifactId>gcloud-java</artifactId>
28-
<version>0.0.11</version>
28+
<version>0.0.10</version>
2929
</dependency>
3030
```
3131
If you are using Gradle, add this to your dependencies
3232
```Groovy
33-
compile 'com.google.gcloud:gcloud-java:jar:0.0.11'
33+
compile 'com.google.gcloud:gcloud-java:jar:0.0.10'
3434
```
3535
If you are using SBT, add this to your dependencies
3636
```Scala
37-
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.0.11"
37+
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.0.10"
3838
```
3939

4040
Example Applications

branches/update-datastore/gcloud-java-core/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ If you are using Maven, add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.gcloud</groupId>
1919
<artifactId>gcloud-java-core</artifactId>
20-
<version>0.0.11</version>
20+
<version>0.0.10</version>
2121
</dependency>
2222
```
2323
If you are using Gradle, add this to your dependencies
2424
```Groovy
25-
compile 'com.google.gcloud:gcloud-java-core:jar:0.0.11'
25+
compile 'com.google.gcloud:gcloud-java-core:jar:0.0.10'
2626
```
2727
If you are using SBT, add this to your dependencies
2828
```Scala
29-
libraryDependencies += "com.google.gcloud" % "gcloud-java-core" % "0.0.11"
29+
libraryDependencies += "com.google.gcloud" % "gcloud-java-core" % "0.0.10"
3030
```
3131

3232
Java Versions

branches/update-datastore/gcloud-java-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.gcloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.0.12-SNAPSHOT</version>
14+
<version>0.0.11-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-core</site.installationModule>

branches/update-datastore/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ public B readTimeout(int readTimeout) {
306306
protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> serviceFactoryClass,
307307
Class<? extends ServiceRpcFactory<ServiceRpcT, OptionsT>> rpcFactoryClass,
308308
Builder<ServiceT, ServiceRpcT, OptionsT, ?> builder) {
309-
projectId = checkNotNull(builder.projectId != null ? builder.projectId : defaultProject());
309+
projectId = builder.projectId != null ? builder.projectId : defaultProject();
310+
if (projectIdRequired()) {
311+
checkNotNull(projectId);
312+
}
310313
host = firstNonNull(builder.host, defaultHost());
311314
httpTransportFactory = firstNonNull(builder.httpTransportFactory,
312315
getFromServiceLoader(HttpTransportFactory.class, DefaultHttpTransportFactory.INSTANCE));
@@ -325,6 +328,16 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser
325328
clock = firstNonNull(builder.clock, Clock.defaultClock());
326329
}
327330

331+
/**
332+
* Returns whether a service requires a project ID. This method may be overridden in
333+
* service-specific Options objects.
334+
*
335+
* @return true if a project ID is required to use the service, false if not.
336+
*/
337+
public boolean projectIdRequired() {
338+
return true;
339+
}
340+
328341
private static AuthCredentials defaultAuthCredentials() {
329342
// Consider App Engine. This will not be needed once issue #21 is fixed.
330343
if (appEngineAppId() != null) {
@@ -462,6 +475,8 @@ public ServiceRpcT rpc() {
462475

463476
/**
464477
* Returns the project id.
478+
*
479+
* Return value can be null (for services that don't require a project id).
465480
*/
466481
public String projectId() {
467482
return projectId;

branches/update-datastore/gcloud-java-datastore/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ If you are using Maven, add this to your pom.xml file
2020
<dependency>
2121
<groupId>com.google.gcloud</groupId>
2222
<artifactId>gcloud-java-datastore</artifactId>
23-
<version>0.0.11</version>
23+
<version>0.0.10</version>
2424
</dependency>
2525
```
2626
If you are using Gradle, add this to your dependencies
2727
```Groovy
28-
compile 'com.google.gcloud:gcloud-java-datastore:jar:0.0.11'
28+
compile 'com.google.gcloud:gcloud-java-datastore:jar:0.0.10'
2929
```
3030
If you are using SBT, add this to your dependencies
3131
```Scala
32-
libraryDependencies += "com.google.gcloud" % "gcloud-java-datastore" % "0.0.11"
32+
libraryDependencies += "com.google.gcloud" % "gcloud-java-datastore" % "0.0.10"
3333
```
3434

3535
Example Application

branches/update-datastore/gcloud-java-datastore/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.gcloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.0.12-SNAPSHOT</version>
14+
<version>0.0.11-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-datastore</site.installationModule>

branches/update-datastore/gcloud-java-examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ If you are using Maven, add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.gcloud</groupId>
1919
<artifactId>gcloud-java-examples</artifactId>
20-
<version>0.0.11</version>
20+
<version>0.0.10</version>
2121
</dependency>
2222
```
2323
If you are using Gradle, add this to your dependencies
2424
```Groovy
25-
compile 'com.google.gcloud:gcloud-java-examples:jar:0.0.11'
25+
compile 'com.google.gcloud:gcloud-java-examples:jar:0.0.10'
2626
```
2727
If you are using SBT, add this to your dependencies
2828
```Scala
29-
libraryDependencies += "com.google.gcloud" % "gcloud-java-examples" % "0.0.11"
29+
libraryDependencies += "com.google.gcloud" % "gcloud-java-examples" % "0.0.10"
3030
```
3131

3232
To run examples from your command line:

branches/update-datastore/gcloud-java-examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.gcloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.0.12-SNAPSHOT</version>
14+
<version>0.0.11-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-examples</site.installationModule>

branches/update-datastore/gcloud-java-storage/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ If you are using Maven, add this to your pom.xml file
2020
<dependency>
2121
<groupId>com.google.gcloud</groupId>
2222
<artifactId>gcloud-java-storage</artifactId>
23-
<version>0.0.11</version>
23+
<version>0.0.10</version>
2424
</dependency>
2525
```
2626
If you are using Gradle, add this to your dependencies
2727
```Groovy
28-
compile 'com.google.gcloud:gcloud-java-storage:jar:0.0.11'
28+
compile 'com.google.gcloud:gcloud-java-storage:jar:0.0.10'
2929
```
3030
If you are using SBT, add this to your dependencies
3131
```Scala
32-
libraryDependencies += "com.google.gcloud" % "gcloud-java-storage" % "0.0.11"
32+
libraryDependencies += "com.google.gcloud" % "gcloud-java-storage" % "0.0.10"
3333
```
3434

3535
Example Application

0 commit comments

Comments
 (0)