org.soyatec.windowsazure.queue
Class QueueStorageClient

java.lang.Object
  extended by org.soyatec.windowsazure.proxy.AbstractProxyDelegate
      extended by org.soyatec.windowsazure.queue.QueueStorageClient

public abstract class QueueStorageClient
extends AbstractProxyDelegate

The entry point of the queue storage API


Field Summary
static IRetryPolicy DefaultRetryPolicy
          The default retry policy
static org.soyatec.windowsazure.internal.util.TimeSpan DefaultTimeout
          The default timeout
 
Method Summary
static QueueStorageClient create(boolean usePathStyleUris, java.lang.String accountName, java.lang.String base64Key)
          Factory method for QueueStorage
static QueueStorageClient create(StorageAccountInfo accountInfo)
          Factory method for QueueStorage
static QueueStorageClient create(java.net.URI baseUri, boolean usePathStyleUris, java.lang.String accountName, java.lang.String base64Key)
          Factory method for QueueStorage
static IMessage createMessage()
          Create a default message
static IMessage createMessage(byte[] content)
          Create a default message with content
static IMessage createMessage(java.lang.String content)
          Create a default message with content
 StorageAccountInfo getAccountInfo()
          Returns the user account this queue lives in.
 java.lang.String getAccountName()
          Return the name of the storage account.
 java.lang.String getBase64Key()
          Returns authentication key used for signing requests.
 java.net.URI getBaseUri()
          Returns the base URI of the blob storage service.
 SharedKeyCredentials getCredentials()
          Returns credentials (name and key) of a storage account.
abstract  IQueue getQueue(java.lang.String queueName)
          Get a reference to a Queue object with a specified name.
 IRetryPolicy getRetryPolicy()
          Returns the retry policy used for retrying requests.
 org.soyatec.windowsazure.internal.util.TimeSpan getTimeout()
          Returns the time out for each request to the storage service.
abstract  boolean isQueueExist(java.lang.String queueName)
          Check if the Queue exists.
 boolean isUsePathStyleUris()
          Returns whether to use/generate path-style or host-style URIs.
 java.util.List<java.lang.String> listQueues()
          Lists the queues within the account.
abstract  java.util.List<java.lang.String> listQueues(java.lang.String prefix)
          Lists the queues within the account that start with the given prefix.
 void setAccountInfo(StorageAccountInfo accountInfo)
          Specify the user account this queue lives in.
 void setCredentials(SharedKeyCredentials credentials)
          Specify the credentials (name and key) of a storage account.
 void setRetryPolicy(IRetryPolicy retryPolicy)
          Specify the retry policy used for retrying requests.
 void setTimeout(org.soyatec.windowsazure.internal.util.TimeSpan timeout)
          Specify the time out for each request to the storage service.
 void setUsePathStyleUris(boolean usePathStyleUris)
          Specify whether to use/generate path-style or host-style URIs.
 
Methods inherited from class org.soyatec.windowsazure.proxy.AbstractProxyDelegate
disableProxy, isProxyEnabled, setProxyConfiguration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultTimeout

public static final org.soyatec.windowsazure.internal.util.TimeSpan DefaultTimeout
The default timeout


DefaultRetryPolicy

public static final IRetryPolicy DefaultRetryPolicy
The default retry policy

Method Detail

create

public static QueueStorageClient create(java.net.URI baseUri,
                                        boolean usePathStyleUris,
                                        java.lang.String accountName,
                                        java.lang.String base64Key)
Factory method for QueueStorage

Parameters:
baseUri - The base URI of the blob storage service
usePathStyleUris - If true, path-style URIs (http://baseuri/accountname/containername/objectname) are used. If false host-style URIs (http://accountname.baseuri/containername/objectname) are used, where baseuri is the URI of the service. If null, the choice is made automatically: path-style URIs if host name part of base URI is an IP addres, host-style otherwise.
accountName - The name of the storage account
base64Key - Authentication key used for signing requests
Returns:
A newly created QueueStorage instance

isQueueExist

public abstract boolean isQueueExist(java.lang.String queueName)
                              throws StorageException
Check if the Queue exists.

Parameters:
queueName - of the Table.
Returns:
true if the Queue exists, false otherwise.
Throws:
StorageException

create

public static QueueStorageClient create(boolean usePathStyleUris,
                                        java.lang.String accountName,
                                        java.lang.String base64Key)
Factory method for QueueStorage

Parameters:
usePathStyleUris - If true, path-style URIs (http://baseuri/accountname/containername/objectname) are used. If false host-style URIs (http://accountname.baseuri/containername/objectname) are used, where baseuri is the URI of the service. If null, the choice is made automatically: path-style URIs if host name part of base URI is an IP addres, host-style otherwise.
accountName - The name of the storage account
base64Key - Authentication key used for signing requests
Returns:
A newly created QueueStorage instance

create

public static QueueStorageClient create(StorageAccountInfo accountInfo)
Factory method for QueueStorage

Parameters:
accountInfo - Account information
Returns:
A newly created QueueStorage instance

createMessage

public static IMessage createMessage()
Create a default message

Returns:

createMessage

public static IMessage createMessage(java.lang.String content)
Create a default message with content

Parameters:
content -
Returns:

createMessage

public static IMessage createMessage(byte[] content)
Create a default message with content

Parameters:
content -
Returns:

getQueue

public abstract IQueue getQueue(java.lang.String queueName)
                         throws StorageException
Get a reference to a Queue object with a specified name. This method does not make a call to the queue service.

Parameters:
queueName - The name of the queue
Returns:
A newly created queue object
Throws:
StorageException

listQueues

public java.util.List<java.lang.String> listQueues()
                                            throws StorageException
Lists the queues within the account.

Returns:
A list of queues
Throws:
StorageException

listQueues

public abstract java.util.List<java.lang.String> listQueues(java.lang.String prefix)
                                                     throws StorageException
Lists the queues within the account that start with the given prefix.

Parameters:
prefix - If prefix is null returns all queues.
Returns:
A list of queues.
Throws:
StorageException

getTimeout

public org.soyatec.windowsazure.internal.util.TimeSpan getTimeout()
Returns the time out for each request to the storage service.

Returns:
The time out for each request to the storage service.

isUsePathStyleUris

public boolean isUsePathStyleUris()
Returns whether to use/generate path-style or host-style URIs.

Returns:
whether to use/generate path-style or host-style URIs.

setUsePathStyleUris

public void setUsePathStyleUris(boolean usePathStyleUris)
Specify whether to use/generate path-style or host-style URIs.

Parameters:
usePathStyleUris - whether to use/generate path-style or host-style URIs

getBaseUri

public java.net.URI getBaseUri()
Returns the base URI of the blob storage service.

Returns:
The base URI of the blob storage service.

getAccountName

public java.lang.String getAccountName()
Return the name of the storage account.

Returns:
The name of the storage account.

getBase64Key

public java.lang.String getBase64Key()
Returns authentication key used for signing requests.

Returns:
Authentication key used for signing requests.

getRetryPolicy

public IRetryPolicy getRetryPolicy()
Returns the retry policy used for retrying requests.

Returns:
The retry policy used for retrying requests.

setRetryPolicy

public void setRetryPolicy(IRetryPolicy retryPolicy)
Specify the retry policy used for retrying requests.

Parameters:
retryPolicy - The retry policy used for retrying requests

getAccountInfo

public StorageAccountInfo getAccountInfo()
Returns the user account this queue lives in.

Returns:
The user account this queue lives in.

setAccountInfo

public void setAccountInfo(StorageAccountInfo accountInfo)
Specify the user account this queue lives in.

Parameters:
accountInfo - The user account this queue lives in.

getCredentials

public SharedKeyCredentials getCredentials()
Returns credentials (name and key) of a storage account.

Returns:
credentials (name and key) of a storage account.

setCredentials

public void setCredentials(SharedKeyCredentials credentials)
Specify the credentials (name and key) of a storage account.

Parameters:
credentials - The credentials (name and key) of a storage account

setTimeout

public void setTimeout(org.soyatec.windowsazure.internal.util.TimeSpan timeout)
Specify the time out for each request to the storage service.

Parameters:
timeout - The time out for each request to the storage service.