org.soyatec.windows.azure.blob
Class BlobStorage

java.lang.Object
  extended by org.soyatec.windows.azure.blob.BlobStorage
Direct Known Subclasses:
BlobStorageRest

public abstract class BlobStorage
extends java.lang.Object

The entry point of the blob storage API


Field Summary
static RetryPolicy DefaultRetryPolicy
          The default retry policy
static TimeSpan DefaultTimeout
          The default timeout
 
Method Summary
static BlobStorage create(StorageAccountInfo accountInfo)
          Factory method for BlobStorage
static BlobStorage create(java.net.URI baseUri, boolean usePathStyleUris, java.lang.String accountName, java.lang.String base64Key)
          Factory method for BlobStorage
 java.lang.String getAccountName()
           
 java.lang.String getBase64Key()
           
 java.net.URI getBaseUri()
           
abstract  BlobContainer getBlobContainer(java.lang.String containerName)
          Get a reference to a newly created BlobContainer object.
 RetryPolicy getRetryPolicy()
           
 TimeSpan getTimeout()
           
 boolean isUsePathStyleUris()
          Indicates whether to use/generate path-style or host-style URIs.
abstract  java.util.List<BlobContainer> listBlobContainers()
          Lists the containers within the account.
 void setBase64Key(java.lang.String base64Key)
           
 void setRetryPolicy(RetryPolicy retryPolicy)
           
 void setTimeout(TimeSpan timeout)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultTimeout

public static final TimeSpan DefaultTimeout
The default timeout


DefaultRetryPolicy

public static final RetryPolicy DefaultRetryPolicy
The default retry policy

Method Detail

create

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

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 BlobStorage instance

create

public static BlobStorage create(StorageAccountInfo accountInfo)
Factory method for BlobStorage

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

getBlobContainer

public abstract BlobContainer getBlobContainer(java.lang.String containerName)
Get a reference to a newly created BlobContainer object. This method does not make any calls to the storage service.

Parameters:
containerName - The name of the container
Returns:
A reference to a newly created BlobContainer object

listBlobContainers

public abstract java.util.List<BlobContainer> listBlobContainers()
                                                          throws StorageServerException
Lists the containers within the account.

Returns:
A list of containers
Throws:
java.lang.Exception
StorageServerException

isUsePathStyleUris

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

Returns:
true/false

getBaseUri

public java.net.URI getBaseUri()
Returns:
The base URI of the blob storate service.

getAccountName

public java.lang.String getAccountName()
Returns:
The name of the storage account.

getBase64Key

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

getTimeout

public TimeSpan getTimeout()
Returns:
The time out for each request to the storage service.

getRetryPolicy

public RetryPolicy getRetryPolicy()
Returns:
The retry policy used for retrying requests.

setBase64Key

public void setBase64Key(java.lang.String base64Key)
Parameters:
base64Key - Authentication key used for signing requests

setTimeout

public void setTimeout(TimeSpan timeout)
Parameters:
timeout - The time out for each request to the storage service.

setRetryPolicy

public void setRetryPolicy(RetryPolicy retryPolicy)
Parameters:
retryPolicy - The retry policy used for retrying requests.