ServiceClient
class using the specified service endpoint.
*
@@ -142,8 +147,10 @@ public ServiceProperties execute(final ServiceClient client, final Void v, final
final HttpURLConnection request = BaseRequest.getServiceProperties(client.getEndpoint(), this
.getRequestOptions().getTimeoutIntervalInMs(), null, opContext);
+ this.setConnection(request);
+
+ this.signRequest(client, request, -1, null);
- client.getCredentials().signRequest(request, -1);
ExecutionEngine.processRequest(request, opContext, this.getResult());
if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) {
@@ -167,6 +174,16 @@ public final StorageCredentials getCredentials() {
return this.credentials;
}
+ /**
+ * Returns the AuthenticationScheme associated with this service client.
+ *
+ * @return An {@link AuthenticationScheme} object that represents the authentication scheme associated with this
+ * client.
+ */
+ public final AuthenticationScheme getAuthenticationScheme() {
+ return this.authenticationScheme;
+ }
+
/**
* Returns the base URI for this service client.
*
@@ -229,6 +246,18 @@ protected final void setCredentials(final StorageCredentials credentials) {
this.credentials = credentials;
}
+ /**
+ * Sets the Authentication Scheme to use with this service client.
+ *
+ * @param scheme
+ * An AuthenticationScheme
object that represents the authentication scheme being assigned
+ * for the service
+ * client.
+ */
+ public final void setAuthenticationScheme(final AuthenticationScheme scheme) {
+ this.authenticationScheme = scheme;
+ }
+
/**
* Sets the RetryPolicyFactory object to use when making service requests.
*
@@ -317,6 +346,7 @@ public Void execute(final ServiceClient client, final Void v, final OperationCon
final HttpURLConnection request = BaseRequest.setServiceProperties(client.getEndpoint(), this
.getRequestOptions().getTimeoutIntervalInMs(), null, opContext);
+ this.setConnection(request);
final byte[] propertiesBytes = BaseRequest.serializeServicePropertiesToByteArray(properties, opContext);
@@ -326,7 +356,8 @@ public Void execute(final ServiceClient client, final Void v, final OperationCon
true /* rewindSourceStream */, true /* calculateMD5 */);
request.setRequestProperty(Constants.HeaderConstants.CONTENT_MD5, descriptor.getMd5());
- client.getCredentials().signRequest(request, descriptor.getLength());
+ this.signRequest(client, request, descriptor.getLength(), null);
+
Utility.writeToOutputStream(dataInputStream, request.getOutputStream(), descriptor.getLength(),
false /* rewindSourceStream */, false /* calculateMD5 */, null, opContext);
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentials.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentials.java
index 009a716557465..a766631e84b50 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentials.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentials.java
@@ -39,8 +39,8 @@ public abstract class StorageCredentials {
* Either include an account name with an account key (specifying values for
* {@link CloudStorageAccount#ACCOUNT_NAME_NAME} and {@link CloudStorageAccount#ACCOUNT_KEY_NAME} ), or a
* shared access signature (specifying a value for
- * {@link CloudStorageAccount#SHARED_ACCESS_SIGNATURE_NAME} ). If you use an account name and account key,
- * do not include a shared access signature, and vice versa.
+ * {@link CloudStorageAccount#SHARED_ACCESS_SIGNATURE_NAME} ). If you use an account name and account
+ * key, do not include a shared access signature, and vice versa.
*
* @return A {@link StorageCredentials} object representing the storage credentials determined from the name/value
* pairs.
@@ -81,8 +81,8 @@ protected static StorageCredentials tryParseCredentials(final HashMap
- * The format for the connection string is in the pattern "keyname=value". Multiple key/value pairs
- * can be separated by a semi-colon, for example, "keyname1=value1;keyname2=value2".
+ * The format for the connection string is in the pattern "keyname=value". Multiple key/value
+ * pairs can be separated by a semi-colon, for example, "keyname1=value1;keyname2=value2".
*
* @return A {@link StorageCredentials} object representing the storage credentials determined from the connection
* string.
@@ -214,6 +214,9 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
/**
* Signs a request under the Shared Key authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -225,12 +228,16 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
* @throws StorageException
* If a storage service error occurred.
*/
+ @Deprecated
public abstract void signRequest(HttpURLConnection request, long contentLength) throws InvalidKeyException,
StorageException;
/**
* Signs a request using the specified operation context under the Shared Key authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -245,11 +252,15 @@ public abstract void signRequest(HttpURLConnection request, long contentLength)
* @throws StorageException
* If a storage service error occurred.
*/
+ @Deprecated
public abstract void signRequest(HttpURLConnection request, long contentLength, OperationContext opContext)
throws InvalidKeyException, StorageException;
/**
- * Signs a request under the Shared Key Lite authentication scheme.
+ * Signs a table request under the Shared Key Lite authentication scheme.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
*
* @param request
* An HttpURLConnection
object that represents the request to sign.
@@ -261,11 +272,15 @@ public abstract void signRequest(HttpURLConnection request, long contentLength,
* @throws StorageException
* If an unspecified storage exception occurs.
*/
+ @Deprecated
public abstract void signRequestLite(HttpURLConnection request, long contentLength) throws StorageException,
InvalidKeyException;
/**
- * Signs a request using the specified operation context under the Shared Key Lite authentication scheme.
+ * Signs a table request using the specified operation context under the Shared Key Lite authentication scheme.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
*
* @param request
* An HttpURLConnection
object that represents the request to sign.
@@ -281,9 +296,157 @@ public abstract void signRequestLite(HttpURLConnection request, long contentLeng
* @throws StorageException
* If a storage service error occurred.
*/
+ @Deprecated
public abstract void signRequestLite(HttpURLConnection request, long contentLength, OperationContext opContext)
throws StorageException, InvalidKeyException;
+ /**
+ * Signs a request under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ *
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ public abstract void signBlobAndQueueRequest(HttpURLConnection request, long contentLength)
+ throws InvalidKeyException, StorageException;
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ public abstract void signBlobAndQueueRequest(HttpURLConnection request, long contentLength,
+ OperationContext opContext) throws InvalidKeyException, StorageException;
+
+ /**
+ * Signs a request under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If an unspecified storage exception occurs.
+ */
+ public abstract void signBlobAndQueueRequestLite(HttpURLConnection request, long contentLength)
+ throws StorageException, InvalidKeyException;
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ public abstract void signBlobAndQueueRequestLite(HttpURLConnection request, long contentLength,
+ OperationContext opContext) throws StorageException, InvalidKeyException;
+
+ /**
+ * Signs a table request under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ *
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ public abstract void signTableRequest(HttpURLConnection request, long contentLength) throws InvalidKeyException,
+ StorageException;
+
+ /**
+ * Signs a table request using the specified operation context under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ public abstract void signTableRequest(HttpURLConnection request, long contentLength, OperationContext opContext)
+ throws InvalidKeyException, StorageException;
+
+ /**
+ * Signs a table request under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If an unspecified storage exception occurs.
+ */
+ public abstract void signTableRequestLite(HttpURLConnection request, long contentLength) throws StorageException,
+ InvalidKeyException;
+
+ /**
+ * Signs a table request using the specified operation context under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+
+ public abstract void signTableRequestLite(HttpURLConnection request, long contentLength, OperationContext opContext)
+ throws StorageException, InvalidKeyException;
+
/**
* Returns a String
that represents this instance.
*
@@ -330,4 +493,5 @@ public abstract void signRequestLite(HttpURLConnection request, long contentLeng
*/
public abstract URI transformUri(URI resourceUri, OperationContext opContext) throws URISyntaxException,
StorageException;
+
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAccountAndKey.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAccountAndKey.java
index 2881295c1f26a..27fd4f9cac3f1 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAccountAndKey.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAccountAndKey.java
@@ -244,6 +244,8 @@ public void setCredentials(final Credentials credentials) {
/**
* Signs a request under the Shared Key authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -255,14 +257,17 @@ public void setCredentials(final Credentials credentials) {
* If a storage service error occurred.
*/
@Override
+ @Deprecated
public void signRequest(final java.net.HttpURLConnection request, final long contentLength)
throws InvalidKeyException, StorageException {
- this.signRequest(request, contentLength, null);
+ this.signBlobAndQueueRequest(request, contentLength, null);
}
/**
* Signs a request using the specified operation context under the Shared Key authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -278,6 +283,7 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
* If a storage service error occurred.
*/
@Override
+ @Deprecated
public void signRequest(final java.net.HttpURLConnection request, final long contentLength,
OperationContext opContext) throws InvalidKeyException, StorageException {
opContext = opContext == null ? new OperationContext() : opContext;
@@ -287,6 +293,9 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
/**
* Signs a request using the Shared Key Lite authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -298,14 +307,18 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
* If an unspecified storage exception occurs.
*/
@Override
+ @Deprecated
public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength)
throws InvalidKeyException, StorageException {
- this.signRequestLite(request, contentLength, null);
+ this.signTableRequestLite(request, contentLength, null);
}
/**
* Signs a request using the specified operation context under the Shared Key Lite authentication scheme.
*
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* An HttpURLConnection
object that represents the request to sign.
* @param contentLength
@@ -321,12 +334,185 @@ public void signRequestLite(final java.net.HttpURLConnection request, final long
* If a storage service error occurred.
*/
@Override
+ @Deprecated
public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength,
OperationContext opContext) throws StorageException, InvalidKeyException {
opContext = opContext == null ? new OperationContext() : opContext;
BaseRequest.signRequestForTableSharedKeyLite(request, this.credentials, contentLength, opContext);
}
+ /**
+ * Signs a request under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection request, final long contentLength)
+ throws InvalidKeyException, StorageException {
+ this.signBlobAndQueueRequest(request, contentLength, null);
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection request, final long contentLength,
+ OperationContext opContext) throws InvalidKeyException, StorageException {
+ opContext = opContext == null ? new OperationContext() : opContext;
+ BaseRequest.signRequestForBlobAndQueue(request, this.credentials, contentLength, opContext);
+ }
+
+ /**
+ * Signs a request using the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If an unspecified storage exception occurs.
+ */
+ @Override
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection request, final long contentLength)
+ throws InvalidKeyException, StorageException {
+ this.signBlobAndQueueRequestLite(request, contentLength, null);
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ OperationContext opContext) throws StorageException, InvalidKeyException {
+ opContext = opContext == null ? new OperationContext() : opContext;
+ BaseRequest.signRequestForBlobAndQueueSharedKeyLite(request, this.credentials, contentLength, opContext);
+ }
+
+ /**
+ * Signs a request under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection request, final long contentLength)
+ throws InvalidKeyException, StorageException {
+ this.signTableRequest(request, contentLength, null);
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection request, final long contentLength,
+ OperationContext opContext) throws InvalidKeyException, StorageException {
+ opContext = opContext == null ? new OperationContext() : opContext;
+ BaseRequest.signRequestForTableSharedKey(request, this.credentials, contentLength, opContext);
+ }
+
+ /**
+ * Signs a request using the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If an unspecified storage exception occurs.
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection request, final long contentLength)
+ throws InvalidKeyException, StorageException {
+ this.signTableRequestLite(request, contentLength, null);
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key Lite authentication scheme.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ *
+ * @throws InvalidKeyException
+ * If the given key is invalid.
+ * @throws StorageException
+ * If a storage service error occurred.
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ OperationContext opContext) throws StorageException, InvalidKeyException {
+ opContext = opContext == null ? new OperationContext() : opContext;
+ BaseRequest.signRequestForTableSharedKeyLite(request, this.credentials, contentLength, opContext);
+ }
+
/**
* Returns a String
that represents this instance, optionally including sensitive data.
*
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAnonymous.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAnonymous.java
index baf4e16dd16d6..7ceb94a78675f 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAnonymous.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsAnonymous.java
@@ -172,12 +172,16 @@ public String getAccountName() {
* Signs a request using the specified credentials under the Shared Key authentication scheme. This is not a valid
* operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param connection
* the request, as an HttpURLConnection
object, to sign
* @param contentLength
* the length of the content written to the output stream. If unknown, specify -1.
*/
@Override
+ @Deprecated
public void signRequest(final java.net.HttpURLConnection connection, final long contentLength) {
// No op
}
@@ -187,6 +191,9 @@ public void signRequest(final java.net.HttpURLConnection connection, final long
* This is not a valid operation for objects of type StorageCredentialsAnonymous
so the method performs
* a no-op.
*
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* the request, as an HttpURLConnection
object, to sign
* @param contentLength
@@ -196,6 +203,7 @@ public void signRequest(final java.net.HttpURLConnection connection, final long
* object, that represents the current operation
*/
@Override
+ @Deprecated
public void signRequest(final java.net.HttpURLConnection request, final long contentLength,
final OperationContext opContext) {
// No op
@@ -205,10 +213,14 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
* Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
* valid operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
*
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param connection
* the request, as an HttpURLConnection
object, to sign
*/
@Override
+ @Deprecated
public void signRequestLite(final java.net.HttpURLConnection connection, final long contentLength) {
// No op
}
@@ -218,6 +230,9 @@ public void signRequestLite(final java.net.HttpURLConnection connection, final l
* valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method performs a
* no-op.
*
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
* @param request
* the request, as an HttpURLConnection
object, to sign
* @param opContext
@@ -225,11 +240,136 @@ public void signRequestLite(final java.net.HttpURLConnection connection, final l
* object, that represents the current operation
*/
@Override
+ @Deprecated
public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength,
final OperationContext opContext) {
// No op
}
+ /**
+ * Signs a request using the specified credentials under the Shared Key authentication scheme. This is not a valid
+ * operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ */
+ @Override
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials and operation context under the Shared Key authentication scheme.
+ * This is not a valid operation for objects of type StorageCredentialsAnonymous
so the method performs
+ * a no-op.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ */
+ @Override
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method performs a
+ * no-op.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key authentication scheme. This is not a valid
+ * operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials and operation context under the Shared Key authentication scheme.
+ * This is not a valid operation for objects of type StorageCredentialsAnonymous
so the method performs
+ * a no-op.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method performs a
+ * no-op.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
/**
* Returns a String
object that represents this instance.
*
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsSharedAccessSignature.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsSharedAccessSignature.java
index 4702824027ff7..8e0d609f5fe60 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsSharedAccessSignature.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/StorageCredentialsSharedAccessSignature.java
@@ -96,8 +96,8 @@ public String computeHmac256(final String value) {
/**
* Computes a signature for the specified string using the HMAC-SHA256 algorithm with the specified operation
- * context. This is not a valid operation for objects of type StorageCredentialsSharedAccessSignature
so
- * the method merely returns null
.
+ * context. This is not a valid operation for objects of type StorageCredentialsSharedAccessSignature
+ * so the method merely returns null
.
*
* @param value
* The UTF-8-encoded string to sign.
@@ -130,8 +130,8 @@ public String computeHmac512(final String value) {
/**
* Computes a signature for the specified string using the HMAC-SHA512 algorithm with the specified operation
- * context. This is not a valid operation for objects of type StorageCredentialsSharedAccessSignature
so
- * the method merely returns null
.
+ * context. This is not a valid operation for objects of type StorageCredentialsSharedAccessSignature
+ * so the method merely returns null
.
*
* @param value
* The UTF-8-encoded string to sign.
@@ -181,6 +181,84 @@ public String getToken() {
return this.token;
}
+ /**
+ * Signs a request using the specified credentials under the Shared Key authentication scheme. This is not a valid
+ * operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ */
+ @Override
+ @Deprecated
+ public void signRequest(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials and operation context under the Shared Key authentication scheme.
+ * This is not a valid operation for objects of type StorageCredentialsAnonymous
so the method performs
+ * a no-op.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signBlobAndQueueRequest} or
+ * {@link signBlobAndQueueRequestLite}, depending on your desired shared key authentication scheme.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param contentLength
+ * the length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ @Deprecated
+ public void signRequest(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsAnonymous
so the method performs a no-op.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
+ * @param connection
+ * the request, as an HttpURLConnection
object, to sign
+ */
+ @Override
+ @Deprecated
+ public void signRequestLite(final java.net.HttpURLConnection connection, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified credentials under the Shared Key Lite authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method performs a
+ * no-op.
+ *
+ * @deprecated This method has been deprecated. Please use either {@link signTableRequest} or
+ * {@link signTableRequestLite}, depending on your desired shared key authentication scheme.
+ *
+ * @param request
+ * the request, as an HttpURLConnection
object, to sign
+ * @param opContext
+ * an operation context, as a {@link com.microsoft.windowsazure.services.core.storage.OperationContext}
+ * object, that represents the current operation
+ */
+ @Override
+ @Deprecated
+ public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
/**
* Signs a request under the Shared Key authentication scheme. This is not a valid operation for objects of type
* StorageCredentialsSharedAccessSignature
so the method performs a no-op.
@@ -191,7 +269,7 @@ public String getToken() {
* The length of the content written to the output stream. If unknown, specify -1.
*/
@Override
- public void signRequest(final java.net.HttpURLConnection request, final long contentLength) {
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection request, final long contentLength) {
// No op
}
@@ -210,7 +288,7 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
* the operation.
*/
@Override
- public void signRequest(final java.net.HttpURLConnection request, final long contentLength,
+ public void signBlobAndQueueRequest(final java.net.HttpURLConnection request, final long contentLength,
final OperationContext opContext) {
// No op
}
@@ -225,7 +303,7 @@ public void signRequest(final java.net.HttpURLConnection request, final long con
* The length of the content written to the output stream. If unknown, specify -1.
*/
@Override
- public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength) {
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection request, final long contentLength) {
// No op
}
@@ -244,7 +322,75 @@ public void signRequestLite(final java.net.HttpURLConnection request, final long
* the operation.
*/
@Override
- public void signRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ public void signBlobAndQueueRequestLite(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request under the Shared Key authentication scheme. This is not a valid operation for objects of type
+ * StorageCredentialsSharedAccessSignature
so the method performs a no-op.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection request, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key authentication scheme. This is not a
+ * valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method performs a
+ * no-op.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ */
+ @Override
+ public void signTableRequest(final java.net.HttpURLConnection request, final long contentLength,
+ final OperationContext opContext) {
+ // No op
+ }
+
+ /**
+ * Signs a request under the Shared Key Lite authentication scheme. This is not a valid operation for objects of
+ * type StorageCredentialsSharedAccessSignature
so the method performs a no-op.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection request, final long contentLength) {
+ // No op
+ }
+
+ /**
+ * Signs a request using the specified operation context under the Shared Key Lite authentication scheme. This is
+ * not a valid operation for objects of type StorageCredentialsSharedAccessSignature
so the method
+ * performs a no-op.
+ *
+ * @param request
+ * An HttpURLConnection
object that represents the request to sign.
+ * @param contentLength
+ * The length of the content written to the output stream. If unknown, specify -1.
+ * @param opContext
+ * An {@link OperationContext} object that represents the context for the current operation. This object
+ * is used to track requests to the storage service, and to provide additional runtime information about
+ * the operation.
+ */
+ @Override
+ public void signTableRequestLite(final java.net.HttpURLConnection request, final long contentLength,
final OperationContext opContext) {
// No op
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/Utility.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/Utility.java
index 37c099517e7d9..54e66cd05b83c 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/Utility.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/Utility.java
@@ -1015,7 +1015,10 @@ public static StreamMd5AndLength writeToOutputStream(final InputStream sourceStr
count = sourceStream.read(retrievedBuff, 0, nextCopy);
while (nextCopy > 0 && count != -1) {
- outStream.write(retrievedBuff, 0, count);
+ if (outStream != null) {
+ outStream.write(retrievedBuff, 0, count);
+ }
+
if (calculateMD5) {
opContext.getIntermediateMD5().update(retrievedBuff, 0, count);
}
@@ -1029,7 +1032,9 @@ public static StreamMd5AndLength writeToOutputStream(final InputStream sourceStr
count = sourceStream.read(retrievedBuff, 0, nextCopy);
}
- outStream.flush();
+ if (outStream != null) {
+ outStream.flush();
+ }
if (calculateMD5) {
retVal.setDigest(opContext.getIntermediateMD5());
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/BaseRequest.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/BaseRequest.java
index e5273db93f60b..19538da0c9854 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/BaseRequest.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/BaseRequest.java
@@ -498,7 +498,40 @@ public static void signRequestForBlobAndQueueSharedKeyLite(final HttpURLConnecti
/**
*
- * Signs the request appropriately to make it an authenticated request for Blob and Queue.
+ * Signs the request appropriately to make it an authenticated request for Table.
+ *
+ * @param request
+ * a HttpURLConnection for the operation.
+ * @param credentials
+ * the credentials to use for signing.
+ * @param contentLength
+ * the length of the content written to the output stream, -1 if unknown.
+ * @param opContext
+ * an object used to track the execution of the operation
+ * @throws InvalidKeyException
+ * if the credentials key is invalid.
+ * @throws StorageException
+ */
+ public static void signRequestForTableSharedKey(final HttpURLConnection request, final Credentials credentials,
+ final Long contentLength, final OperationContext opContext) throws InvalidKeyException, StorageException {
+ request.setRequestProperty(Constants.HeaderConstants.DATE, Utility.getGMTTime());
+
+ final Canonicalizer canonicalizer = CanonicalizerFactory.getTableFullCanonicalizer(request);
+
+ final String stringToSign = canonicalizer.canonicalize(request, credentials.getAccountName(), contentLength,
+ opContext);
+
+ final String computedBase64Signature = StorageKey.computeMacSha256(credentials.getKey(), stringToSign);
+
+ // TODO Vnext add logging
+ // System.out.println(String.format("Signing %s\r\n%s\r\n", stringToSign, computedBase64Signature));
+ request.setRequestProperty(Constants.HeaderConstants.AUTHORIZATION,
+ String.format("%s %s:%s", "SharedKey", credentials.getAccountName(), computedBase64Signature));
+ }
+
+ /**
+ *
+ * Signs the request appropriately to make it an authenticated request for Table.
*
* @param request
* a HttpURLConnection for the operation.
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/Canonicalizer.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/Canonicalizer.java
index b78e9c258cd3a..77c5f71d266d7 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/Canonicalizer.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/Canonicalizer.java
@@ -34,11 +34,26 @@
import com.microsoft.windowsazure.services.core.storage.utils.Utility;
/**
- * RESERVED FOR INTERNAL USE. This is a Version 2 Canoncicalization strategy conforming to the PDC 2009-09-19
+ * RESERVED FOR INTERNAL USE. This is a Version 2 Canonicalization strategy conforming to the PDC 2009-09-19
* specification
*/
abstract class Canonicalizer {
+ /**
+ * The expected length for the canonicalized string when SharedKeyFull is used to sign requests.
+ */
+ private static final int ExpectedBlobQueueCanonicalizedStringLength = 300;
+
+ /**
+ * The expected length for the canonicalized string when SharedKeyLite is used to sign requests.
+ */
+ private static final int ExpectedBlobQueueLiteCanonicalizedStringLength = 250;
+
+ /**
+ * The expected length for the canonicalized string when SharedKeyFull is used to sign table requests.
+ */
+ private static final int ExpectedTableCanonicalizedStringLength = 200;
+
/**
* Add x-ms- prefixed headers in a fixed order.
*
@@ -130,7 +145,8 @@ protected static String canonicalizeHttpRequest(final java.net.URL address, fina
// The first element should be the Method of the request.
// I.e. GET, POST, PUT, or HEAD.
- final StringBuilder canonicalizedString = new StringBuilder(conn.getRequestMethod());
+ final StringBuilder canonicalizedString = new StringBuilder(ExpectedBlobQueueCanonicalizedStringLength);
+ canonicalizedString.append(conn.getRequestMethod());
// The next elements are
// If any element is missing it may be empty.
@@ -199,7 +215,9 @@ protected static String canonicalizeHttpRequestLite(final java.net.URL address,
final HttpURLConnection conn, final OperationContext opContext) throws StorageException {
// The first element should be the Method of the request.
// I.e. GET, POST, PUT, or HEAD.
- final StringBuilder canonicalizedString = new StringBuilder(conn.getRequestMethod());
+ //
+ final StringBuilder canonicalizedString = new StringBuilder(ExpectedBlobQueueLiteCanonicalizedStringLength);
+ canonicalizedString.append(conn.getRequestMethod());
// The second element should be the MD5 value.
// This is optional and may be empty.
@@ -220,7 +238,59 @@ protected static String canonicalizeHttpRequestLite(final java.net.URL address,
addCanonicalizedHeaders(conn, canonicalizedString);
- appendCanonicalizedElement(canonicalizedString, getCanonicalizedResource(address, accountName));
+ appendCanonicalizedElement(canonicalizedString, getCanonicalizedResourceLite(address, accountName));
+
+ return canonicalizedString.toString();
+ }
+
+ /**
+ * Constructs a canonicalized string that will be used to construct the signature string
+ * for signing a Table service request under the Shared Key authentication scheme.
+ *
+ * @param address
+ * the request URI
+ * @param accountName
+ * the account name associated with the request
+ * @param method
+ * the verb to be used for the HTTP request.
+ * @param contentType
+ * the content type of the HTTP request.
+ * @param contentLength
+ * the length of the content written to the outputstream in bytes, -1 if unknown
+ * @param date
+ * the date/time specification for the HTTP request
+ * @param conn
+ * the HttpURLConnection for the operation.
+ * @param opContext
+ * the OperationContext for the request.
+ * @return A canonicalized string.
+ * @throws StorageException
+ */
+ protected static String canonicalizeTableHttpRequest(final java.net.URL address, final String accountName,
+ final String method, final String contentType, final long contentLength, final String date,
+ final HttpURLConnection conn, final OperationContext opContext) throws StorageException {
+ // The first element should be the Method of the request.
+ // I.e. GET, POST, PUT, or HEAD.
+ final StringBuilder canonicalizedString = new StringBuilder(ExpectedTableCanonicalizedStringLength);
+ canonicalizedString.append(conn.getRequestMethod());
+
+ // The second element should be the MD5 value.
+ // This is optional and may be empty.
+ final String httpContentMD5Value = Utility.getStandardHeaderValue(conn, Constants.HeaderConstants.CONTENT_MD5);
+ appendCanonicalizedElement(canonicalizedString, httpContentMD5Value);
+
+ // The third element should be the content type.
+ appendCanonicalizedElement(canonicalizedString, contentType);
+
+ // The fourth element should be the request date.
+ // See if there's an storage date header.
+ // If there's one, then don't use the date header.
+
+ final String dateString = Utility.getStandardHeaderValue(conn, Constants.HeaderConstants.DATE);
+ // If x-ms-date header exists, Date should be that value.
+ appendCanonicalizedElement(canonicalizedString, dateString.equals(Constants.EMPTY_STRING) ? date : dateString);
+
+ appendCanonicalizedElement(canonicalizedString, getCanonicalizedResourceLite(address, accountName));
return canonicalizedString.toString();
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/CanonicalizerFactory.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/CanonicalizerFactory.java
index 54ae1d41fe3ec..1ba789f44c40b 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/CanonicalizerFactory.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/CanonicalizerFactory.java
@@ -45,6 +45,11 @@ final class CanonicalizerFactory {
/**
* The Canonicalizer instance for Table
*/
+ private static final TableFullCanonicalizer TABLE_FULL_INSTANCE = new TableFullCanonicalizer();
+
+ /**
+ * The Canonicalizer instance for Table Lite
+ */
private static final TableLiteCanonicalizer TABLE_LITE_INSTANCE = new TableLiteCanonicalizer();
/**
@@ -81,7 +86,18 @@ protected static Canonicalizer getBlobQueueLiteCanonicalizer(final HttpURLConnec
}
/**
- * Gets the Blob queue lite Canonicalizer
+ * Gets the table full Canonicalizer.
+ *
+ * @param conn
+ * the HttpURLConnection for the current operation
+ * @return the appropriate Canonicalizer for the operation.
+ */
+ protected static Canonicalizer getTableFullCanonicalizer(final HttpURLConnection conn) {
+ return TABLE_FULL_INSTANCE;
+ }
+
+ /**
+ * Gets the table lite Canonicalizer
*
* @param conn
* the HttpURLConnection for the current operation
@@ -93,7 +109,7 @@ protected static Canonicalizer getTableLiteCanonicalizer(final HttpURLConnection
}
else {
throw new UnsupportedOperationException(
- "Versions before 2009-09-19 do not support Shared Key Lite for Blob And Queue.");
+ "Versions before 2009-09-19 do not support Shared Key Lite for Table.");
}
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/ExecutionEngine.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/ExecutionEngine.java
index 9d3ad41e569ab..9e60f511677bd 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/ExecutionEngine.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/utils/implementation/ExecutionEngine.java
@@ -36,6 +36,7 @@
import com.microsoft.windowsazure.services.core.storage.SendingRequestEvent;
import com.microsoft.windowsazure.services.core.storage.StorageErrorCodeStrings;
import com.microsoft.windowsazure.services.core.storage.StorageException;
+import com.microsoft.windowsazure.services.core.storage.utils.Utility;
import com.microsoft.windowsazure.services.table.client.TableServiceException;
/**
@@ -113,7 +114,25 @@ public static Queue
object that represents the queue to create.
+ * @param queueInfo
+ * A QueueInfo
object that represents the queue to create.
* @return A CreateQueueResult
object that represents the result.
* @throws ServiceException
* If a service exception is encountered.
*/
- CreateQueueResult createQueue(QueueInfo queue) throws ServiceException;
+ CreateQueueResult createQueue(QueueInfo queueInfo) throws ServiceException;
/**
* Deletes a queue.
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/EntryModel.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/EntryModel.java
index 71f11d9e6e463..e61d84d987e70 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/EntryModel.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/EntryModel.java
@@ -2,15 +2,15 @@
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.microsoft.windowsazure.services.serviceBus.implementation;
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusConnectionSettings.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusConnectionSettings.java
index dc0d3da353c8c..20bd238789b9e 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusConnectionSettings.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusConnectionSettings.java
@@ -1,11 +1,11 @@
/**
* Copyright Microsoft Corporation
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,18 +15,17 @@
package com.microsoft.windowsazure.services.serviceBus.implementation;
-import com.microsoft.windowsazure.services.core.utils.ConnectionStringSyntaxException;
-
import java.net.URI;
import java.net.URISyntaxException;
+import com.microsoft.windowsazure.services.core.utils.ConnectionStringSyntaxException;
+
/**
* Class that encapsulates all the various settings needed
* to connect to Service Bus, provided via either a
* connection string or via separate configuration variables.
*
- * The connection string is looked for first, falling back
- * to separate config values if not found.
+ * The connection string is looked for first, falling back to separate config values if not found.
*/
class ServiceBusConnectionSettings {
private String uri;
@@ -34,10 +33,12 @@ class ServiceBusConnectionSettings {
private String wrapName;
private String wrapPassword;
- public ServiceBusConnectionSettings(String connectionString, String uri, String wrapUri, String wrapName, String wrapPassword) throws ConnectionStringSyntaxException, URISyntaxException {
+ public ServiceBusConnectionSettings(String connectionString, String uri, String wrapUri, String wrapName,
+ String wrapPassword) throws ConnectionStringSyntaxException, URISyntaxException {
if (connectionString != null) {
parseConnectionString(connectionString);
- } else {
+ }
+ else {
this.uri = uri;
this.wrapUri = wrapUri;
this.wrapName = wrapName;
@@ -61,7 +62,8 @@ public String getWrapPassword() {
return wrapPassword;
}
- private boolean parseConnectionString(String connectionString) throws URISyntaxException, ConnectionStringSyntaxException {
+ private boolean parseConnectionString(String connectionString) throws URISyntaxException,
+ ConnectionStringSyntaxException {
ServiceBusConnectionString cs = new ServiceBusConnectionString(connectionString);
setUri(cs);
setWrapUri(cs);
@@ -79,8 +81,9 @@ private void setWrapUri(ServiceBusConnectionString connectionString) throws URIS
URI hostUri = new URI(uri);
String namespace = hostUri.getHost().split("\\.")[0];
wrapUri = "https://" + namespace + "-sb.accesscontrol.windows.net/WRAPv0.9";
- } else {
- wrapUri = connectionString.getStsEndpoint();
+ }
+ else {
+ wrapUri = connectionString.getStsEndpoint().replaceAll("\\/$", "") + "/WRAPv0.9";
}
}
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusRestProxy.java
index 482d26a741990..c27d177b5d025 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusRestProxy.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/ServiceBusRestProxy.java
@@ -267,9 +267,13 @@ public void deleteMessage(BrokeredMessage message) throws ServiceException {
}
@Override
- public CreateQueueResult createQueue(QueueInfo entry) throws ServiceException {
- return new CreateQueueResult(getResource().path(entry.getPath())
- .type("application/atom+xml;type=entry;charset=utf-8").put(QueueInfo.class, entry));
+ public CreateQueueResult createQueue(QueueInfo queueInfo) throws ServiceException {
+ Builder webResourceBuilder = getResource().path(queueInfo.getPath()).type(
+ "application/atom+xml;type=entry;charset=utf-8");
+ if ((queueInfo.getForwardTo() != null) && !queueInfo.getForwardTo().isEmpty()) {
+ webResourceBuilder.header("ServiceBusSupplementaryAuthorization", queueInfo.getForwardTo());
+ }
+ return new CreateQueueResult(webResourceBuilder.put(QueueInfo.class, queueInfo));
}
@Override
@@ -296,8 +300,12 @@ public ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceExce
@Override
public QueueInfo updateQueue(QueueInfo queueInfo) throws ServiceException {
- return getResource().path(queueInfo.getPath()).type("application/atom+xml;type=entry;charset=utf-8")
- .header("If-Match", "*").put(QueueInfo.class, queueInfo);
+ Builder webResourceBuilder = getResource().path(queueInfo.getPath())
+ .type("application/atom+xml;type=entry;charset=utf-8").header("If-Match", "*");
+ if ((queueInfo.getForwardTo() != null) && !queueInfo.getForwardTo().isEmpty()) {
+ webResourceBuilder.header("ServiceBusSupplementaryAuthorization", queueInfo.getForwardTo());
+ }
+ return webResourceBuilder.put(QueueInfo.class, queueInfo);
}
private WebResource listOptions(AbstractListOptions> options, WebResource path) {
@@ -307,6 +315,9 @@ private WebResource listOptions(AbstractListOptions> options, WebResource path
if (options.getSkip() != null) {
path = path.queryParam("$skip", options.getSkip().toString());
}
+ if (options.getFilter() != null) {
+ path = path.queryParam("$filter", options.getFilter());
+ }
return path;
}
@@ -345,10 +356,14 @@ public TopicInfo updateTopic(TopicInfo topicInfo) throws ServiceException {
}
@Override
- public CreateSubscriptionResult createSubscription(String topicPath, SubscriptionInfo subscription) {
- return new CreateSubscriptionResult(getResource().path(topicPath).path("subscriptions")
- .path(subscription.getName()).type("application/atom+xml;type=entry;charset=utf-8")
- .put(SubscriptionInfo.class, subscription));
+ public CreateSubscriptionResult createSubscription(String topicPath, SubscriptionInfo subscriptionInfo) {
+ Builder webResourceBuilder = getResource().path(topicPath).path("subscriptions")
+ .path(subscriptionInfo.getName()).type("application/atom+xml;type=entry;charset=utf-8");
+ if ((subscriptionInfo.getForwardTo() != null) && (!subscriptionInfo.getForwardTo().isEmpty())) {
+ webResourceBuilder.header("ServiceBusSupplementaryAuthorization", subscriptionInfo.getForwardTo());
+
+ }
+ return new CreateSubscriptionResult(webResourceBuilder.put(SubscriptionInfo.class, subscriptionInfo));
}
@Override
@@ -377,9 +392,13 @@ public ListSubscriptionsResult listSubscriptions(String topicPath, ListSubscript
@Override
public SubscriptionInfo updateSubscription(String topicName, SubscriptionInfo subscriptionInfo)
throws ServiceException {
- return getResource().path(topicName).path("subscriptions").path(subscriptionInfo.getName())
- .type("application/atom+xml;type=entry;charset=utf-8").header("If-Match", "*")
- .put(SubscriptionInfo.class, subscriptionInfo);
+ Builder webResourceBuilder = getResource().path(topicName).path("subscriptions")
+ .path(subscriptionInfo.getName()).type("application/atom+xml;type=entry;charset=utf-8")
+ .header("If-Match", "*");
+ if ((subscriptionInfo.getForwardTo() != null) && !subscriptionInfo.getForwardTo().isEmpty()) {
+ webResourceBuilder.header("ServiceBusSupplementaryAuthorization", subscriptionInfo.getForwardTo());
+ }
+ return webResourceBuilder.put(SubscriptionInfo.class, subscriptionInfo);
}
@Override
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/WrapFilter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/WrapFilter.java
index ac3c15b3a7d08..f1d0187a6b21c 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/WrapFilter.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/implementation/WrapFilter.java
@@ -2,18 +2,19 @@
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.microsoft.windowsazure.services.serviceBus.implementation;
+import java.net.URI;
import java.net.URISyntaxException;
import com.microsoft.windowsazure.services.core.ServiceException;
@@ -31,10 +32,23 @@ public WrapFilter(WrapTokenManager tokenManager) {
@Override
public ClientResponse handle(ClientRequest cr) throws ClientHandlerException {
+ String accessToken = getWrapToken(cr.getURI());
+ cr.getHeaders().add("Authorization", accessToken);
- String accessToken;
+ String secondaryAuthorizationUri = (String) cr.getHeaders().getFirst("ServiceBusSupplementaryAuthorization");
+ if ((secondaryAuthorizationUri != null) && (!secondaryAuthorizationUri.isEmpty())) {
+ String secondaryAccessToken = getWrapToken(URI.create(secondaryAuthorizationUri));
+ cr.getHeaders().remove("ServiceBusSupplementaryAuthorization");
+ cr.getHeaders().add("ServiceBusSupplementaryAuthorization", secondaryAccessToken);
+ }
+
+ return this.getNext().handle(cr);
+ }
+
+ private String getWrapToken(URI uri) {
+ String result;
try {
- accessToken = tokenManager.getAccessToken(cr.getURI());
+ result = tokenManager.getAccessToken(uri);
}
catch (ServiceException e) {
// must wrap exception because of base class signature
@@ -45,8 +59,6 @@ public ClientResponse handle(ClientRequest cr) throws ClientHandlerException {
throw new ClientHandlerException(e);
}
- cr.getHeaders().add("Authorization", "WRAP access_token=\"" + accessToken + "\"");
-
- return this.getNext().handle(cr);
+ return "WRAP access_token=\"" + result + "\"";
}
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/AbstractListOptions.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/AbstractListOptions.java
index 5970d10fc96f7..d18d87edf874d 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/AbstractListOptions.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/AbstractListOptions.java
@@ -2,21 +2,22 @@
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package com.microsoft.windowsazure.services.serviceBus.models;
public abstract class AbstractListOptionsMessageCountDetails
instance that represents the details of the message count.
+ */
+ public MessageCountDetails getCountDetails() {
+ return getModel().getCountDetails();
+ }
+
+ /**
+ * Sets the URI of the QueueInfo
instance.
+ *
+ * @param uri
+ * the URI of the QueueInfo
+ *
+ * @return A QueueInfo
object that represents the updated queue.
+ */
+ public QueueInfo setUri(URI uri) {
+ getEntry().setId(uri.toString());
+ return this;
+ }
+
+ /**
+ * Gets the URI of the QueueInfo
instance.
+ *
+ * @return A URI
representing the QueueInfo
.
+ */
+ public URI getUri() {
+ return URI.create(removeQueryString(getEntry().getId()));
+ }
+
+ /**
+ * Removes the query string of the URI.
+ *
+ * @param uri
+ * A raw string representing the URI of queue.
+ * @return the string
+ */
+ private String removeQueryString(String uri) {
+ String[] result = uri.split("\\?");
+ return result[0];
+ }
+
+ /**
+ * Sets the URI of the entity to forward to.
+ *
+ * @param forwardTo
+ * A String
instance representing the URI of the entity to forward message to.
+ * @return A QueueInfo
instance representing the updated queue information.
+ */
+ public QueueInfo setForwardTo(String forwardTo) {
+ getModel().setForwardTo(forwardTo);
+ return this;
+ }
+
+ /**
+ * Gets a String
instance representing entity to forward to.
+ *
+ * @return A String
instance representing the URI of the instance to forward to.
+ */
+ public String getForwardTo() {
+ return getModel().getForwardTo();
+ }
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/SubscriptionInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/SubscriptionInfo.java
index 04263c1115036..0df71b38b78f5 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/SubscriptionInfo.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/SubscriptionInfo.java
@@ -24,6 +24,7 @@
import com.microsoft.windowsazure.services.serviceBus.implementation.EntityStatus;
import com.microsoft.windowsazure.services.serviceBus.implementation.Entry;
import com.microsoft.windowsazure.services.serviceBus.implementation.EntryModel;
+import com.microsoft.windowsazure.services.serviceBus.implementation.MessageCountDetails;
import com.microsoft.windowsazure.services.serviceBus.implementation.RuleDescription;
import com.microsoft.windowsazure.services.serviceBus.implementation.SubscriptionDescription;
@@ -430,4 +431,34 @@ public EntityAvailabilityStatus getEntityAvailabilityStatus() {
return getModel().getEntityAvailabilityStatus();
}
+ /**
+ * Gets the message count details.
+ *
+ * @return A MessageCountDetails
instance representing the details of the message count.
+ */
+ public MessageCountDetails getCountDetails() {
+ return getModel().getCountDetails();
+ }
+
+ /**
+ * Sets the forward to.
+ *
+ * @param forwardTo
+ * A String
representing the string to forward to.
+ * @return the subscription info
+ */
+ public SubscriptionInfo setForwardTo(String forwardTo) {
+ getModel().setForwardTo(forwardTo);
+ return this;
+ }
+
+ /**
+ * Gets a String
representing the URI of the entity to forward to.
+ *
+ * @return A String
representing the URI of the entity to forward to.
+ */
+ public String getForwardTo() {
+ return getModel().getForwardTo();
+ }
+
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/TopicInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/TopicInfo.java
index 627af7f6d05ea..d3233b1a81745 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/TopicInfo.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/TopicInfo.java
@@ -14,6 +14,7 @@
*/
package com.microsoft.windowsazure.services.serviceBus.models;
+import java.net.URI;
import java.util.Calendar;
import javax.ws.rs.core.MediaType;
@@ -24,6 +25,7 @@
import com.microsoft.windowsazure.services.serviceBus.implementation.EntityStatus;
import com.microsoft.windowsazure.services.serviceBus.implementation.Entry;
import com.microsoft.windowsazure.services.serviceBus.implementation.EntryModel;
+import com.microsoft.windowsazure.services.serviceBus.implementation.MessageCountDetails;
import com.microsoft.windowsazure.services.serviceBus.implementation.PartitioningPolicy;
import com.microsoft.windowsazure.services.serviceBus.implementation.TopicDescription;
@@ -405,6 +407,15 @@ public Integer getSubscriptionCount() {
return getModel().getSubscriptionCount();
}
+ /**
+ * Gets the message count details.
+ *
+ * @return A MessageCountDetails
instance representing the details of the message count.
+ */
+ public MessageCountDetails getCountDetails() {
+ return getModel().getCountDetails();
+ }
+
/**
* Sets the auto delete on idle.
*
@@ -467,4 +478,13 @@ public TopicInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvai
public EntityAvailabilityStatus getEntityAvailabilityStatus() {
return getModel().getEntityAvailabilityStatus();
}
+
+ /**
+ * Gets the uri.
+ *
+ * @return the uri
+ */
+ public URI getUri() {
+ return URI.create(getEntry().getId());
+ }
}
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTable.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTable.java
index f13eac657acfc..298f2a8f6064a 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTable.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTable.java
@@ -483,13 +483,16 @@ public Void execute(final CloudTableClient client, final CloudTable table, final
final HttpURLConnection request = TableRequest.setAcl(table.uri, this.getRequestOptions()
.getTimeoutIntervalInMs(), opContext);
+ this.setConnection(request);
final StringWriter outBuffer = new StringWriter();
TableRequest.writeSharedAccessIdentifiersToStream(permissions.getSharedAccessPolicies(), outBuffer);
final byte[] aclBytes = outBuffer.toString().getBytes("UTF8");
- client.getCredentials().signRequestLite(request, aclBytes.length, opContext);
+
+ this.signTableRequest(client, request, aclBytes.length, opContext);
+
final OutputStream outStreamRef = request.getOutputStream();
outStreamRef.write(aclBytes);
@@ -561,8 +564,9 @@ public TablePermissions execute(final CloudTableClient client, final CloudTable
final HttpURLConnection request = TableRequest.getAcl(table.uri, tableName, this.getRequestOptions()
.getTimeoutIntervalInMs(), opContext);
+ this.setConnection(request);
- client.getCredentials().signRequestLite(request, -1L, opContext);
+ this.signTableRequest(client, request, -1L, opContext);
ExecutionEngine.processRequest(request, opContext, this.getResult());
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTableClient.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTableClient.java
index 26a506cc39a65..ca181e471aa67 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTableClient.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/table/client/CloudTableClient.java
@@ -797,8 +797,9 @@ protected