|
||||||||||
| 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 Storepublic java.lang.String getName()
getName in interface Storepublic void setScope(Scope scope)
setScope in interface StoresetScope in class AbstractServiceBasepublic void setNamespace(Namespace namespace)
setNamespace in interface ServicesetNamespace in class AbstractServiceBase
public void setParameters(java.util.Hashtable parameters)
throws ServiceParameterErrorException,
ServiceParameterMissingException
setParameters in interface ServicesetParameters in class AbstractServiceBaseparameters - 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 Storekey - an Object
public void connect(CredentialsToken crdtoken)
throws ServiceConnectionFailedException
connect in interface Serviceconnect in class AbstractServiceBasecrdtoken - the slide token containing e.g. the credential
DataException
ServiceConnectionFailedException - Connection failed
public void connect()
throws ServiceConnectionFailedException
connect in interface Serviceconnect in class AbstractServiceBaseDataException
ServiceConnectionFailedException - Connection failed
public void disconnect()
throws ServiceDisconnectionFailedException
disconnect in interface Servicedisconnect in class AbstractServiceBaseServiceDisconnectionFailedException
public void initialize(NamespaceAccessToken token)
throws ServiceInitializationFailedException
initialize in interface Serviceinitialize in class AbstractServiceBasetoken - 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 before
public void reset()
throws ServiceResetFailedException
reset in interface Servicereset in class AbstractServiceBaseServiceResetFailedException - Reset failed
public boolean isConnected()
throws ServiceAccessException
isConnected in interface ServiceisConnected in class AbstractServiceBaseServiceAccessException - Service access error
public void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
commit in interface javax.transaction.xa.XAResourcecommit in class AbstractSimpleServicexid - 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.XAResourceend in class AbstractSimpleServicexid - 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.XAResourceforget in class AbstractSimpleServicexid - 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.XAResourceprepare in class AbstractSimpleServicexid - 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.XAResourcerollback in class AbstractSimpleServicexid - A global transaction identifier
javax.transaction.xa.XAException - An error has occurred
public void start(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
start in interface javax.transaction.xa.XAResourcestart in class AbstractSimpleServicexid - 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 Storepublic void setSecurityStore(SecurityStore securityStore)
setSecurityStore in interface Storepublic void setLockStore(LockStore lockStore)
setLockStore in interface Storepublic void setRevisionDescriptorsStore(RevisionDescriptorsStore revisionDescriptorsStore)
setRevisionDescriptorsStore in interface Storepublic void setRevisionDescriptorStore(RevisionDescriptorStore revisionDescriptorStore)
setRevisionDescriptorStore in interface Storepublic void setContentStore(ContentStore contentStore)
setContentStore in interface Store
public ObjectNode retrieveObject(Uri uri)
throws ServiceAccessException,
ObjectNotFoundException
retrieveObject in interface NodeStoreuri - Uri of the object we want to retrieve
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to retrieve was not found
public void storeObject(Uri uri,
ObjectNode object)
throws ServiceAccessException,
ObjectNotFoundException
storeObject in interface NodeStoreobject - Object to update
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to update was not found
public void createObject(Uri uri,
ObjectNode object)
throws ServiceAccessException,
ObjectAlreadyExistsException
createObject in interface NodeStoreobject - SlideObjecturi - Uri of the object we want to create
ServiceAccessException - Error accessing the Descriptors Store
ObjectAlreadyExistsException - An object already exists
at this Uri
public void removeObject(Uri uri,
ObjectNode object)
throws ServiceAccessException,
ObjectNotFoundException
removeObject in interface NodeStoreobject - Object to remove
ServiceAccessException - Error accessing the Descriptors Store
ObjectNotFoundException - The object to remove was not found
public void grantPermission(Uri uri,
NodePermission permission)
throws ServiceAccessException
grantPermission in interface SecurityStorepermission - Permission we want to create
ServiceAccessException - Error accessing the Descriptors Store
public void revokePermission(Uri uri,
NodePermission permission)
throws ServiceAccessException
revokePermission in interface SecurityStorepermission - Permission we want to create
ServiceAccessException - Error accessing the Descriptors Store
public void revokePermissions(Uri uri)
throws ServiceAccessException
revokePermissions in interface SecurityStoreuri - Uri of the object
ServiceAccessException - Error accessing the Descriptors Store
public java.util.Enumeration enumeratePermissions(Uri uri)
throws ServiceAccessException
enumeratePermissions in interface SecurityStoreuri - Uri of the subject
locks
which have been put on the subject
ServiceAccessException - Service access error
public void putLock(Uri uri,
NodeLock lock)
throws ServiceAccessException
putLock in interface LockStorelock - Lock token
ServiceAccessException - Service access error
public void renewLock(Uri uri,
NodeLock lock)
throws ServiceAccessException,
LockTokenNotFoundException
renewLock in interface LockStorelock - Token to renew
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found
public void removeLock(Uri uri,
NodeLock lock)
throws ServiceAccessException,
LockTokenNotFoundException
removeLock in interface LockStorelock - Token to remove
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found
public void killLock(Uri uri,
NodeLock lock)
throws ServiceAccessException,
LockTokenNotFoundException
killLock in interface LockStorelock - Token to remove
ServiceAccessException - Service access error
LockTokenNotFoundException - Lock token was not found
public java.util.Enumeration enumerateLocks(Uri uri)
throws ServiceAccessException
enumerateLocks in interface LockStoreuri - Uri of the subject
locks
which have been put on the subject
ServiceAccessException - Service access error
public NodeRevisionDescriptors retrieveRevisionDescriptors(Uri uri)
throws ServiceAccessException,
RevisionDescriptorNotFoundException
retrieveRevisionDescriptors in interface RevisionDescriptorsStoreuri - Uri
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor
was not found
public void createRevisionDescriptors(Uri uri,
NodeRevisionDescriptors revisionDescriptors)
throws ServiceAccessException
createRevisionDescriptors in interface RevisionDescriptorsStoreuri - UrirevisionDescriptors - Node revision descriptors
ServiceAccessException - Service access error
public void storeRevisionDescriptors(Uri uri,
NodeRevisionDescriptors revisionDescriptors)
throws ServiceAccessException,
RevisionDescriptorNotFoundException
storeRevisionDescriptors in interface RevisionDescriptorsStoreuri - UrirevisionDescriptors - Node revision descriptors
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor
was not found
public void removeRevisionDescriptors(Uri uri)
throws ServiceAccessException
removeRevisionDescriptors in interface RevisionDescriptorsStoreuri - Uri
ServiceAccessException - Service access error
public NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri,
NodeRevisionNumber revisionNumber)
throws ServiceAccessException,
RevisionDescriptorNotFoundException
retrieveRevisionDescriptor in interface RevisionDescriptorStoreuri - urirevisionNumber - Node revision number
ServiceAccessException
RevisionDescriptorNotFoundException
public void createRevisionDescriptor(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
throws ServiceAccessException
createRevisionDescriptor in interface RevisionDescriptorStoreuri - UrirevisionDescriptor - Node revision descriptor
ServiceAccessException - Service access error
public void storeRevisionDescriptor(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
throws ServiceAccessException,
RevisionDescriptorNotFoundException
storeRevisionDescriptor in interface RevisionDescriptorStoreuri - UrirevisionDescriptor - Node revision descriptor
ServiceAccessException - Service access error
RevisionDescriptorNotFoundException - Revision descriptor
was not found
public void removeRevisionDescriptor(Uri uri,
NodeRevisionNumber revisionNumber)
throws ServiceAccessException
removeRevisionDescriptor in interface RevisionDescriptorStoreuri - UrirevisionNumber - Revision number
ServiceAccessException - Service access error
public NodeRevisionContent retrieveRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
throws ServiceAccessException,
RevisionNotFoundException
retrieveRevisionContent in interface ContentStoreuri - UrirevisionDescriptor - Node revision descriptor
ServiceAccessException
RevisionNotFoundException
public void createRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ServiceAccessException,
RevisionAlreadyExistException
createRevisionContent in interface ContentStoreuri - UrirevisionDescriptor - Node revision descriptorrevisionContent - Node revision content
ServiceAccessException
RevisionAlreadyExistException
public void storeRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
throws ServiceAccessException,
RevisionNotFoundException
storeRevisionContent in interface ContentStoreuri - UrirevisionDescriptor - Node revision descriptorrevisionContent - Node revision content
ServiceAccessException
RevisionNotFoundException
public void removeRevisionContent(Uri uri,
NodeRevisionDescriptor revisionDescriptor)
throws ServiceAccessException
removeRevisionContent in interface ContentStoreuri - UrirevisionDescriptor - Node revision descriptor
ServiceAccessExceptionprotected boolean isForceStoreEnlistment(Uri uri)
protected void addResourceManager(Service service)
service - New resource manager
protected 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
ServiceAccessExceptionprotected 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 | |||||||||