org.apache.slide.store
Class AbstractStore

java.lang.Object
  extended byorg.apache.slide.common.AbstractServiceBase
      extended byorg.apache.slide.common.AbstractSimpleService
          extended byorg.apache.slide.store.AbstractStore
All Implemented Interfaces:
ContentStore, LockStore, MacroStore, NodeStore, RevisionDescriptorsStore, RevisionDescriptorStore, SecurityStore, SequenceStore, Service, Store, javax.transaction.xa.XAResource
Direct Known Subclasses:
ExtendedStore, StandardStore

public abstract class AbstractStore
extends AbstractSimpleService
implements Store

Abstract implementation of a store. Handles all caching operations.

Version:
$Revision: 1.50 $

Field Summary
protected  IndexStore contentIndexer
          ContentIndex store
protected  ContentStore contentStore
          Content store.
protected  LockStore lockStore
          Lock store.
protected  MacroStore macroStore
          Macro store
protected  NodeStore nodeStore
          Node store.
protected  java.util.Hashtable parameters
           
protected  IndexStore propertiesIndexer
          DescriptorIndex store
protected  Service[] resourceManagers
          Active resource manager list.
protected  RevisionDescriptorsStore revisionDescriptorsStore
          Revision descriptors store.
protected  RevisionDescriptorStore revisionDescriptorStore
          Revision descriptor store.
protected  SecurityStore securityStore
          Security store.
protected  SequenceStore sequenceStore
          Sequence store
 
Fields inherited from class org.apache.slide.common.AbstractSimpleService
currentContext, rollbackOnly, status, transactionTimeout, TX_IDLE, TX_PREPARED, TX_SUSPENDED
 
Fields inherited from class org.apache.slide.common.AbstractServiceBase
LOG_CHANNEL, namespace, scope
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
AbstractStore()
           
 
Method Summary
protected  void addResourceManager(Service service)
          Add a new resource manager.
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
          Commit the global transaction specified by xid.
 void connect()
          Connects to descriptors store.
 void connect(CredentialsToken crdtoken)
          Connects to descriptors store.
 void createObject(Uri uri, ObjectNode object)
          Create a new object in the Descriptors Store.
 void createRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent)
          Create a new revision
 void createRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor)
          Create new revision descriptor.
 void createRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors)
          Create new revision descriptors.
 boolean createSequence(java.lang.String sequenceName)
          Creates a sequence if it does not already exist.
protected  void delist(boolean success)
          Delist (suspend) the resource manager in the current transaction.
protected  void delist(Service service)
          Delist (suspend) the resource manager in the current transaction.
protected  void delist(Service service, boolean success)
          Delist (suspend) the resource manager in the current transaction.
 void disconnect()
          Disconnects from descriptors store.
 void end(javax.transaction.xa.Xid xid, int flags)
          Ends the work performed on behalf of a transaction branch.
protected  void enlist()
          Enlist the resource manager in the current transaction.
protected  void enlist(Service service)
          Enlist the resource manager in the current transaction.
 java.util.Enumeration enumerateLocks(Uri uri)
          Enumerate locks on an object.
 java.util.Enumeration enumeratePermissions(Uri uri)
          Enumerate locks on an object.
 void forget(javax.transaction.xa.Xid xid)
          Tell the resource manager to forget about a heuristically completed transaction branch.
 IndexStore getContentIndexer()
          Method getContentIndexer
 java.lang.String getName()
          Return the name of the store as specified in domain.xml.
 java.lang.Object getParameter(java.lang.Object key)
          Get parameter value for specified key
 IndexStore getPropertiesIndexer()
          Method getPropertiesIndexer
 void grantPermission(Uri uri, NodePermission permission)
          Store an object permissions in the Descriptors Store.
 void initialize(NamespaceAccessToken token)
          Initializes descriptors store.
 boolean isConnected()
          This function tells whether or not the descriptors store is connected.
protected  boolean isForceStoreEnlistment(Uri uri)
          Return true if the store should also be enlisted for a read operation.
 boolean isMacroCopySupported()
          Checks if this store instance actually supports macro copy operation.
 boolean isMacroDeleteSupported()
          Checks if this store instance actually supports macro delete operation.
 boolean isMacroMoveSupported()
          Checks if this store instance actually supports macro move operation.
 boolean isSequenceSupported()
          Checks if this store instance actually supports sequences.
 void killLock(Uri uri, NodeLock lock)
          Kills a lock.
 void macroCopy(Uri sourceUri, Uri targetUri, boolean overwrite, boolean recursive)
          Recursively copies an object.
 void macroDelete(Uri targetUri)
          Deletes an object recursively.
 void macroMove(Uri sourceUri, Uri targetUri, boolean overwrite)
          Recursively moves an object.
 long nextSequenceValue(java.lang.String sequenceName)
          Gets the next value of the sequence.
 int prepare(javax.transaction.xa.Xid xid)
          Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
 void putLock(Uri uri, NodeLock lock)
          Puts a lock on a subject.
 void removeLock(Uri uri, NodeLock lock)
          Removes (cancels) a lock.
 void removeObject(Uri uri, ObjectNode object)
          Remove an object from the Descriptors Store.
 void removeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor)
          Remove revision.
 void removeRevisionDescriptor(Uri uri, NodeRevisionNumber number)
          Remove revision descriptor.
 void removeRevisionDescriptors(Uri uri)
          Remove revision descriptors.
 void renewLock(Uri uri, NodeLock lock)
          Renews a lock.
 void reset()
          Deletes descriptors store.
 ObjectNode retrieveObject(Uri uri)
          Retrive an object from the Descriptors Store.
 NodeRevisionContent retrieveRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor)
          Retrive revision content.
 NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri, NodeRevisionNumber revisionNumber)
          Retrieve revision descriptor.
 NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri)
          Retrieve a revision descriptors.
 void revokePermission(Uri uri, NodePermission permission)
          Store an object permissions in the Descriptors Store.
 void revokePermissions(Uri uri)
          Revoke all the permissions on the object.
 void rollback(javax.transaction.xa.Xid xid)
          Inform the resource manager to roll back work done on behalf of a transaction branch.
 boolean sequenceExists(java.lang.String sequenceName)
          Checks if the sequence already exists.
 void setContentIndexer(IndexStore contentIndexer)
          Set the Indexer associated to the conten store
 void setContentStore(ContentStore contentStore)
          Set the content store associated with this store.
 void setLockStore(LockStore lockStore)
          Set the lock store associated with this store.
 void setMacroStore(MacroStore store)
          Sets the sequence store associated with this store.
 void setName(java.lang.String name)
          Set the name of the store as specified in domain.xml.
 void setNamespace(Namespace namespace)
          Namespace setter.
 void setNodeStore(NodeStore nodeStore)
          Set the node store associated with this store.
 void setParameters(java.util.Hashtable parameters)
          Remeber the store parameters to initialise the default child stores on request
 void setPropertiesIndexer(IndexStore propertiesIndexer)
          Set the Indexer associated to the properties store
 void setRevisionDescriptorsStore(RevisionDescriptorsStore revisionDescriptorsStore)
          Set the revision descriptors store associated with this store.
 void setRevisionDescriptorStore(RevisionDescriptorStore revisionDescriptorStore)
          Set the revision descriptor store associated with this store.
protected  void setRollbackOnly()
          Mark transaction as rollback in case of enlistment failure.
 void setScope(Scope scope)
          Set the scope of the store as specified in domain.xml.
 void setSecurityStore(SecurityStore securityStore)
          Set the security store associated with this store.
 void setSequenceStore(SequenceStore store)
          Sets the sequence store associated with this store.
 void start(javax.transaction.xa.Xid xid, int flags)
          Start work on behalf of a transaction branch specified in xid.
 void storeObject(Uri uri, ObjectNode object)
          Store an object in the Descriptors Store.
 void storeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent)
          Modify the latest revision of an object.
 void storeRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor)
          Update revision descriptor.
 void storeRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors)
          Update revision descriptors.
 boolean useBinding()
          Always returns false.
 
Methods inherited from class org.apache.slide.common.AbstractSimpleService
getTransactionTimeout, isSameRM, recover, setTransactionTimeout
 
Methods inherited from class org.apache.slide.common.AbstractServiceBase
cacheResults, connectIfNeeded, connectIfNeeded, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.slide.common.Service
cacheResults, connectIfNeeded, connectIfNeeded, getLogger
 
Methods inherited from interface javax.transaction.xa.XAResource
getTransactionTimeout, isSameRM, recover, setTransactionTimeout
 

Field Detail

nodeStore

protected NodeStore nodeStore
Node store.


securityStore

protected SecurityStore securityStore
Security store.


lockStore

protected LockStore lockStore
Lock store.


revisionDescriptorsStore

protected RevisionDescriptorsStore revisionDescriptorsStore
Revision descriptors store.


revisionDescriptorStore

protected RevisionDescriptorStore revisionDescriptorStore
Revision descriptor store.


contentStore

protected ContentStore contentStore
Content store.


propertiesIndexer

protected IndexStore propertiesIndexer
DescriptorIndex store


contentIndexer

protected IndexStore contentIndexer
ContentIndex store


sequenceStore

protected SequenceStore sequenceStore
Sequence store


macroStore

protected MacroStore macroStore
Macro store


resourceManagers

protected Service[] resourceManagers
Active resource manager list.


parameters

protected java.util.Hashtable parameters
Constructor Detail

AbstractStore

public AbstractStore()
Method Detail

setName

public void setName(java.lang.String name)
Set the name of the store as specified in domain.xml.

Specified by:
setName in interface Store

getName

public java.lang.String getName()
Return the name of the store as specified in domain.xml.

Specified by:
getName in interface Store

setScope

public void setScope(Scope scope)
Set the scope of the store as specified in domain.xml.

Specified by:
setScope in interface Store
Overrides:
setScope in class AbstractServiceBase

setNamespace

public void setNamespace(Namespace namespace)
Namespace setter.

Specified by:
setNamespace in interface Service
Overrides:
setNamespace in class AbstractServiceBase

setParameters

public void setParameters(java.util.Hashtable parameters)
                   throws ServiceParameterErrorException,
                          ServiceParameterMissingException
Remeber the store parameters to initialise the default child stores on request

Specified by:
setParameters in interface Service
Specified by:
setParameters in class AbstractServiceBase
Parameters:
parameters - Hashtable containing the parameters' name and associated value
Throws:
ServiceParameterErrorException - Incorrect service parameter
ServiceParameterMissingException - Service parameter missing

getParameter

public java.lang.Object getParameter(java.lang.Object key)
Description copied from interface: Store
Get parameter value for specified key

Specified by:
getParameter in interface Store
Parameters:
key - an Object
Returns:
an Object

connect

public void connect(CredentialsToken crdtoken)
             throws ServiceConnectionFailedException
Connects to descriptors store.

Specified by:
connect in interface Service
Overrides:
connect in class AbstractServiceBase
Parameters:
crdtoken - the slide token containing e.g. the credential
Throws:
DataException
ServiceConnectionFailedException - Connection failed

connect

public void connect()
             throws ServiceConnectionFailedException
Connects to descriptors store.

Specified by:
connect in interface Service
Specified by:
connect in class AbstractServiceBase
Throws:
DataException
ServiceConnectionFailedException - Connection failed

disconnect

public void disconnect()
                throws ServiceDisconnectionFailedException
Disconnects from descriptors store.

Specified by:
disconnect in interface Service
Specified by:
disconnect in class AbstractServiceBase
Throws:
ServiceDisconnectionFailedException

initialize

public void initialize(NamespaceAccessToken token)
                throws ServiceInitializationFailedException
Initializes descriptors store.

Specified by:
initialize in interface Service
Overrides:
initialize in class AbstractServiceBase
Parameters:
token - Namespace access token, needed if the service needs to access objects or data within the namespace during its initialization
Throws:
ServiceInitializationFailedException - Throws an exception if the descriptors store has already been initialized before

reset

public void reset()
           throws ServiceResetFailedException
Deletes descriptors store. Should remove stored data if possible.

Specified by:
reset in interface Service
Specified by:
reset in class AbstractServiceBase
Throws:
ServiceResetFailedException - Reset failed

isConnected

public boolean isConnected()
                    throws ServiceAccessException
This function tells whether or not the descriptors store is connected.

Specified by:
isConnected in interface Service
Specified by:
isConnected in class AbstractServiceBase
Returns:
boolean true if we are connected
Throws:
ServiceAccessException - Service access error

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase)
            throws javax.transaction.xa.XAException
Commit the global transaction specified by xid.

Specified by:
commit in interface javax.transaction.xa.XAResource
Overrides:
commit in class AbstractSimpleService
Parameters:
xid - A global transaction identifier
onePhase - If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO. If the resource manager did not commit the transaction and the paramether onePhase is set to true, the resource manager may throw one of the XA_RB* exceptions. Upon return, the resource manager has rolled back the branch's work and has released all held resources.

end

public void end(javax.transaction.xa.Xid xid,
                int flags)
         throws javax.transaction.xa.XAException
Ends the work performed on behalf of a transaction branch.

Specified by:
end in interface javax.transaction.xa.XAResource
Overrides:
end in class AbstractSimpleService
Parameters:
xid - A global transaction identifier that is the same as what was used previously in the start method.
flags - One of TMSUCCESS, TMFAIL, or TMSUSPEND
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible XAException values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL, XAER_PROTO, or XA_RB*.

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Tell the resource manager to forget about a heuristically completed transaction branch.

Specified by:
forget in interface javax.transaction.xa.XAResource
Overrides:
forget in class AbstractSimpleService
Parameters:
xid - A global transaction identifier
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.

Specified by:
prepare in interface javax.transaction.xa.XAResource
Overrides:
prepare in class AbstractSimpleService
Parameters:
xid - A global transaction identifier
Returns:
A value indicating the resource manager's vote on the outcome of the transaction. The possible values are: XA_RDONLY or XA_OK. If the resource manager wants to roll back the transaction, it should do so by raising an appropriate XAException in the prepare method.
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible exception values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException
Inform the resource manager to roll back work done on behalf of a transaction branch.

Specified by:
rollback in interface javax.transaction.xa.XAResource
Overrides:
rollback in class AbstractSimpleService
Parameters:
xid - A global transaction identifier
Throws:
javax.transaction.xa.XAException - An error has occurred

start

public void start(javax.transaction.xa.Xid xid,
                  int flags)
           throws javax.transaction.xa.XAException
Start work on behalf of a transaction branch specified in xid.

Specified by:
start in interface javax.transaction.xa.XAResource
Overrides:
start in class AbstractSimpleService
Parameters:
xid - A global transaction identifier to be associated with the resource
flags - One of TMNOFLAGS, TMJOIN, or TMRESUME
Throws:
javax.transaction.xa.XAException - An error has occurred. Possible exceptions are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

setNodeStore

public void setNodeStore(NodeStore nodeStore)
Set the node store associated with this store.

Specified by:
setNodeStore in interface Store

setSecurityStore

public void setSecurityStore(SecurityStore securityStore)
Set the security store associated with this store.

Specified by:
setSecurityStore in interface Store

setLockStore

public void setLockStore(LockStore lockStore)
Set the lock store associated with this store.

Specified by:
setLockStore in interface Store

setRevisionDescriptorsStore

public void setRevisionDescriptorsStore(RevisionDescriptorsStore revisionDescriptorsStore)
Set the revision descriptors store associated with this store.

Specified by:
setRevisionDescriptorsStore in interface Store

setRevisionDescriptorStore

public void setRevisionDescriptorStore(RevisionDescriptorStore revisionDescriptorStore)
Set the revision descriptor store associated with this store.

Specified by:
setRevisionDescriptorStore in interface Store

setContentStore

public void setContentStore(ContentStore contentStore)
Set the content store associated with this store.

Specified by:
setContentStore in interface Store

setPropertiesIndexer

public void setPropertiesIndexer(IndexStore propertiesIndexer)
Set the Indexer associated to the properties store

Specified by:
setPropertiesIndexer in interface Store
Parameters:
propertiesIndexer - an IndexStore

setContentIndexer

public void setContentIndexer(IndexStore contentIndexer)
Set the Indexer associated to the conten store

Specified by:
setContentIndexer in interface Store
Parameters:
contentIndexer - an IndexStore

getContentIndexer

public IndexStore getContentIndexer()
Method getContentIndexer

Returns:
an IndexStore

getPropertiesIndexer

public IndexStore getPropertiesIndexer()
Method getPropertiesIndexer

Returns:
an IndexStore

setSequenceStore

public void setSequenceStore(SequenceStore store)
Sets the sequence store associated with this store.

Specified by:
setSequenceStore in interface Store

setMacroStore

public void setMacroStore(MacroStore store)
Sets the sequence store associated with this store.

Specified by:
setMacroStore in interface Store

isSequenceSupported

public boolean isSequenceSupported()
Description copied from interface: SequenceStore
Checks if this store instance actually supports sequences. It may seem clear this store supports sequences as it implements this interface, but a request to the underlying persistence store might be needed to dynamically find out.

Specified by:
isSequenceSupported in interface SequenceStore
Returns:
true if the store supports sequences, false otherwise
See Also:
SequenceStore.isSequenceSupported()

sequenceExists

public boolean sequenceExists(java.lang.String sequenceName)
                       throws ServiceAccessException
Description copied from interface: SequenceStore
Checks if the sequence already exists.

Specified by:
sequenceExists in interface SequenceStore
Parameters:
sequenceName - the name of the sequence you want to check
Returns:
true if the sequence already exists, false otherwise
Throws:
ServiceAccessException - if anything goes wrong while accessing the sequence
See Also:
SequenceStore.sequenceExists(java.lang.String)

createSequence

public boolean createSequence(java.lang.String sequenceName)
                       throws ServiceAccessException
Description copied from interface: SequenceStore
Creates a sequence if it does not already exist.

Specified by:
createSequence in interface SequenceStore
Parameters:
sequenceName - the name of the sequence you want to create
Returns:
true if the sequence has been created, false if it already existed
Throws:
ServiceAccessException - if anything goes wrong while accessing the sequence
See Also:
SequenceStore.createSequence(java.lang.String)

nextSequenceValue

public long nextSequenceValue(java.lang.String sequenceName)
                       throws ServiceAccessException
Description copied from interface: SequenceStore
Gets the next value of the sequence. Note that the sequence may not deliver consecutive or continuous values. The only thing that is assured is the value will be unique in the scope of the sequence, i.e. this method will never return the same value for the same sequence. A sequence of valid values might be
1,2,3,4,5,...
, but it might just as well be
10,787875845,1,2,434,...
. However, it may not be
1,2,1,3,...
. as a sequence must never return the same value twice or more times.

Specified by:
nextSequenceValue in interface SequenceStore
Returns:
the next value of the sequence
Throws:
ServiceAccessException - if anything goes wrong while accessing the sequence
See Also:
SequenceStore.nextSequenceValue(java.lang.String)

isMacroDeleteSupported

public boolean isMacroDeleteSupported()
Description copied from interface: MacroStore
Checks if this store instance actually supports macro delete operation. It may seem clear this store supports sequences as it implements this interface, but a request to the underlying persistence store might be needed to dynamically find out.

Specified by:
isMacroDeleteSupported in interface MacroStore
Returns:
true if the store supports the macro delete operation, false otherwise
See Also:
MacroStore.isMacroDeleteSupported()

macroDelete

public void macroDelete(Uri targetUri)
                 throws ServiceAccessException,
                        ObjectNotFoundException
Description copied from interface: MacroStore
Deletes an object recursively.

Specified by:
macroDelete in interface MacroStore
Parameters:
targetUri - Uri of the object to delete
Throws:
ObjectNotFoundException - if the object to delete was not found
ServiceAccessException - if anything else goes wrong while deleting the object
See Also:
MacroStore.macroDelete(org.apache.slide.common.Uri)

isMacroCopySupported

public boolean isMacroCopySupported()
Description copied from interface: MacroStore
Checks if this store instance actually supports macro copy operation. It may seem clear this store supports sequences as it implements this interface, but a request to the underlying persistence store might be needed to dynamically find out.

Specified by:
isMacroCopySupported in interface MacroStore
Returns:
true if the store supports the macro copy operation, false otherwise
See Also:
MacroStore.isMacroCopySupported()

macroCopy

public void macroCopy(Uri sourceUri,
                      Uri targetUri,
                      boolean overwrite,
                      boolean recursive)
               throws ServiceAccessException,
                      ObjectNotFoundException,
                      ObjectAlreadyExistsException
Description copied from interface: MacroStore
Recursively copies an object.

Specified by:
macroCopy in interface MacroStore
Parameters:
sourceUri - the source URI of the copy
targetUri - the destination URI of the copy
overwrite - true if the target shall be copied to even if it already exsis
recursive - true if all descendants of the source should be copied as well
Throws:
ObjectAlreadyExistsException - if the object to copy to to was already there
ObjectNotFoundException - if the object to copy from was not found
ServiceAccessException - if anything else goes wrong while copying the object
See Also:
MacroStore.macroCopy(Uri, Uri, boolean, boolean)

isMacroMoveSupported

public boolean isMacroMoveSupported()
Description copied from interface: MacroStore
Checks if this store instance actually supports macro move operation. It may seem clear this store supports sequences as it implements this interface, but a request to the underlying persistence store might be needed to dynamically find out.

Specified by:
isMacroMoveSupported in interface MacroStore
Returns:
true if the store supports the macro move operation, false otherwise
See Also:
MacroStore.isMacroMoveSupported()

macroMove

public void macroMove(Uri sourceUri,
                      Uri targetUri,
                      boolean overwrite)
               throws ServiceAccessException,
                      ObjectNotFoundException,
                      ObjectAlreadyExistsException
Description copied from interface: MacroStore
Recursively moves an object.

Specified by:
macroMove in interface MacroStore
Parameters:
sourceUri - the source URI of the move
targetUri - the destination URI of the move
overwrite - true if the target shall be copied to even if it already exsis
Throws:
ServiceAccessException - if anything else goes wrong while moving the object
ObjectAlreadyExistsException - if the object to move to to was already there
ObjectNotFoundException - if the object to move from was not found
See Also:
MacroStore.macroMove(Uri, Uri, boolean)

retrieveObject

public ObjectNode retrieveObject(Uri uri)
                          throws ServiceAccessException,
                                 ObjectNotFoundException
Retrive an object from the Descriptors Store.

Specified by:
retrieveObject in interface NodeStore
Parameters:
uri - Uri of the object we want to retrieve
Throws:
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to retrieve was not found

storeObject

public void storeObject(Uri uri,
                        ObjectNode object)
                 throws ServiceAccessException,
                        ObjectNotFoundException
Store an object in the Descriptors Store.

Specified by:
storeObject in interface NodeStore
Parameters:
object - Object to update
Throws:
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to update was not found

createObject

public void createObject(Uri uri,
                         ObjectNode object)
                  throws ServiceAccessException,
                         ObjectAlreadyExistsException
Create a new object in the Descriptors Store.

Specified by:
createObject in interface NodeStore
Parameters:
object - SlideObject
uri - Uri of the object we want to create
Throws:
ServiceAccessException - Error accessing the Descriptors Store
ObjectAlreadyExistsException - An object already exists at this Uri

removeObject

public void removeObject(Uri uri,
                         ObjectNode object)
                  throws ServiceAccessException,
                         ObjectNotFoundException
Remove an object from the Descriptors Store.

Specified by:
removeObject in interface NodeStore
Parameters:
object - Object to remove
Throws:
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to remove was not found

grantPermission

public void grantPermission(Uri uri,
                            NodePermission permission)
                     throws ServiceAccessException
Store an object permissions in the Descriptors Store.

Specified by:
grantPermission in interface SecurityStore
Parameters:
permission - Permission we want to create
Throws:
ServiceAccessException - Error accessing the Descriptors Store

revokePermission

public void revokePermission(Uri uri,
                             NodePermission permission)
                      throws ServiceAccessException
Store an object permissions in the Descriptors Store.

Specified by:
revokePermission in interface SecurityStore
Parameters:
permission - Permission we want to create
Throws:
ServiceAccessException - Error accessing the Descriptors Store

revokePermissions

public void revokePermissions(Uri uri)
                       throws ServiceAccessException
Revoke all the permissions on the object.

Specified by:
revokePermissions in interface SecurityStore
Parameters:
uri - Uri of the object
Throws:
ServiceAccessException - Error accessing the Descriptors Store

enumeratePermissions

public java.util.Enumeration enumeratePermissions(Uri uri)
                                           throws ServiceAccessException
Enumerate locks on an object.

Specified by:
enumeratePermissions in interface SecurityStore
Parameters:
uri - Uri of the subject
Returns:
Enumeration List of locks which have been put on the subject
Throws:
ServiceAccessException - Service access error

putLock

public void putLock(Uri uri,
                    NodeLock lock)
             throws ServiceAccessException
Puts a lock on a subject.

Specified by:
putLock in interface LockStore
Parameters:
lock - Lock token
Throws:
ServiceAccessException - Service access error

renewLock

public void renewLock(Uri uri,
                      NodeLock lock)
               throws ServiceAccessException,
                      LockTokenNotFoundException
Renews a lock.

Specified by:
renewLock in interface LockStore
Parameters:
lock - Token to renew
Throws:
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found

removeLock

public void removeLock(Uri uri,
                       NodeLock lock)
                throws ServiceAccessException,
                       LockTokenNotFoundException
Removes (cancels) a lock.

Specified by:
removeLock in interface LockStore
Parameters:
lock - Token to remove
Throws:
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found

killLock

public void killLock(Uri uri,
                     NodeLock lock)
              throws ServiceAccessException,
                     LockTokenNotFoundException
Kills a lock.

Specified by:
killLock in interface LockStore
Parameters:
lock - Token to remove
Throws:
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found

enumerateLocks

public java.util.Enumeration enumerateLocks(Uri uri)
                                     throws ServiceAccessException
Enumerate locks on an object.

Specified by:
enumerateLocks in interface LockStore
Parameters:
uri - Uri of the subject
Returns:
Enumeration List of locks which have been put on the subject
Throws:
ServiceAccessException - Service access error

retrieveRevisionDescriptors

public NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri)
                                                    throws ServiceAccessException,
                                                           RevisionDescriptorNotFoundException
Retrieve a revision descriptors.

Specified by:
retrieveRevisionDescriptors in interface RevisionDescriptorsStore
Parameters:
uri - Uri
Throws:
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor was not found

createRevisionDescriptors

public void createRevisionDescriptors(Uri uri,
                                      NodeRevisionDescriptors revisionDescriptors)
                               throws ServiceAccessException
Create new revision descriptors.

Specified by:
createRevisionDescriptors in interface RevisionDescriptorsStore
Parameters:
uri - Uri
revisionDescriptors - Node revision descriptors
Throws:
ServiceAccessException - Service access error

storeRevisionDescriptors

public void storeRevisionDescriptors(Uri uri,
                                     NodeRevisionDescriptors revisionDescriptors)
                              throws ServiceAccessException,
                                     RevisionDescriptorNotFoundException
Update revision descriptors.

Specified by:
storeRevisionDescriptors in interface RevisionDescriptorsStore
Parameters:
uri - Uri
revisionDescriptors - Node revision descriptors
Throws:
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor was not found

removeRevisionDescriptors

public void removeRevisionDescriptors(Uri uri)
                               throws ServiceAccessException
Remove revision descriptors.

Specified by:
removeRevisionDescriptors in interface RevisionDescriptorsStore
Parameters:
uri - Uri
Throws:
ServiceAccessException - Service access error

retrieveRevisionDescriptor

public NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri,
                                                         NodeRevisionNumber revisionNumber)
                                                  throws ServiceAccessException,
                                                         RevisionDescriptorNotFoundException
Retrieve revision descriptor.

Specified by:
retrieveRevisionDescriptor in interface RevisionDescriptorStore
Parameters:
uri - uri
revisionNumber - Node revision number
Throws:
ServiceAccessException
RevisionDescriptorNotFoundException

createRevisionDescriptor

public void createRevisionDescriptor(Uri uri,
                                     NodeRevisionDescriptor revisionDescriptor)
                              throws ServiceAccessException
Create new revision descriptor.

Specified by:
createRevisionDescriptor in interface RevisionDescriptorStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ServiceAccessException - Service access error

storeRevisionDescriptor

public void storeRevisionDescriptor(Uri uri,
                                    NodeRevisionDescriptor revisionDescriptor)
                             throws ServiceAccessException,
                                    RevisionDescriptorNotFoundException
Update revision descriptor.

Specified by:
storeRevisionDescriptor in interface RevisionDescriptorStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor was not found

removeRevisionDescriptor

public void removeRevisionDescriptor(Uri uri,
                                     NodeRevisionNumber number)
                              throws ServiceAccessException
Remove revision descriptor.

Specified by:
removeRevisionDescriptor in interface RevisionDescriptorStore
Parameters:
uri - Uri
number - Revision number
Throws:
ServiceAccessException - Service access error

retrieveRevisionContent

public NodeRevisionContent retrieveRevisionContent(Uri uri,
                                                   NodeRevisionDescriptor revisionDescriptor)
                                            throws ServiceAccessException,
                                                   RevisionNotFoundException
Retrive revision content.

Specified by:
retrieveRevisionContent in interface ContentStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ServiceAccessException
RevisionNotFoundException

createRevisionContent

public void createRevisionContent(Uri uri,
                                  NodeRevisionDescriptor revisionDescriptor,
                                  NodeRevisionContent revisionContent)
                           throws ServiceAccessException,
                                  RevisionAlreadyExistException
Create a new revision

Specified by:
createRevisionContent in interface ContentStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
revisionContent - Node revision content
Throws:
ServiceAccessException
RevisionAlreadyExistException

storeRevisionContent

public void storeRevisionContent(Uri uri,
                                 NodeRevisionDescriptor revisionDescriptor,
                                 NodeRevisionContent revisionContent)
                          throws ServiceAccessException,
                                 RevisionNotFoundException
Modify the latest revision of an object.

Specified by:
storeRevisionContent in interface ContentStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
revisionContent - Node revision content
Throws:
ServiceAccessException
RevisionNotFoundException

removeRevisionContent

public void removeRevisionContent(Uri uri,
                                  NodeRevisionDescriptor revisionDescriptor)
                           throws ServiceAccessException
Remove revision.

Specified by:
removeRevisionContent in interface ContentStore
Parameters:
uri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ServiceAccessException

isForceStoreEnlistment

protected boolean isForceStoreEnlistment(Uri uri)
Return true if the store should also be enlisted for a read operation.


addResourceManager

protected void addResourceManager(Service service)
Add a new resource manager.

Parameters:
service - New resource manager

enlist

protected void enlist()
               throws ServiceAccessException
Enlist the resource manager in the current transaction.

Throws:
ServiceAccessException

enlist

protected void enlist(Service service)
               throws ServiceAccessException
Enlist the resource manager in the current transaction.

Throws:
ServiceAccessException

delist

protected void delist(boolean success)
               throws ServiceAccessException
Delist (suspend) the resource manager in the current transaction.

Throws:
ServiceAccessException

delist

protected void delist(Service service)
               throws ServiceAccessException
Delist (suspend) the resource manager in the current transaction.

Throws:
ServiceAccessException

delist

protected void delist(Service service,
                      boolean success)
               throws ServiceAccessException
Delist (suspend) the resource manager in the current transaction.

Throws:
ServiceAccessException

setRollbackOnly

protected void setRollbackOnly()
Mark transaction as rollback in case of enlistment failure.


useBinding

public boolean useBinding()
Always returns false. Default implementation for this method Stores that support binding should override this method.

Specified by:
useBinding in interface Store