org.exoplatform.services.jcr.aws.storage.sdb
Class SDBWorkspaceStorageConnection

java.lang.Object
  extended by org.exoplatform.services.jcr.aws.storage.sdb.SDBWorkspaceStorageConnection
All Implemented Interfaces:
SDBConstants, WorkspaceStorageConnection

public class SDBWorkspaceStorageConnection
extends java.lang.Object
implements WorkspaceStorageConnection, SDBConstants

Created by The eXo Platform SAS.
Date: 30.09.2008

Version:
$Id: SDBWorkspaceStorageConnection.java 42817 2010-01-22 08:01:06Z tolusha $
Author:
Peter Nedonosko

Nested Class Summary
 class SDBWorkspaceStorageConnection.NodeIData
          Node IData descriptor.
 class SDBWorkspaceStorageConnection.PropertyIData
          Property IData descriptor.
 
Field Summary
protected  java.util.Set<java.lang.String> changedItems
          Changed Items Identifiers.
protected  java.util.List<org.exoplatform.services.jcr.aws.storage.sdb.SDBWorkspaceStorageConnection.WriteOperation> changes
          Changes applied before the last commit (to be used for rollback on fail).
protected  java.lang.String domainName
          SimpleDB domain name.
protected static java.lang.String ITEM_DELETE
          Item Delete operation constant.
protected static java.lang.String ITEM_UPDATE
          Item Update operation constant.
protected static org.apache.commons.logging.Log LOG
          Connection logger.
protected  int maxBufferSize
          Maximim buffer size (see configuration).
protected static java.lang.String QUERY_GET_CHILDNODES
          Get Node child Nodes by parent ID query.
protected static java.lang.String QUERY_GET_CHILDPROPERTIES
          Get Node Properties by parent ID query.
protected static java.lang.String QUERY_GET_ITEM_BY_ID
          Get Item by ID query.
protected static java.lang.String QUERY_GET_ITEM_BY_NAME
          Get Item by parent ID and name query.
protected static java.lang.String QUERY_GET_ITEM_BY_NAME_OR_ID
          Get Item by parent ID and name or by ID query (used for ADD validation).
protected static java.lang.String QUERY_GET_REFERENCES
          Get REFERENCE Properties by Node ID query.
protected static int SDB_OPERATION_COUNT
          SimpleDB non-result operations count for retry(3 times).
protected static int SDB_OPERATION_TIMEOUT
          SimpleDB Operation timeout (5sec).
protected  com.amazonaws.sdb.AmazonSimpleDB sdbService
          SimpleDB service.
protected  ValueStoragePluginProvider valueStorageProvider
          External Value Storages provider.
 
Fields inherited from interface org.exoplatform.services.jcr.aws.storage.sdb.SDBConstants
DATA, ICLASS, ID, IDATA, IDATA_ACL_OWNER, IDATA_ACL_PERMISSION, IDATA_DELIMITER, IDATA_DELIMITER_REGEXP, IDATA_MIXINTYPE, ITEM_DELETED_ID, NAME, NODE_ICLASS, PID, PROPERTY_ICLASS, REFERENCE, SDB_ATTRIBUTE_PER_PUT, SDB_ATTRIBUTE_VALUE_MAXLENGTH, SDB_ITEMNAME_MAXLENGTH, STORAGE_CONTAINER_NAME, STORAGE_VERSION, STORAGE_VERSION_ID, VALUEPREFIX_DATA, VALUEPREFIX_MULTIVALUED_LENGTH, VALUEPREFIX_SINGLEVALUED_LENGTH, VALUEPREFIX_STORAGEID
 
Constructor Summary
SDBWorkspaceStorageConnection(java.lang.String accessKey, java.lang.String secretKey, java.lang.String domainName, int maxBufferSize, ValueStoragePluginProvider valueStorageProvider)
          SDBWorkspaceStorageConnection constructor.
 
Method Summary
 void add(NodeData data)
          
 void add(PropertyData data)
          
protected  java.lang.String[] addValues(PropertyData data)
          Property Values processing.
 void close()
          Same as roolback() method.
 void commit()
          
protected  com.amazonaws.sdb.model.CreateDomainResponse createDomain(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName)
          Execute create domain request.
protected  com.amazonaws.sdb.model.PutAttributesResponse createReplaceItem(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemName, java.util.List<com.amazonaws.sdb.model.ReplaceableAttribute> list)
          Execute create item request.
 void delete(NodeData data)
          
 void delete(PropertyData data)
          
protected  com.amazonaws.sdb.model.DeleteDomainResponse deleteDomain(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName)
          Execute delete domain request.
protected  com.amazonaws.sdb.model.DeleteAttributesResponse deleteItem(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemName)
          Execute delete item request.
protected  java.lang.String formatIData(NodeData node)
          Format Node IData.
protected  java.lang.String formatIData(PropertyData property)
          Format Property IData.
protected  java.lang.String getAttribute(java.util.List<com.amazonaws.sdb.model.Attribute> atts, java.lang.String attrName)
          Get named attribute from the list.
protected  java.lang.String[] getAttributes(java.util.List<com.amazonaws.sdb.model.Attribute> atts, java.lang.String attrName)
          Get named attributes from the list.
 int getChildNodesCount(NodeData parent)
           
 java.util.List<NodeData> getChildNodesData(NodeData parent)
          
 java.util.List<PropertyData> getChildPropertiesData(NodeData parent)
          
protected  com.amazonaws.sdb.model.ListDomainsResult getDomains(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String nextToken, int maxDomains)
          Return domain list request.
protected  java.util.Set<java.lang.String> getDomainsList()
          Return collection of domain names.
 ItemData getItemData(NodeData parent, QPathEntry qname)
          
 ItemData getItemData(java.lang.String identifier)
          
 java.util.List<PropertyData> getReferencesData(java.lang.String nodeIdentifier)
          
 boolean isOpened()
          
 java.util.List<PropertyData> listChildPropertiesData(NodeData parent)
          
protected  NodeData loadNodeData(QPath parentPath, AccessControlList parentACL, java.util.List<com.amazonaws.sdb.model.Attribute> atts)
          Load NodeData from SimpleDB Item.
protected  PropertyData loadPropertyData(QPath parentPath, java.util.List<com.amazonaws.sdb.model.Attribute> atts, boolean withValues)
          Load PropertyData from SimpleDb Item.
protected  SDBWorkspaceStorageConnection.NodeIData parseNodeIData(java.lang.String field, AccessControlList parentACL)
          Parse Node IData.
protected  SDBWorkspaceStorageConnection.PropertyIData parsePropertyIData(java.lang.String field)
          Parse Property IData.
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryChildNodesAttr(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemId, java.lang.String... attributes)
          Query Node child Nodes by ID (QueryWithAttributes).
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryChildPropertiesAttr(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemId, java.lang.String... attributes)
          Query Node properties by ID (QueryWithAttributes).
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByID(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemId, java.lang.String... attributes)
          Query item attributes by ID (QueryWithAttributes).
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByName(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String parentId, java.lang.String name, java.lang.String... attributes)
          Query item attributes by parent ID and name (QueryWithAttributes).
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByNameOrID(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String parentId, java.lang.String name, java.lang.String itemId, java.lang.String... attributes)
          Query item(s) attributes by parent ID and name or by ID (QueryWithAttributes).
protected  com.amazonaws.sdb.model.QueryWithAttributesResponse queryReferencesAttr(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String nodeId, java.lang.String... attributes)
          Query Node references properties by node ID (QueryWithAttributes).
protected  com.amazonaws.sdb.model.GetAttributesResponse readItem(com.amazonaws.sdb.AmazonSimpleDB service, java.lang.String domainName, java.lang.String itemName)
          Execute read item request.
 void rename(NodeData data)
          
 void rollback()
          
 void update(NodeData data)
          
 void update(PropertyData data)
          
protected  void validateItemAdd(ItemData data)
          Validate Add operation for JCR Item.
protected  void validateItemChange(ItemData data, java.lang.String modification)
          Validate Item modification (delete or update).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Connection logger.


SDB_OPERATION_TIMEOUT

protected static final int SDB_OPERATION_TIMEOUT
SimpleDB Operation timeout (5sec).

See Also:
Constant Field Values

SDB_OPERATION_COUNT

protected static final int SDB_OPERATION_COUNT
SimpleDB non-result operations count for retry(3 times).

See Also:
Constant Field Values

ITEM_DELETE

protected static final java.lang.String ITEM_DELETE
Item Delete operation constant. Should be INTERNED.


ITEM_UPDATE

protected static final java.lang.String ITEM_UPDATE
Item Update operation constant. Should be INTERNED.


QUERY_GET_ITEM_BY_ID

protected static final java.lang.String QUERY_GET_ITEM_BY_ID
Get Item by ID query.

See Also:
Constant Field Values

QUERY_GET_ITEM_BY_NAME

protected static final java.lang.String QUERY_GET_ITEM_BY_NAME
Get Item by parent ID and name query.

See Also:
Constant Field Values

QUERY_GET_ITEM_BY_NAME_OR_ID

protected static final java.lang.String QUERY_GET_ITEM_BY_NAME_OR_ID
Get Item by parent ID and name or by ID query (used for ADD validation).

See Also:
Constant Field Values

QUERY_GET_CHILDNODES

protected static final java.lang.String QUERY_GET_CHILDNODES
Get Node child Nodes by parent ID query.

See Also:
Constant Field Values

QUERY_GET_CHILDPROPERTIES

protected static final java.lang.String QUERY_GET_CHILDPROPERTIES
Get Node Properties by parent ID query.

See Also:
Constant Field Values

QUERY_GET_REFERENCES

protected static final java.lang.String QUERY_GET_REFERENCES
Get REFERENCE Properties by Node ID query.

See Also:
Constant Field Values

sdbService

protected final com.amazonaws.sdb.AmazonSimpleDB sdbService
SimpleDB service.


domainName

protected final java.lang.String domainName
SimpleDB domain name.


changes

protected final java.util.List<org.exoplatform.services.jcr.aws.storage.sdb.SDBWorkspaceStorageConnection.WriteOperation> changes
Changes applied before the last commit (to be used for rollback on fail).


changedItems

protected final java.util.Set<java.lang.String> changedItems
Changed Items Identifiers. Uses for 'parent not found' validation.


maxBufferSize

protected final int maxBufferSize
Maximim buffer size (see configuration).


valueStorageProvider

protected final ValueStoragePluginProvider valueStorageProvider
External Value Storages provider.

Constructor Detail

SDBWorkspaceStorageConnection

public SDBWorkspaceStorageConnection(java.lang.String accessKey,
                                     java.lang.String secretKey,
                                     java.lang.String domainName,
                                     int maxBufferSize,
                                     ValueStoragePluginProvider valueStorageProvider)
                              throws javax.jcr.RepositoryException
SDBWorkspaceStorageConnection constructor.

Parameters:
accessKey - - Amazon access key
secretKey - - Amazon secret key
domainName - - SimpleDb domain name
maxBufferSize - - maximum size of Value stored in
valueStorageProvider - - External Value Storages provider
Throws:
javax.jcr.RepositoryException - - if storage error occurs
Method Detail

getDomainsList

protected java.util.Set<java.lang.String> getDomainsList()
                                                  throws com.amazonaws.sdb.AmazonSimpleDBException
Return collection of domain names. If no one domains found then an empty set will be returned.

Returns:
set of names
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

getDomains

protected com.amazonaws.sdb.model.ListDomainsResult getDomains(com.amazonaws.sdb.AmazonSimpleDB service,
                                                               java.lang.String nextToken,
                                                               int maxDomains)
                                                        throws com.amazonaws.sdb.AmazonSimpleDBException
Return domain list request.

Parameters:
service - SimpleDB service instance
nextToken - SimpleDB token
maxDomains - max domains
Returns:
ListDomainsResult
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

createDomain

protected com.amazonaws.sdb.model.CreateDomainResponse createDomain(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                    java.lang.String domainName)
                                                             throws com.amazonaws.sdb.AmazonSimpleDBException
Execute create domain request.

Parameters:
service - SimpleDB service
domainName - targeted domain name
Returns:
CreateDomainResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

deleteDomain

protected com.amazonaws.sdb.model.DeleteDomainResponse deleteDomain(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                    java.lang.String domainName)
                                                             throws com.amazonaws.sdb.AmazonSimpleDBException
Execute delete domain request.

Parameters:
service - SimpleDB service
domainName - targeted domain name
Returns:
DeleteDomainResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

createReplaceItem

protected com.amazonaws.sdb.model.PutAttributesResponse createReplaceItem(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                          java.lang.String domainName,
                                                                          java.lang.String itemName,
                                                                          java.util.List<com.amazonaws.sdb.model.ReplaceableAttribute> list)
                                                                   throws com.amazonaws.sdb.AmazonSimpleDBException
Execute create item request. If item already exists it will be replaced.

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemName - SimpleDB item name
list - ReplaceableAttribute list
Returns:
PutAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

readItem

protected com.amazonaws.sdb.model.GetAttributesResponse readItem(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                 java.lang.String domainName,
                                                                 java.lang.String itemName)
                                                          throws com.amazonaws.sdb.AmazonSimpleDBException
Execute read item request.

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemName - SimpleDB item name
Returns:
GetAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

deleteItem

protected com.amazonaws.sdb.model.DeleteAttributesResponse deleteItem(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                      java.lang.String domainName,
                                                                      java.lang.String itemName)
                                                               throws com.amazonaws.sdb.AmazonSimpleDBException
Execute delete item request.

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemName - SimpleDB item name
Returns:
GetAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryItemAttrByID

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByID(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                java.lang.String domainName,
                                                                                java.lang.String itemId,
                                                                                java.lang.String... attributes)
                                                                         throws com.amazonaws.sdb.AmazonSimpleDBException
Query item attributes by ID (QueryWithAttributes).

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemId - JCR Item Id
attributes - SimpleDB item attributes for responce. If null all attributes will be returned
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryItemAttrByName

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByName(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                  java.lang.String domainName,
                                                                                  java.lang.String parentId,
                                                                                  java.lang.String name,
                                                                                  java.lang.String... attributes)
                                                                           throws com.amazonaws.sdb.AmazonSimpleDBException
Query item attributes by parent ID and name (QueryWithAttributes).

Parameters:
service - SimpleDB service
domainName - targeted domain name
parentId - JCR Item parent Id
name - JCR Item name
attributes - SimpleDB item attributes for responce. If null all attributes will be returned
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryItemAttrByNameOrID

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryItemAttrByNameOrID(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                      java.lang.String domainName,
                                                                                      java.lang.String parentId,
                                                                                      java.lang.String name,
                                                                                      java.lang.String itemId,
                                                                                      java.lang.String... attributes)
                                                                               throws com.amazonaws.sdb.AmazonSimpleDBException
Query item(s) attributes by parent ID and name or by ID (QueryWithAttributes).

Parameters:
service - SimpleDB service
domainName - targeted domain name
parentId - JCR Item parent Id
name - JCR Item name
itemId - JCR Item id
attributes - SimpleDB item attributes for responce. If null all attributes will be returned
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryChildNodesAttr

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryChildNodesAttr(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                  java.lang.String domainName,
                                                                                  java.lang.String itemId,
                                                                                  java.lang.String... attributes)
                                                                           throws com.amazonaws.sdb.AmazonSimpleDBException
Query Node child Nodes by ID (QueryWithAttributes).

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemId - JCR Item Id (parent of child Nodes)
attributes - SimpleDB item attributes for responce
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryChildPropertiesAttr

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryChildPropertiesAttr(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                       java.lang.String domainName,
                                                                                       java.lang.String itemId,
                                                                                       java.lang.String... attributes)
                                                                                throws com.amazonaws.sdb.AmazonSimpleDBException
Query Node properties by ID (QueryWithAttributes).

Parameters:
service - SimpleDB service
domainName - targeted domain name
itemId - JCR Item Id (parent of Properties)
attributes - SimpleDB item attributes for responce
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

queryReferencesAttr

protected com.amazonaws.sdb.model.QueryWithAttributesResponse queryReferencesAttr(com.amazonaws.sdb.AmazonSimpleDB service,
                                                                                  java.lang.String domainName,
                                                                                  java.lang.String nodeId,
                                                                                  java.lang.String... attributes)
                                                                           throws com.amazonaws.sdb.AmazonSimpleDBException
Query Node references properties by node ID (QueryWithAttributes).
NOTE: REFERENCE Properties SHOULD be stored in SimpleDB storage (not in External Values Storage).

Parameters:
service - SimpleDB service
domainName - targeted domain name
nodeId - JCR Node Id (target of REFERENCE Properties)
attributes - SimpleDB item attributes for responce
Returns:
QueryWithAttributesResponse
Throws:
com.amazonaws.sdb.AmazonSimpleDBException - in case of SDB error

formatIData

protected java.lang.String formatIData(NodeData node)
Format Node IData.

Parameters:
node - - NodeData
Returns:
String with IData

formatIData

protected java.lang.String formatIData(PropertyData property)
Format Property IData.

Parameters:
property - - PropertyData
Returns:
String with IData

parseNodeIData

protected SDBWorkspaceStorageConnection.NodeIData parseNodeIData(java.lang.String field,
                                                                 AccessControlList parentACL)
                                                          throws IllegalNameException,
                                                                 IllegalACLException,
                                                                 SDBValueNumberFormatException
Parse Node IData.

Parameters:
field - IData content
parentACL - - parent ACL
Returns:
NodeIData
Throws:
IllegalNameException - if QName stored in SimpleDB is wrong
IllegalACLException - - if ACL stored in SimpleDB is wrong
SDBValueNumberFormatException - - if numeric values stored in SimpleDB is wrong

parsePropertyIData

protected SDBWorkspaceStorageConnection.PropertyIData parsePropertyIData(java.lang.String field)
Parse Property IData.

Parameters:
field - - IData content
Returns:
PropertyIData instance

addValues

protected java.lang.String[] addValues(PropertyData data)
                                throws java.io.IOException,
                                       SDBRepositoryException
Property Values processing. Extract Value data into String representation. If Value is multivalued return sequence of Strings.
Each Value will be stored as a String with fixed prefix of 4 chars XNNN. Where X - 'D' for data or 'S' for external storage link; NNN - Value order number.

Parameters:
data - - Value data
Returns:
sequence of Strings
Throws:
java.io.IOException - - if I/O error occurs
SDBRepositoryException - if Property has move of 100 Values

getAttribute

protected java.lang.String getAttribute(java.util.List<com.amazonaws.sdb.model.Attribute> atts,
                                        java.lang.String attrName)
Get named attribute from the list.

Parameters:
atts - - List of attributes
attrName - - attribute name
Returns:
String with attribute value

getAttributes

protected java.lang.String[] getAttributes(java.util.List<com.amazonaws.sdb.model.Attribute> atts,
                                           java.lang.String attrName)
Get named attributes from the list.

Parameters:
atts - - List of attributes
attrName - - attribute name
Returns:
Strings array with attribute values

validateItemAdd

protected void validateItemAdd(ItemData data)
                        throws javax.jcr.ItemExistsException,
                               SDBRepositoryException,
                               JCRInvalidItemStateException
Validate Add operation for JCR Item. Fails on following conditions:

Parameters:
data - - ItemData
Throws:
javax.jcr.ItemExistsException - - if Item already exists
SDBRepositoryException - - if other storage error occurs
JCRInvalidItemStateException - - if parent not found

validateItemChange

protected void validateItemChange(ItemData data,
                                  java.lang.String modification)
                           throws SDBRepositoryException,
                                  javax.jcr.InvalidItemStateException
Validate Item modification (delete or update). Fails on following conditions:

Parameters:
data - - ItemData
modification - - String, Item modification name (delete or update)
Throws:
SDBRepositoryException - - if storage error occurs
javax.jcr.InvalidItemStateException - - if Item in invalid state
See Also:
ITEM_DELETE, ITEM_UPDATE

loadNodeData

protected NodeData loadNodeData(QPath parentPath,
                                AccessControlList parentACL,
                                java.util.List<com.amazonaws.sdb.model.Attribute> atts)
                         throws java.lang.NumberFormatException,
                                IllegalNameException,
                                IllegalACLException,
                                javax.jcr.InvalidItemStateException,
                                SDBRepositoryException,
                                com.amazonaws.sdb.AmazonSimpleDBException
Load NodeData from SimpleDB Item.

Parameters:
parentPath - - parent path, can be null (getItemData by Id)
parentACL - - parent ACL, can be null (getItemData by Id)
atts - - SimpleDB Item attributes
Returns:
NodeData
Throws:
IllegalNameException - if QName stored in SimpleDB is wrong
IllegalACLException - - if ACL stored in SimpleDB is wrong
java.lang.NumberFormatException - - if numeric values stored in SimpleDB is wrong
com.amazonaws.sdb.AmazonSimpleDBException - - if SimpleDB storage error occurs
javax.jcr.InvalidItemStateException
SDBRepositoryException

loadPropertyData

protected PropertyData loadPropertyData(QPath parentPath,
                                        java.util.List<com.amazonaws.sdb.model.Attribute> atts,
                                        boolean withValues)
                                 throws java.lang.NumberFormatException,
                                        IllegalNameException,
                                        com.amazonaws.sdb.AmazonSimpleDBException,
                                        javax.jcr.RepositoryException
Load PropertyData from SimpleDb Item.

Parameters:
parentPath - - parent path
atts - - SimpleDB Item attributes
withValues - - indicate if Property Value(s) data will be loaded
Returns:
PropertyData instance
Throws:
IllegalNameException - if QName stored in SimpleDB is wrong
java.lang.NumberFormatException - - if numeric values stored in SimpleDB is wrong
com.amazonaws.sdb.AmazonSimpleDBException - - if SimpleDB storage error occurs
javax.jcr.RepositoryException - if SimpleDB Item record contains wrong value
See Also:
SDBWorkspaceStorageConnection.listChildPropertiesData()

add

public void add(NodeData data)
         throws javax.jcr.ItemExistsException,
                javax.jcr.RepositoryException

Specified by:
add in interface WorkspaceStorageConnection
Throws:
javax.jcr.ItemExistsException
javax.jcr.RepositoryException

add

public void add(PropertyData data)
         throws javax.jcr.ItemExistsException,
                javax.jcr.RepositoryException

Specified by:
add in interface WorkspaceStorageConnection
Throws:
javax.jcr.ItemExistsException
javax.jcr.RepositoryException

commit

public void commit()
            throws java.lang.IllegalStateException,
                   javax.jcr.RepositoryException

Specified by:
commit in interface WorkspaceStorageConnection
Throws:
java.lang.IllegalStateException
javax.jcr.RepositoryException

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     javax.jcr.RepositoryException

Specified by:
rollback in interface WorkspaceStorageConnection
Throws:
java.lang.IllegalStateException
javax.jcr.RepositoryException

close

public void close()
           throws java.lang.IllegalStateException,
                  javax.jcr.RepositoryException
Same as roolback() method.

Specified by:
close in interface WorkspaceStorageConnection
Throws:
java.lang.IllegalStateException
javax.jcr.RepositoryException

delete

public void delete(NodeData data)
            throws javax.jcr.RepositoryException,
                   javax.jcr.InvalidItemStateException

Specified by:
delete in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
javax.jcr.InvalidItemStateException

delete

public void delete(PropertyData data)
            throws javax.jcr.RepositoryException,
                   javax.jcr.InvalidItemStateException

Specified by:
delete in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
javax.jcr.InvalidItemStateException

update

public void update(NodeData data)
            throws javax.jcr.RepositoryException,
                   java.lang.UnsupportedOperationException,
                   javax.jcr.InvalidItemStateException,
                   java.lang.IllegalStateException

Specified by:
update in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.UnsupportedOperationException
javax.jcr.InvalidItemStateException
java.lang.IllegalStateException

update

public void update(PropertyData data)
            throws javax.jcr.RepositoryException,
                   java.lang.UnsupportedOperationException,
                   javax.jcr.InvalidItemStateException,
                   java.lang.IllegalStateException

Specified by:
update in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.UnsupportedOperationException
javax.jcr.InvalidItemStateException
java.lang.IllegalStateException

rename

public void rename(NodeData data)
            throws javax.jcr.RepositoryException,
                   java.lang.UnsupportedOperationException,
                   javax.jcr.InvalidItemStateException,
                   java.lang.IllegalStateException

Specified by:
rename in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.UnsupportedOperationException
javax.jcr.InvalidItemStateException
java.lang.IllegalStateException

getChildNodesData

public java.util.List<NodeData> getChildNodesData(NodeData parent)
                                           throws javax.jcr.RepositoryException,
                                                  java.lang.IllegalStateException

Specified by:
getChildNodesData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException

getChildNodesCount

public int getChildNodesCount(NodeData parent)
                       throws javax.jcr.RepositoryException
Specified by:
getChildNodesCount in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException

getChildPropertiesData

public java.util.List<PropertyData> getChildPropertiesData(NodeData parent)
                                                    throws javax.jcr.RepositoryException,
                                                           java.lang.IllegalStateException

Specified by:
getChildPropertiesData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException

listChildPropertiesData

public java.util.List<PropertyData> listChildPropertiesData(NodeData parent)
                                                     throws javax.jcr.RepositoryException,
                                                            java.lang.IllegalStateException

Specified by:
listChildPropertiesData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException

getItemData

public ItemData getItemData(NodeData parent,
                            QPathEntry qname)
                     throws javax.jcr.RepositoryException,
                            java.lang.IllegalStateException

Specified by:
getItemData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException

getItemData

public ItemData getItemData(java.lang.String identifier)
                     throws javax.jcr.RepositoryException,
                            java.lang.IllegalStateException

Specified by:
getItemData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException

getReferencesData

public java.util.List<PropertyData> getReferencesData(java.lang.String nodeIdentifier)
                                               throws javax.jcr.RepositoryException,
                                                      java.lang.IllegalStateException,
                                                      java.lang.UnsupportedOperationException

Specified by:
getReferencesData in interface WorkspaceStorageConnection
Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
java.lang.UnsupportedOperationException

isOpened

public boolean isOpened()

Specified by:
isOpened in interface WorkspaceStorageConnection


Copyright © 2012 eXo Platform SAS. All Rights Reserved.