org.soyatec.windowsazure.table
Class TableStorageClient

java.lang.Object
  extended by org.soyatec.windowsazure.proxy.AbstractProxyDelegate
      extended by org.soyatec.windowsazure.table.TableStorageClient

public abstract class TableStorageClient
extends AbstractProxyDelegate

API entry point for using structured storage. The underlying usage pattern is designed to be similar to the one used in blob and queue services in this library. Users create a TableStorage object by calling the static Create() method passing account credential information to this method.


Field Summary
static IRetryPolicy DefaultRetryPolicy
          The default retry policy
static org.soyatec.windowsazure.internal.util.TimeSpan DefaultTimeout
          The default timeout
 
Method Summary
static TableStorageClient create(boolean usePathStyleUris, java.lang.String accountName, java.lang.String base64Key)
          Creates a TableStorage service object.
static TableStorageClient create(StorageAccountInfo info)
          Creates a TableStorage service object.
static TableStorageClient create(java.net.URI baseUri, boolean usePathStyleUris, java.lang.String accountName, java.lang.String base64Key)
          Creates a TableStorage service object.
abstract  void createTable(java.lang.String tableName)
          Creates a Table object.
abstract  boolean createTableIfNotExist(java.lang.String tableName)
          Creates a Table object.
abstract  void deleteTable(java.lang.String tableName)
          Delete a table.
abstract  boolean deleteTableIfExist(java.lang.String tableName)
          Delete a table if exist.
 java.lang.String getAccountName()
          Get the name of storage account
 java.lang.String getBase64Key()
          Get the authenticate key for of storage account
 java.net.URI getBaseUri()
          Get The base URI of the table storage service
 SharedKeyCredentials getCredentials()
          Set the credential
 IRetryPolicy getRetryPolicy()
          Get the IRetryPolicy
abstract  ITable getTableReference(java.lang.String tableName)
          Get a reference to a Table object with a specified name.
 org.soyatec.windowsazure.internal.util.TimeSpan getTimeout()
          Get time out per request
abstract  boolean isTableExist(java.lang.String tableName)
          Check if the table exists.
 boolean isUsePathStyleUris()
          Indicates whether to use/generate path-style or host-style URIs
abstract  java.util.List<java.lang.String> listTables()
          Lists all the tables under this service's URL
abstract  java.util.List<java.lang.String> listTables(java.lang.String prefix)
          Lists all the tables with the prefix under this service's URL
 void setBase64Key(java.lang.String base64Key)
          Set the authenticate key for of storage account
 void setCredentials(SharedKeyCredentials credentials)
          Get credential
 void setRetryPolicy(IRetryPolicy retryPolicy)
          Set the IRetryPolicy
 void setTimeout(org.soyatec.windowsazure.internal.util.TimeSpan timeout)
          Set timeout per request
 
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

DefaultRetryPolicy

public static final IRetryPolicy DefaultRetryPolicy
The default retry policy


DefaultTimeout

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

Method Detail

isTableExist

public abstract boolean isTableExist(java.lang.String tableName)
                              throws StorageException
Check if the table exists.

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

create

public static TableStorageClient create(java.net.URI baseUri,
                                        boolean usePathStyleUris,
                                        java.lang.String accountName,
                                        java.lang.String base64Key)
Creates a TableStorage service object. This object is the entry point into the table storage API.

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

createTable

public abstract void createTable(java.lang.String tableName)
Creates a Table object.

Parameters:
tableName - The name of the table.

createTableIfNotExist

public abstract boolean createTableIfNotExist(java.lang.String tableName)
Creates a Table object.

Parameters:
tableName - The name of the table.
Returns:
true: if table was created / false: otherwise

deleteTableIfExist

public abstract boolean deleteTableIfExist(java.lang.String tableName)
Delete a table if exist.

Parameters:
tableName - The name of the table.
Returns:
true: delete success / false: otherwise

deleteTable

public abstract void deleteTable(java.lang.String tableName)
Delete a table.

Parameters:
tableName - The name of the table.

create

public static TableStorageClient create(boolean usePathStyleUris,
                                        java.lang.String accountName,
                                        java.lang.String base64Key)
Creates a TableStorage service object. This object is the entry point into the table storage API.

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

create

public static TableStorageClient create(StorageAccountInfo info)
Creates a TableStorage service object. This object is the entry point into the table storage API.

Parameters:
info - StorageAccountInfo
Returns:
A newly created TableStorage instance

listTables

public abstract java.util.List<java.lang.String> listTables()
                                                     throws StorageException
Lists all the tables under this service's URL

Throws:
StorageException

listTables

public abstract java.util.List<java.lang.String> listTables(java.lang.String prefix)
                                                     throws StorageException
Lists all the tables with the prefix under this service's URL

Parameters:
prefix -
Throws:
StorageException

getTableReference

public abstract ITable getTableReference(java.lang.String tableName)
Get a reference to a Table object with a specified name. The method does not make call to a table service.

Parameters:
tableName - The name of the table
Returns:
A newly created table object

isUsePathStyleUris

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

Returns:

getBaseUri

public java.net.URI getBaseUri()
Get The base URI of the table storage service

Returns:

getAccountName

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

Returns:

getBase64Key

public java.lang.String getBase64Key()
Get the authenticate key for of storage account

Returns:

setBase64Key

public void setBase64Key(java.lang.String base64Key)
Set the authenticate key for of storage account

Parameters:
base64Key -

getRetryPolicy

public IRetryPolicy getRetryPolicy()
Get the IRetryPolicy

Returns:

setRetryPolicy

public void setRetryPolicy(IRetryPolicy retryPolicy)
Set the IRetryPolicy

Parameters:
retryPolicy -

getTimeout

public org.soyatec.windowsazure.internal.util.TimeSpan getTimeout()
Get time out per request

Returns:

setTimeout

public void setTimeout(org.soyatec.windowsazure.internal.util.TimeSpan timeout)
Set timeout per request

Parameters:
timeout -

getCredentials

public SharedKeyCredentials getCredentials()
Set the credential

Returns:

setCredentials

public void setCredentials(SharedKeyCredentials credentials)
Get credential

Parameters:
credentials -