com.xerox.amazonws.sdb
Class Domain

java.lang.Object
  extended by com.xerox.amazonws.common.AWSConnection
      extended by com.xerox.amazonws.common.AWSQueryConnection
          extended by com.xerox.amazonws.sdb.Domain

public class Domain
extends AWSQueryConnection

This class provides an interface with the Amazon SDB service. It provides methods for listing and deleting items.

Author:
D. Kavanagh, developer@dotech.com

Nested Class Summary
protected  class Domain.RejectionHandler
           
 
Field Summary
 
Fields inherited from class com.xerox.amazonws.common.AWSConnection
headers
 
Constructor Summary
protected Domain(String domainName, String awsAccessId, String awsSecretKey, boolean isSecure, String server, int port)
           
 
Method Summary
 SDBResult batchPutAttributes(Map<String,List<ItemAttribute>> items)
          Batch inserts multiple items w/ attributes
 void deleteItem(String identifier)
          Deletes an item.
 void deleteItem(String identifier, List<Condition> conditions)
          Deletes an item, with conditions
 Item getItem(String identifier)
          Method for getting an Item object without getting a list of them.
 int getMaxThreads()
          Gets the max number of threads to use for the threaded operations.
 DomainMetadataResult getMetadata()
          Returns information about the domain.
 String getName()
          Gets the name of the domain represented by this object.
 ThreadPoolExecutor getThreadPoolExecutor()
           
protected
<T> T
makeRequestInt(org.apache.http.client.methods.HttpRequestBase method, String action, Map<String,String> params, Class<T> respType)
           
 QueryWithAttributesResult selectItems(String selectExpression, String nextToken)
          This method supports selecting items/attributers based on the select syntax
 QueryWithAttributesResult selectItems(String selectExpression, String nextToken, boolean consistent)
          This method supports selecting items/attributers based on the select syntax
 void setMaxThreads(int threads)
          Sets the max number of threads to use for the threaded operations.
 void setThreadPoolExecutor(ThreadPoolExecutor executor)
           
 
Methods inherited from class com.xerox.amazonws.common.AWSQueryConnection
close, close, getConnectionManagerTimeout, getConnectionTimeout, getHeaders, getHttpClient, getMaxConnections, getMaxRetries, getServerTimeZone, getSoTimeout, getString, httpDate, makeRequest, setConnectionManagerTimeout, setConnectionTimeout, setHttpClient, setMaxConnections, setMaxRetries, setProxyValues, setProxyValues, setProxyValues, setServerTimeZone, setSoTimeout, useSystemProxy
 
Methods inherited from class com.xerox.amazonws.common.AWSConnection
encode, encode, getAlgorithm, getAwsAccessKeyId, getPort, getResourcePrefix, getSecretAccessKey, getServer, getSignatureVersion, getUrl, isSecure, makeURL, setResourcePrefix, setServer, setSignatureVersion, urlencode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Domain

protected Domain(String domainName,
                 String awsAccessId,
                 String awsSecretKey,
                 boolean isSecure,
                 String server,
                 int port)
          throws SDBException
Throws:
SDBException
Method Detail

getName

public String getName()
Gets the name of the domain represented by this object.

Returns:
the name of the domain

getMaxThreads

public int getMaxThreads()
Gets the max number of threads to use for the threaded operations.

Returns:
max number of threads being used

setMaxThreads

public void setMaxThreads(int threads)
Sets the max number of threads to use for the threaded operations.

Parameters:
threads - the new max to set

getItem

public Item getItem(String identifier)
             throws SDBException
Method for getting an Item object without getting a list of them.

Parameters:
identifier - id of the item
Returns:
the object representing the item
Throws:
SDBException - wraps checked exceptions

deleteItem

public void deleteItem(String identifier)
                throws SDBException
Deletes an item.

Parameters:
identifier - the name of the item to be deleted
Throws:
SDBException - wraps checked exceptions

deleteItem

public void deleteItem(String identifier,
                       List<Condition> conditions)
                throws SDBException
Deletes an item, with conditions

Parameters:
identifier - the name of the item to be deleted
Throws:
SDBException - wraps checked exceptions

getMetadata

public DomainMetadataResult getMetadata()
                                 throws SDBException
Returns information about the domain.

Returns:
the object containing metadata about this domain
Throws:
SDBException - wraps checked exceptions

selectItems

public QueryWithAttributesResult selectItems(String selectExpression,
                                             String nextToken)
                                      throws SDBException
This method supports selecting items/attributers based on the select syntax

Parameters:
selectExpression - the select query
nextToken - the next token, for fetching more results from a previous query
Returns:
an object containing query results and stats
Throws:
SDBException - wraps checked exceptions

selectItems

public QueryWithAttributesResult selectItems(String selectExpression,
                                             String nextToken,
                                             boolean consistent)
                                      throws SDBException
This method supports selecting items/attributers based on the select syntax

Parameters:
selectExpression - the select query
nextToken - the next token, for fetching more results from a previous query
consistent - if true, consistency is assured
Returns:
an object containing query results and stats
Throws:
SDBException - wraps checked exceptions

batchPutAttributes

public SDBResult batchPutAttributes(Map<String,List<ItemAttribute>> items)
                             throws SDBException
Batch inserts multiple items w/ attributes

Parameters:
attributes - list of attributes to add
Throws:
SDBException - wraps checked exceptions

getThreadPoolExecutor

public ThreadPoolExecutor getThreadPoolExecutor()

setThreadPoolExecutor

public void setThreadPoolExecutor(ThreadPoolExecutor executor)

makeRequestInt

protected <T> T makeRequestInt(org.apache.http.client.methods.HttpRequestBase method,
                               String action,
                               Map<String,String> params,
                               Class<T> respType)
                    throws SDBException
Throws:
SDBException