Skip to content

Commit d35bbce

Browse files
committed
---
yaml --- r: 6251 b: refs/heads/tswast-patch-1 c: 77bfdd7 h: refs/heads/master i: 6249: 8245203 6247: f0ed835
1 parent 625e453 commit d35bbce

7 files changed

Lines changed: 35 additions & 13 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 9f95061daf40f1b222383e8322babf51a7b019bb
60+
refs/heads/tswast-patch-1: 77bfdd7867f2d89e38e7aea208238f0b5daef23e
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/gcloud-java-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Google Cloud Java Client -- Core
1+
Google Cloud Java Client -- Core Services
22
=========================================
33

44
This module provides common functionality required by service-specific modules of this library.

branches/tswast-patch-1/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static java.nio.charset.StandardCharsets.UTF_8;
2323

2424
import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
25+
import com.google.api.client.http.HttpRequest;
2526
import com.google.api.client.http.HttpRequestInitializer;
2627
import com.google.api.client.http.HttpTransport;
2728
import com.google.api.client.http.javanet.NetHttpTransport;
@@ -60,6 +61,8 @@ public abstract class ServiceOptions<
6061
private final AuthCredentials authCredentials;
6162
private final RetryParams retryParams;
6263
private final ServiceRpcFactory<ServiceRpcT, OptionsT> serviceRpcFactory;
64+
private final int connectTimeout;
65+
private final int readTimeout;
6366

6467
public interface HttpTransportFactory extends Serializable {
6568
HttpTransport create();
@@ -102,6 +105,8 @@ protected abstract static class Builder<
102105
private AuthCredentials authCredentials;
103106
private RetryParams retryParams;
104107
private ServiceRpcFactory<ServiceRpcT, OptionsT> serviceRpcFactory;
108+
private int connectTimeout = -1;
109+
private int readTimeout = -1;
105110

106111
protected Builder() {}
107112

@@ -150,6 +155,16 @@ public B serviceRpcFactory(ServiceRpcFactory<ServiceRpcT, OptionsT> serviceRpcFa
150155
this.serviceRpcFactory = serviceRpcFactory;
151156
return self();
152157
}
158+
159+
public B connectTimeout(int connectTimeout) {
160+
this.connectTimeout = connectTimeout;
161+
return self();
162+
}
163+
164+
public B readTimeout(int readTimeout) {
165+
this.readTimeout = readTimeout;
166+
return self();
167+
}
153168
}
154169

155170
protected ServiceOptions(Builder<ServiceRpcT, OptionsT, ?> builder) {
@@ -160,6 +175,8 @@ protected ServiceOptions(Builder<ServiceRpcT, OptionsT, ?> builder) {
160175
authCredentials = firstNonNull(builder.authCredentials, defaultAuthCredentials());
161176
retryParams = builder.retryParams;
162177
serviceRpcFactory = builder.serviceRpcFactory;
178+
connectTimeout = builder.connectTimeout;
179+
readTimeout = builder.readTimeout;
163180
}
164181

165182
private static AuthCredentials defaultAuthCredentials() {
@@ -303,7 +320,20 @@ public ServiceRpcFactory<ServiceRpcT, OptionsT> serviceRpcFactory() {
303320

304321
public HttpRequestInitializer httpRequestInitializer() {
305322
HttpTransport httpTransport = httpTransportFactory.create();
306-
return authCredentials().httpRequestInitializer(httpTransport, scopes());
323+
final HttpRequestInitializer baseRequestInitializer =
324+
authCredentials().httpRequestInitializer(httpTransport, scopes());
325+
return new HttpRequestInitializer() {
326+
@Override
327+
public void initialize(HttpRequest httpRequest) throws IOException {
328+
baseRequestInitializer.initialize(httpRequest);
329+
if (connectTimeout >= 0) {
330+
httpRequest.setConnectTimeout(connectTimeout);
331+
}
332+
if (readTimeout >= 0) {
333+
httpRequest.setReadTimeout(readTimeout);
334+
}
335+
}
336+
};
307337
}
308338

309339
protected int baseHashCode() {

branches/tswast-patch-1/gcloud-java-datastore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Java idiomatic client for [Google Cloud Datastore] (https://cloud.google.com/dat
88

99
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1010
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/datastore/package-summary.html)
11-
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html)
11+
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)
1212

1313
> Note: This client is a work-in-progress, and may occasionally
1414
> make backwards-incompatible changes.

branches/tswast-patch-1/gcloud-java-storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Java idiomatic client for [Google Cloud Storage] (https://cloud.google.com/stora
88

99
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1010
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/storage/package-summary.html)
11-
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html)
11+
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)
1212

1313
> Note: This client is a work-in-progress, and may occasionally
1414
> make backwards-incompatible changes.

branches/tswast-patch-1/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,9 @@ public static Builder builder() {
632632
* is only valid within a certain time period.
633633
* This is particularly useful if you don't want publicly
634634
* accessible blobs, but don't want to require users to explicitly log in.
635-
* <p>
636-
* Example usage of creating a signed URL that is valid for 2 weeks:
637-
* <pre> {@code
638-
* service.signUrl(BlobInfo.of("bucket", "name"), TimeUnit.DAYS.toSeconds(14));
639-
* }</pre>
640635
*
641636
* @param blobInfo the blob associated with the signed url
642637
* @param expirationTimeInSeconds the signed URL expiration (using epoch time)
643-
* @param options optional URL signing options
644638
* @see <a href="https://cloud.google.com/storage/docs/access-control#Signed-URLs">Signed-URLs</a>
645639
*/
646640
URL signUrl(BlobInfo blobInfo, long expirationTimeInSeconds, SignUrlOption... options);

branches/tswast-patch-1/utilities/after_success.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" -a "${TRAVIS_BRANCH}" == "master" -
2424
git add $SITE_VERSION
2525
echo "<html><head><meta http-equiv=\"refresh\" content=\"0; URL='http://GoogleCloudPlatform.github.io/gcloud-java/${SITE_VERSION}/index.html'\" /></head><body></body></html>" > index.html
2626
git add index.html
27-
echo "<html><head><script>window.location.replace('/gcloud-java/${SITE_VERSION}/apidocs' + location.search)</script></head><body></body></html>" > apidocs/index.html
28-
git add apidocs/index.html
2927
git commit -m "Added a new site for version $SITE_VERSION and updated the root directory's redirect."
3028
git config --global push.default simple
3129
git push --quiet "https://${CI_DEPLOY_USERNAME}:${CI_DEPLOY_PASSWORD}@github.com/GoogleCloudPlatform/gcloud-java.git" > /dev/null 2>&1

0 commit comments

Comments
 (0)