|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.slide.common.AbstractServiceBase
org.apache.slide.common.AbstractSimpleService
org.apache.slide.store.AbstractStore
Abstract implementation of a store. Handles all caching operations.
Field Summary | |
protected ContentStore |
contentStore
Content store. |
protected LockStore |
lockStore
Lock store. |
protected NodeStore |
nodeStore
Node store. |
protected java.util.Hashtable |
parameters
|
protected Service[] |
resourceManagers
Active resource manager list. |
protected RevisionDescriptorsStore |
revisionDescriptorsStore
Revision descriptors store. |
protected RevisionDescriptorStore |
revisionDescriptorStore
Revision descriptor store. |
protected SecurityStore |
securityStore
Security 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. |
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. |
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 |
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. |
void |
killLock(Uri uri,
NodeLock lock)
Kills a lock. |
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 revisionNumber)
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. |
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 |
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 |
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 |
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 |
protected NodeStore nodeStore
protected SecurityStore securityStore
protected LockStore lockStore
protected RevisionDescriptorsStore revisionDescriptorsStore
protected RevisionDescriptorStore revisionDescriptorStore
protected ContentStore contentStore
protected Service[] resourceManagers
protected java.util.Hashtable parameters
Constructor Detail |
public AbstractStore()
Method Detail |
public void setName(java.lang.String name)
setName
in interface Store
public java.lang.String getName()
getName
in interface Store
public void setScope(Scope scope)
setScope
in interface Store
setScope
in class AbstractServiceBase
public void setNamespace(Namespace namespace)
setNamespace
in interface Service
setNamespace
in class AbstractServiceBase
public void setParameters(java.util.Hashtable parameters) throws ServiceParameterErrorException, ServiceParameterMissingException
setParameters
in interface Service
setParameters
in class AbstractServiceBase
parameters
- Hashtable containing the parameters' name
and associated value
ServiceParameterErrorException
- Incorrect service parameter
ServiceParameterMissingException
- Service parameter missingpublic java.lang.Object getParameter(java.lang.Object key)
Store
getParameter
in interface Store
key
- an Object
public void connect(CredentialsToken crdtoken) throws ServiceConnectionFailedException
connect
in interface Service
connect
in class AbstractServiceBase
crdtoken
- the slide token containing e.g. the credential
DataException
ServiceConnectionFailedException
- Connection failedpublic void connect() throws ServiceConnectionFailedException
connect
in interface Service
connect
in class AbstractServiceBase
DataException
ServiceConnectionFailedException
- Connection failedpublic void disconnect() throws ServiceDisconnectionFailedException
disconnect
in interface Service
disconnect
in class AbstractServiceBase
ServiceDisconnectionFailedException
public void initialize(NamespaceAccessToken token) throws ServiceInitializationFailedException
initialize
in interface Service
initialize
in class AbstractServiceBase
token
- Namespace access token, needed if the service needs to
access objects or data within the namespace during its initialization
ServiceInitializationFailedException
- Throws an exception
if the descriptors store has already been initialized beforepublic void reset() throws ServiceResetFailedException
reset
in interface Service
reset
in class AbstractServiceBase
ServiceResetFailedException
- Reset failedpublic boolean isConnected() throws ServiceAccessException
isConnected
in interface Service
isConnected
in class AbstractServiceBase
ServiceAccessException
- Service access errorpublic void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
commit
in class AbstractSimpleService
xid
- A global transaction identifieronePhase
- If true, the resource manager should use a one-phase
commit protocol to commit the work done on behalf of xid.
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.public void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
end
in class AbstractSimpleService
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
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*.public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
forget
in class AbstractSimpleService
xid
- A global transaction identifier
javax.transaction.xa.XAException
- An error has occurred. Possible exception values
are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
prepare
in class AbstractSimpleService
xid
- A global transaction identifier
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.public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
rollback
in class AbstractSimpleService
xid
- A global transaction identifier
javax.transaction.xa.XAException
- An error has occurredpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
start
in class AbstractSimpleService
xid
- A global transaction identifier to be associated with the
resourceflags
- One of TMNOFLAGS, TMJOIN, or TMRESUME
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.public void setNodeStore(NodeStore nodeStore)
setNodeStore
in interface Store
public void setSecurityStore(SecurityStore securityStore)
setSecurityStore
in interface Store
public void setLockStore(LockStore lockStore)
setLockStore
in interface Store
public void setRevisionDescriptorsStore(RevisionDescriptorsStore revisionDescriptorsStore)
setRevisionDescriptorsStore
in interface Store
public void setRevisionDescriptorStore(RevisionDescriptorStore revisionDescriptorStore)
setRevisionDescriptorStore
in interface Store
public void setContentStore(ContentStore contentStore)
setContentStore
in interface Store
public ObjectNode retrieveObject(Uri uri) throws ServiceAccessException, ObjectNotFoundException
retrieveObject
in interface NodeStore
uri
- Uri of the object we want to retrieve
ServiceAccessException
- Error accessing the Descriptors Store
ObjectNotFoundException
- The object to retrieve was not foundpublic void storeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException
storeObject
in interface NodeStore
object
- Object to update
ServiceAccessException
- Error accessing the Descriptors Store
ObjectNotFoundException
- The object to update was not foundpublic void createObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectAlreadyExistsException
createObject
in interface NodeStore
object
- SlideObjecturi
- Uri of the object we want to create
ServiceAccessException
- Error accessing the Descriptors Store
ObjectAlreadyExistsException
- An object already exists
at this Uripublic void removeObject(Uri uri, ObjectNode object) throws ServiceAccessException, ObjectNotFoundException
removeObject
in interface NodeStore
object
- Object to remove
ServiceAccessException
- Error accessing the Descriptors Store
ObjectNotFoundException
- The object to remove was not foundpublic void grantPermission(Uri uri, NodePermission permission) throws ServiceAccessException
grantPermission
in interface SecurityStore
permission
- Permission we want to create
ServiceAccessException
- Error accessing the Descriptors Storepublic void revokePermission(Uri uri, NodePermission permission) throws ServiceAccessException
revokePermission
in interface SecurityStore
permission
- Permission we want to create
ServiceAccessException
- Error accessing the Descriptors Storepublic void revokePermissions(Uri uri) throws ServiceAccessException
revokePermissions
in interface SecurityStore
uri
- Uri of the object
ServiceAccessException
- Error accessing the Descriptors Storepublic java.util.Enumeration enumeratePermissions(Uri uri) throws ServiceAccessException
enumeratePermissions
in interface SecurityStore
uri
- Uri of the subject
locks
which have been put on the subject
ServiceAccessException
- Service access errorpublic void putLock(Uri uri, NodeLock lock) throws ServiceAccessException
putLock
in interface LockStore
lock
- Lock token
ServiceAccessException
- Service access errorpublic void renewLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
renewLock
in interface LockStore
lock
- Token to renew
ServiceAccessException
- Service access error
LockTokenNotFoundException
- Lock token was not foundpublic void removeLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
removeLock
in interface LockStore
lock
- Token to remove
ServiceAccessException
- Service access error
LockTokenNotFoundException
- Lock token was not foundpublic void killLock(Uri uri, NodeLock lock) throws ServiceAccessException, LockTokenNotFoundException
killLock
in interface LockStore
lock
- Token to remove
ServiceAccessException
- Service access error
LockTokenNotFoundException
- Lock token was not foundpublic java.util.Enumeration enumerateLocks(Uri uri) throws ServiceAccessException
enumerateLocks
in interface LockStore
uri
- Uri of the subject
locks
which have been put on the subject
ServiceAccessException
- Service access errorpublic NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri) throws ServiceAccessException, RevisionDescriptorNotFoundException
retrieveRevisionDescriptors
in interface RevisionDescriptorsStore
uri
- Uri
ServiceAccessException
- Service access error
RevisionDescriptorNotFoundException
- Revision descriptor
was not foundpublic void createRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException
createRevisionDescriptors
in interface RevisionDescriptorsStore
uri
- UrirevisionDescriptors
- Node revision descriptors
ServiceAccessException
- Service access errorpublic void storeRevisionDescriptors(Uri uri, NodeRevisionDescriptors revisionDescriptors) throws ServiceAccessException, RevisionDescriptorNotFoundException
storeRevisionDescriptors
in interface RevisionDescriptorsStore
uri
- UrirevisionDescriptors
- Node revision descriptors
ServiceAccessException
- Service access error
RevisionDescriptorNotFoundException
- Revision descriptor
was not foundpublic void removeRevisionDescriptors(Uri uri) throws ServiceAccessException
removeRevisionDescriptors
in interface RevisionDescriptorsStore
uri
- Uri
ServiceAccessException
- Service access errorpublic NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri, NodeRevisionNumber revisionNumber) throws ServiceAccessException, RevisionDescriptorNotFoundException
retrieveRevisionDescriptor
in interface RevisionDescriptorStore
uri
- urirevisionNumber
- Node revision number
ServiceAccessException
RevisionDescriptorNotFoundException
public void createRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException
createRevisionDescriptor
in interface RevisionDescriptorStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
- Service access errorpublic void storeRevisionDescriptor(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionDescriptorNotFoundException
storeRevisionDescriptor
in interface RevisionDescriptorStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
- Service access error
RevisionDescriptorNotFoundException
- Revision descriptor
was not foundpublic void removeRevisionDescriptor(Uri uri, NodeRevisionNumber revisionNumber) throws ServiceAccessException
removeRevisionDescriptor
in interface RevisionDescriptorStore
uri
- UrirevisionNumber
- Revision number
ServiceAccessException
- Service access errorpublic NodeRevisionContent retrieveRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, RevisionNotFoundException
retrieveRevisionContent
in interface ContentStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
RevisionNotFoundException
public void createRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionAlreadyExistException
createRevisionContent
in interface ContentStore
uri
- UrirevisionDescriptor
- Node revision descriptorrevisionContent
- Node revision content
ServiceAccessException
RevisionAlreadyExistException
public void storeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws ServiceAccessException, RevisionNotFoundException
storeRevisionContent
in interface ContentStore
uri
- UrirevisionDescriptor
- Node revision descriptorrevisionContent
- Node revision content
ServiceAccessException
RevisionNotFoundException
public void removeRevisionContent(Uri uri, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException
removeRevisionContent
in interface ContentStore
uri
- UrirevisionDescriptor
- Node revision descriptor
ServiceAccessException
protected boolean isForceStoreEnlistment(Uri uri)
protected void addResourceManager(Service service)
service
- New resource managerprotected void enlist() throws ServiceAccessException
ServiceAccessException
protected void enlist(Service service) throws ServiceAccessException
ServiceAccessException
protected void delist(boolean success) throws ServiceAccessException
ServiceAccessException
protected void delist(Service service) throws ServiceAccessException
ServiceAccessException
protected void delist(Service service, boolean success) throws ServiceAccessException
ServiceAccessException
protected void setRollbackOnly()
public boolean useBinding()
useBinding
in interface Store
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |