diff --git a/aws/s3/core/src/main/java/org/jclouds/aws/s3/S3ContextBuilder.java b/aws/s3/core/src/main/java/org/jclouds/aws/s3/S3ContextBuilder.java index fbc2d8b571..2ded8eccf3 100644 --- a/aws/s3/core/src/main/java/org/jclouds/aws/s3/S3ContextBuilder.java +++ b/aws/s3/core/src/main/java/org/jclouds/aws/s3/S3ContextBuilder.java @@ -90,6 +90,11 @@ public class S3ContextBuilder extends return (S3ContextBuilder) super.relaxSSLHostname(); } + @Override + public S3ContextBuilder withRequestTimeout(long milliseconds) { + return (S3ContextBuilder) super.withRequestTimeout(milliseconds); + } + @Override public S3ContextBuilder withExecutorService(ExecutorService service) { return (S3ContextBuilder) super.withExecutorService(service); diff --git a/azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java b/azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java index 75b33f16b4..4106928262 100755 --- a/azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java +++ b/azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContextBuilder.java @@ -145,6 +145,11 @@ public class AzureBlobContextBuilder extends return (AzureBlobContextBuilder) super.withPoolMaxConnections(poolMaxConnections); } + @Override + public AzureBlobContextBuilder withRequestTimeout(long milliseconds) { + return (AzureBlobContextBuilder) super.withRequestTimeout(milliseconds); + } + @Override public AzureBlobContextBuilder withPoolMaxSessionFailures(int poolMaxSessionFailures) { return (AzureBlobContextBuilder) super.withPoolMaxSessionFailures(poolMaxSessionFailures); diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreContextBuilder.java b/blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreContextBuilder.java index 880e4e2f76..9a85acbdbc 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreContextBuilder.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreContextBuilder.java @@ -30,6 +30,7 @@ import java.util.concurrent.ExecutorService; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.domain.ContainerMetadata; +import org.jclouds.blobstore.reference.BlobStoreConstants; import org.jclouds.cloud.CloudContextBuilder; import com.google.inject.Key; @@ -54,6 +55,14 @@ public abstract class BlobStoreContextBuilder) super.withHttpMaxRedirects(httpMaxRedirects); } + /** + * longest time a single synchronous operation can take before throwing an exception. + */ + public BlobStoreContextBuilder withRequestTimeout(long milliseconds) { + properties.setProperty(BlobStoreConstants.PROPERTY_BLOBSTORE_TIMEOUT, Long.toString(milliseconds)); + return this; + } + @SuppressWarnings("unchecked") @Override public BlobStoreContextBuilder withHttpMaxRetries(int httpMaxRetries) { diff --git a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java index 110dc9e369..a0caee7aff 100755 --- a/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java +++ b/blobstore/core/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java @@ -52,8 +52,8 @@ public class BaseContainerIntegrationTest container = context.getBlobStore().listBlobs(containerName).get(10, + SortedSet container = context.getBlobStore().listBlobs(containerName).get(60, TimeUnit.SECONDS); assertEquals(container.size(), 15); } finally { @@ -126,7 +126,7 @@ public class BaseContainerIntegrationTest