BaseRequest Class

  • java.lang.Object
    • com.microsoft.azure.storage.core.BaseRequest

public class BaseRequest

RESERVED FOR INTERNAL USE. The Base Request class for the protocol layer.

Method Summary

Modifier and Type Method and Description
void addMetadata(final HttpURLConnection request, final Map<String, String> metadata, final OperationContext opContext)

Adds the metadata.

void addOptionalHeader(final HttpURLConnection request, final String name, final String value)

Adds the optional header.

HttpURLConnection batch(final URI uri, final RequestOptions options, final OperationContext opContext, final AccessCondition accessCondition)
static<C extends ServiceClient, P, R> byte [] buildBatchBody(final C client, final BatchOperation<C, P, R> batch, final OperationContext opContext)
HttpURLConnection create(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates the specified resource. Note request is set to setFixedLengthStreamingMode(0); Sign with 0 length.

HttpURLConnection createURLConnection(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates the web request.

HttpURLConnection delete(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Deletes the specified resource. Sign with no length specified.

HttpURLConnection getAccountInfo(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)
UriQueryBuilder getListUriQueryBuilder(final ListingContext listingContext)

Gets a UriQueryBuilder for listing.

HttpURLConnection getProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Gets the properties. Sign with no length specified.

HttpURLConnection getServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to retrieve the Analytics service properties from the storage service.

HttpURLConnection getServiceStats(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a web request to get the stats of the service.

String getUserAgent()

Gets the user agent to send over the wire to identify the client.

HttpURLConnection getUserDelegationKey(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to request a UserDelegationKey from the service.

HttpURLConnection setMetadata(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Sets the metadata. Sign with 0 length.

HttpURLConnection setServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to set the Analytics service properties on the storage service.

HttpURLConnection undelete(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Un-deletes the specified resource. Sign with no length specified.

Method Details

addMetadata

public static void addMetadata(final HttpURLConnection request, final Map metadata, final OperationContext opContext)

Adds the metadata.

Parameters:

request - The request.
metadata - The metadata.
opContext

addOptionalHeader

public static void addOptionalHeader(final HttpURLConnection request, final String name, final String value)

Adds the optional header.

Parameters:

request - a HttpURLConnection for the operation.
name - the metadata name.
value - the metadata value.

batch

public static HttpURLConnection batch(final URI uri, final RequestOptions options, final OperationContext opContext, final AccessCondition accessCondition)

Parameters:

uri
options
opContext
accessCondition

buildBatchBody

public static static byte [] buildBatchBody(final C client, final BatchOperation batch, final OperationContext opContext)

Parameters:

client
batch
opContext

create

public static HttpURLConnection create(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates the specified resource. Note request is set to setFixedLengthStreamingMode(0); Sign with 0 length.

Parameters:

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 request
opContext - an object used to track the execution of the operation

Returns:

a HttpURLConnection to perform the operation.

Throws:

IOException - if there is an error opening the connection
URISyntaxException - if there is an improperly formated URI
StorageException
IllegalArgumentException

createURLConnection

public static HttpURLConnection createURLConnection(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates the web request.

Parameters:

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 request
opContext - an object used to track the execution of the operation

Returns:

a HttpURLConnection to perform the operation.

Throws:

IOException - if there is an error opening the connection
URISyntaxException - if there is an improperly formated URI
StorageException

delete

public static HttpURLConnection delete(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Deletes the specified resource. Sign with no length specified.

Parameters:

uri - the request Uri.
options
builder - the UriQueryBuilder for the request
opContext - an object used to track the execution of the operation

Returns:

a HttpURLConnection to perform the operation.

Throws:

IOException - if there is an error opening the connection
URISyntaxException - if there is an improperly formated URI
StorageException

getAccountInfo

public static HttpURLConnection getAccountInfo(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Parameters:

uri
options
builder
opContext

getListUriQueryBuilder

public static UriQueryBuilder getListUriQueryBuilder(final ListingContext listingContext)

Gets a UriQueryBuilder for listing.

Parameters:

listingContext - A ListingContext object that specifies parameters for the listing operation, if any. May be null.

Throws:

StorageException - If a storage service error occurred during the operation.

getProperties

public static HttpURLConnection getProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Gets the properties. Sign with no length specified.

Parameters:

uri - The Uri to query.
options
builder - The builder.
opContext - an object used to track the execution of the operation

Returns:

a web request for performing the operation.

Throws:

StorageException
URISyntaxException
IOException

getServiceProperties

public static HttpURLConnection getServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to retrieve the Analytics service properties from the storage service.

Parameters:

uri - The service endpoint.
options
builder - The builder.
opContext - an object used to track the execution of the operation

Returns:

a web request for performing the operation.

Throws:

IOException
URISyntaxException
StorageException

getServiceStats

public static HttpURLConnection getServiceStats(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a web request to get the stats of the service.

Parameters:

uri - The service endpoint.
options
builder - The builder.
opContext - an object used to track the execution of the operation

Returns:

a web request for performing the operation.

Throws:

IOException
URISyntaxException
StorageException

getUserAgent

public static String getUserAgent()

Gets the user agent to send over the wire to identify the client.

Returns:

the user agent to send over the wire to identify the client.

getUserDelegationKey

public static HttpURLConnection getUserDelegationKey(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to request a UserDelegationKey from the service.

Parameters:

uri - The service endpoint.
options - The options for the http request.
builder - The builder.
opContext - An object used to track the execution of the operation.

Returns:

a web request for performing the operation.

Throws:

IOException
URISyntaxException
StorageException

setMetadata

public static HttpURLConnection setMetadata(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Sets the metadata. Sign with 0 length.

Parameters:

uri - The blob Uri.
options
builder - The builder.
opContext - an object used to track the execution of the operation

Returns:

a web request for performing the operation.

Throws:

StorageException
URISyntaxException
IOException

setServiceProperties

public static HttpURLConnection setServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Creates a HttpURLConnection used to set the Analytics service properties on the storage service.

Parameters:

uri - The service endpoint.
options
builder - The builder.
opContext - an object used to track the execution of the operation

Returns:

a web request for performing the operation.

Throws:

IOException
URISyntaxException
StorageException

undelete

public static HttpURLConnection undelete(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext)

Un-deletes the specified resource. Sign with no length specified.

Parameters:

uri - the request Uri.
options
builder - the UriQueryBuilder for the request
opContext - an object used to track the execution of the operation

Returns:

a HttpURLConnection to perform the operation.

Throws:

IOException - if there is an error opening the connection
URISyntaxException - if there is an improperly formated URI
StorageException

Applies to