public final class BaseRequest extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addMetadata(HttpURLConnection request,
HashMap<String,String> metadata,
OperationContext opContext)
Adds the metadata.
|
static void |
addOptionalHeader(HttpURLConnection request,
String name,
String value)
Adds the optional header.
|
static HttpURLConnection |
create(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Creates the specified resource.
|
static HttpURLConnection |
createURLConnection(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Creates the web request.
|
static HttpURLConnection |
delete(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Deletes the specified resource.
|
static UriQueryBuilder |
getListUriQueryBuilder(ListingContext listingContext)
Gets a
UriQueryBuilder for listing. |
static HttpURLConnection |
getProperties(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Gets the properties.
|
static HttpURLConnection |
getServiceProperties(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Creates a HttpURLConnection used to retrieve the Analytics service properties from the storage service.
|
static HttpURLConnection |
getServiceStats(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Creates a web request to get the stats of the service.
|
static String |
getUserAgent()
Gets the user agent to send over the wire to identify the client.
|
static HttpURLConnection |
setMetadata(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Sets the metadata.
|
static HttpURLConnection |
setServiceProperties(URI uri,
RequestOptions options,
UriQueryBuilder builder,
OperationContext opContext)
Creates a HttpURLConnection used to set the Analytics service properties on the storage service.
|
static void |
signRequestForBlobAndQueue(HttpURLConnection request,
Credentials credentials,
Long contentLength,
OperationContext opContext)
Signs the request appropriately to make it an authenticated request for Blob and Queue.
|
static void |
signRequestForBlobAndQueueSharedKeyLite(HttpURLConnection request,
Credentials credentials,
Long contentLength,
OperationContext opContext)
|
static void |
signRequestForTableSharedKey(HttpURLConnection request,
Credentials credentials,
Long contentLength,
OperationContext opContext)
Signs the request appropriately to make it an authenticated request for Table.
|
static void |
signRequestForTableSharedKeyLite(HttpURLConnection request,
Credentials credentials,
Long contentLength,
OperationContext opContext)
|
public static void addMetadata(HttpURLConnection request, HashMap<String,String> metadata, OperationContext opContext)
request - The request.metadata - The metadata.public static void addOptionalHeader(HttpURLConnection request, String name, String value)
request - a HttpURLConnection for the operation.name - the metadata name.value - the metadata value.public static HttpURLConnection create(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - the request Uri.options - A RequestOptions object that specifies execution options such as retry policy and timeout
settings for the operation.builder - the UriQueryBuilder for the requestopContext - an object used to track the execution of the operationIOException - if there is an error opening the connectionURISyntaxException - if there is an improperly formated URIStorageExceptionIllegalArgumentExceptionpublic static HttpURLConnection createURLConnection(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - the request Uri.options - A RequestOptions object that specifies execution options such as retry policy and timeout
settings for the operation. This parameter is unused.builder - the UriQueryBuilder for the requestopContext - an object used to track the execution of the operationIOException - if there is an error opening the connectionURISyntaxException - if there is an improperly formated URIStorageExceptionpublic static HttpURLConnection delete(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - the request Uri.timeout - the timeout for the requestbuilder - the UriQueryBuilder for the requestopContext - an object used to track the execution of the operationIOException - if there is an error opening the connectionURISyntaxException - if there is an improperly formated URIStorageExceptionpublic static UriQueryBuilder getListUriQueryBuilder(ListingContext listingContext) throws StorageException
UriQueryBuilder for listing.listingContext - A ListingContext object that specifies parameters for
the listing operation, if any. May be null.StorageException - If a storage service error occurred during the operation.public static HttpURLConnection getProperties(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - The Uri to query.timeout - The timeout.builder - The builder.opContext - an object used to track the execution of the operationStorageExceptionURISyntaxExceptionIOExceptionpublic static HttpURLConnection getServiceProperties(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - The service endpoint.timeout - The timeout.builder - The builder.opContext - an object used to track the execution of the operationIOExceptionURISyntaxExceptionStorageExceptionpublic static HttpURLConnection getServiceStats(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - The service endpoint.timeout - The timeout.builder - The builder.opContext - an object used to track the execution of the operationIOExceptionURISyntaxExceptionStorageExceptionpublic static String getUserAgent()
public static HttpURLConnection setMetadata(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - The blob Uri.timeout - The timeout.builder - The builder.opContext - an object used to track the execution of the operationStorageExceptionURISyntaxExceptionIOExceptionpublic static HttpURLConnection setServiceProperties(URI uri, RequestOptions options, UriQueryBuilder builder, OperationContext opContext) throws IOException, URISyntaxException, StorageException
uri - The service endpoint.timeout - The timeout.builder - The builder.opContext - an object used to track the execution of the operationIOExceptionURISyntaxExceptionStorageExceptionpublic static void signRequestForBlobAndQueue(HttpURLConnection request, Credentials credentials, Long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
request - a HttpURLConnection for the operation.credentials - the credentials to use for signing.contentLength - the length of the content written to the output stream, -1 if unknown.opContext - an object used to track the execution of the operationInvalidKeyException - if the credentials key is invalid.StorageException@Deprecated public static void signRequestForBlobAndQueueSharedKeyLite(HttpURLConnection request, Credentials credentials, Long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
signRequestForBlobAndQueue(java.net.HttpURLConnection, com.microsoft.azure.storage.Credentials, java.lang.Long, com.microsoft.azure.storage.OperationContext) instead.request - a HttpURLConnection for the operation.credentials - the credentials to use for signing.contentLength - the length of the content written to the output stream, -1 if unknown.opContext - an object used to track the execution of the operationInvalidKeyException - if the credentials key is invalid.StorageExceptionpublic static void signRequestForTableSharedKey(HttpURLConnection request, Credentials credentials, Long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
request - a HttpURLConnection for the operation.credentials - the credentials to use for signing.contentLength - the length of the content written to the output stream, -1 if unknown.opContext - an object used to track the execution of the operationInvalidKeyException - if the credentials key is invalid.StorageException@Deprecated public static void signRequestForTableSharedKeyLite(HttpURLConnection request, Credentials credentials, Long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
signRequestForTableSharedKey(java.net.HttpURLConnection, com.microsoft.azure.storage.Credentials, java.lang.Long, com.microsoft.azure.storage.OperationContext) instead.request - a HttpURLConnection for the operation.credentials - the credentials to use for signing.contentLength - the length of the content written to the output stream, -1 if unknown.opContext - an object used to track the execution of the operationInvalidKeyException - if the credentials key is invalid.StorageException/**
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/