共用方式為


CloudQueueClient Class

  • java.lang.Object
    • ServiceClient
      • com.microsoft.azure.storage.queue.CloudQueueClient

public class CloudQueueClient extends ServiceClient

Provides a service client for accessing the Microsoft Azure Queue service.

Constructor Summary

Constructor Description
CloudQueueClient(final StorageUri baseUri, final StorageCredentials credentials)

Initializes a new instance of the class using the specified Queue service endpoint and account credentials.

CloudQueueClient(final URI baseUri, final StorageCredentials credentials)

Initializes a new instance of the class using the specified Queue service endpoint and account credentials.

Method Summary

Modifier and Type Method and Description
final ServiceProperties downloadServiceProperties()

Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

final ServiceProperties downloadServiceProperties(QueueRequestOptions options, OperationContext opContext)

Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

QueueRequestOptions getDefaultRequestOptions()

Gets the QueueRequestOptions that is used for requests associated with this

CloudQueue getQueueReference(final String queueName)

Gets a CloudQueue object with the specified name.

ServiceStats getServiceStats()

Queries the service for the ServiceStats.

ServiceStats getServiceStats(QueueRequestOptions options, OperationContext opContext)

Queries the service for the ServiceStats.

boolean isUsePathStyleUris()
Iterable<CloudQueue> listQueues()

Gets an iterable collection of queues for this queue service client.

Iterable<CloudQueue> listQueues(final String prefix)

Returns an iterable collection of queues whose names begin with the specified prefix in this Queue service client.

Iterable<CloudQueue> listQueues(final String prefix, final QueueListingDetails detailsIncluded, QueueRequestOptions options, OperationContext opContext)

Returns an iterable collection of queues whose names begin with the specified prefix for this Queue service client, using the specified details setting, request options, and operation context.

ResultSegment<CloudQueue> listQueuesSegmented()

Gets a result segment of an iterable collection of queues for this Queue service client.

ResultSegment<CloudQueue> listQueuesSegmented(final String prefix)

Gets a result segment of an iterable collection of queues whose names begin with the specified prefix for this Queue service client.

ResultSegment<CloudQueue> listQueuesSegmented(final String prefix, final QueueListingDetails detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, QueueRequestOptions options, OperationContext opContext)

Gets a result segment of an iterable collection of queues whose names begin with the specified prefix for this queue, using the specified listing details options, request options, and operation context.

void setDefaultRequestOptions(QueueRequestOptions defaultRequestOptions)

Sets the QueueRequestOptions that is used for any queue accessed with this object.

void uploadServiceProperties(final ServiceProperties properties)

Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

void uploadServiceProperties(final ServiceProperties properties, QueueRequestOptions options, OperationContext opContext)

Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

Inherited Members

Constructor Details

CloudQueueClient

public CloudQueueClient(final StorageUri baseUri, final StorageCredentials credentials)

Initializes a new instance of the class using the specified Queue service endpoint and account credentials.

Parameters:

baseUri - A StorageUri object that represents the Queue service endpoint used to create the client.
credentials - A StorageCredentials object that represents the account credentials.

CloudQueueClient

public CloudQueueClient(final URI baseUri, final StorageCredentials credentials)

Initializes a new instance of the class using the specified Queue service endpoint and account credentials.

Parameters:

baseUri - A java.net.URI object that represents the Queue service endpoint used to create the client.
credentials - A StorageCredentials object that represents the account credentials.

Method Details

downloadServiceProperties

public final ServiceProperties downloadServiceProperties()

Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

Returns:

the ServiceProperties object representing the current configuration of the service.

Throws:

StorageException - If a storage service error occurred.

downloadServiceProperties

public final ServiceProperties downloadServiceProperties(QueueRequestOptions options, OperationContext opContext)

Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

Parameters:

options - A QueueRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ( CloudQueueClient).
opContext - An 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.

Returns:

the ServiceProperties object representing the current configuration of the service.

Throws:

StorageException - If a storage service error occurred.

getDefaultRequestOptions

public QueueRequestOptions getDefaultRequestOptions()

Gets the QueueRequestOptions that is used for requests associated with this

Returns:

The QueueRequestOptions object containing the values used by this CloudQueueClient

getQueueReference

public CloudQueue getQueueReference(final String queueName)

Gets a CloudQueue object with the specified name.

Parameters:

queueName - The name of the queue, which must adhere to queue naming rules. The queue name should not include any path separator characters (/). Queue names must be lowercase, between 3-63 characters long and must start with a letter or number. Queue names may contain only letters, numbers, and the dash (-) character.

Returns:

A reference to a CloudQueue object.

Throws:

URISyntaxException - If the resource URI constructed based on the queueName is invalid.
StorageException - If a storage service error occurred.

getServiceStats

public ServiceStats getServiceStats()

Queries the service for the ServiceStats.

Returns:

ServiceStats for the given storage service

Throws:

StorageException - If a storage service error occurred.

getServiceStats

public ServiceStats getServiceStats(QueueRequestOptions options, OperationContext opContext)

Queries the service for the ServiceStats.

Parameters:

options - A QueueRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ( CloudQueueClient).
opContext - An 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.

Returns:

ServiceStats for the given storage service

Throws:

StorageException - If a storage service error occurred.

isUsePathStyleUris

protected boolean isUsePathStyleUris()

Returns:

the usePathStyleUris

listQueues

public Iterable listQueues()

Gets an iterable collection of queues for this queue service client.

Returns:

An iterable collection of CloudQueue objects retrieved lazily that represent the queues in this client.

listQueues

public Iterable listQueues(final String prefix)

Returns an iterable collection of queues whose names begin with the specified prefix in this Queue service client.

Parameters:

prefix - A String that represents the queue name prefix.

Returns:

An iterable collection of CloudQueue objects retrieved lazily that represent the queues in this client whose names begin with the specified prefix.

listQueues

public Iterable listQueues(final String prefix, final QueueListingDetails detailsIncluded, QueueRequestOptions options, OperationContext opContext)

Returns an iterable collection of queues whose names begin with the specified prefix for this Queue service client, using the specified details setting, request options, and operation context.

Parameters:

prefix - A String that represents the queue name prefix.
detailsIncluded - A QueueListingDetails value that indicates whether queue metadata will be returned.
options - A QueueRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ( CloudQueue).
opContext - An 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.

Returns:

An iterable collection of CloudQueue objects retrieved lazily that represents the specified queues for this client.

listQueuesSegmented

public ResultSegment listQueuesSegmented()

Gets a result segment of an iterable collection of queues for this Queue service client.

Returns:

A ResultSegment<T> of CloudQueue objects that contains a segment of the iterable collection of CloudQueue objects that represent the requested queues in the storage service.

Throws:

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

listQueuesSegmented

public ResultSegment listQueuesSegmented(final String prefix)

Gets a result segment of an iterable collection of queues whose names begin with the specified prefix for this Queue service client.

Parameters:

prefix

Returns:

A ResultSegment<T> of CloudQueue objects that contains a segment of the iterable collection of CloudQueue objects that represent the requested queues in the storage service.

Throws:

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

listQueuesSegmented

public ResultSegment listQueuesSegmented(final String prefix, final QueueListingDetails detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, QueueRequestOptions options, OperationContext opContext)

Gets a result segment of an iterable collection of queues whose names begin with the specified prefix for this queue, using the specified listing details options, request options, and operation context.

Parameters:

prefix - A String that represents the prefix of the queue name to match.
detailsIncluded - A QueueListingDetails value that indicates whether queue metadata will be returned.
maxResults - The maximum number of results to retrieve. If null or greater than 5000, the server will return up to 5,000 items. Must be at least 1.
continuationToken - A ResultContinuation object that represents a continuation token returned by a previous listing operation.
options - A QueueRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ( CloudQueue).
opContext - An 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.

Returns:

A ResultSegment<T> of CloudQueue objects that contains a segment of the iterable collection of CloudQueue objects that represent the requested queues in the storage service.

Throws:

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

setDefaultRequestOptions

public void setDefaultRequestOptions(QueueRequestOptions defaultRequestOptions)

Sets the QueueRequestOptions that is used for any queue accessed with this object.

Parameters:

defaultRequestOptions - The QueueRequestOptions to use.

uploadServiceProperties

public void uploadServiceProperties(final ServiceProperties properties)

Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

Parameters:

properties - The ServiceProperties to upload.

Throws:

StorageException - If a storage service error occurred.

uploadServiceProperties

public void uploadServiceProperties(final ServiceProperties properties, QueueRequestOptions options, OperationContext opContext)

Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.

Parameters:

properties - The ServiceProperties to upload.
options - A BlobRequestOptions object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ( CloudBlobClient).
opContext - An 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:

StorageException - If a storage service error occurred.

Applies to