public abstract class AbstractLockDAOImpl extends java.lang.Object implements LockDAO
| Constructor and Description |
|---|
AbstractLockDAOImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract LockEntity |
createLock(java.lang.Long sharedResourceId,
java.lang.Long exclusiveResourceId,
java.lang.String lockToken,
long timeToLive)
Create a new lock.
|
protected abstract LockResourceEntity |
createLockResource(java.lang.Long qnameNamespaceId,
java.lang.String qnameLocalName)
Create a unique lock resource
|
protected abstract LockEntity |
getLock(java.lang.Long id) |
protected abstract LockEntity |
getLock(java.lang.Long sharedResourceId,
java.lang.Long exclusiveResourceId) |
void |
getLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken,
long timeToLive)
Aquire a given exclusive lock, assigning it (and any implicitly shared locks) a
timeout.
|
protected abstract LockResourceEntity |
getLockResource(java.lang.Long qnameNamespaceId,
java.lang.String qnameLocalName)
Override to get the unique, lock resource entity if one exists.
|
protected abstract java.util.List |
getLocksBySharedResourceIds(java.util.List sharedLockResourceIds)
Get any existing lock data for the shared resources.
|
protected QNameDAO |
getQNameDAO() |
void |
refreshLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken,
long timeToLive)
Refresh a held lock.
|
void |
releaseLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken)
Release a lock.
|
void |
setQnameDAO(QNameDAO qnameDAO) |
protected java.util.List |
splitLockQName(org.alfresco.service.namespace.QName lockQName)
Split a lock's qualified name into the component parts using the '.' (period) as a
separator on the localname.
|
protected abstract LockEntity |
updateLock(LockEntity lockEntity,
java.lang.String lockToken,
long timeToLive)
Update an existing lock
|
protected abstract int |
updateLocks(java.lang.Long exclusiveLockResourceId,
java.lang.String oldLockToken,
java.lang.String newLockToken,
long timeToLive) |
protected QNameDAO getQNameDAO()
public void setQnameDAO(QNameDAO qnameDAO)
qnameDAO - DAO for namespace ID resolutionpublic void getLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken,
long timeToLive)
LockDAOA lock can be re-taken if it has expired and if the lock token has not changed
public void refreshLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken,
long timeToLive)
LockDAOrefreshLock in interface LockDAOlockQName - the unique name of the lock to updatelockToken - the lock token for the lock heldtimeToLive - the new time to live (in milliseconds)public void releaseLock(org.alfresco.service.namespace.QName lockQName,
java.lang.String lockToken)
LockDAONote: Failure to release a lock due to a exception condition is dealt with by passing the exception out.
releaseLock in interface LockDAOlockQName - the unique name of the lock to releaselockToken - the current lock tokenprotected abstract LockResourceEntity getLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)
qnameNamespaceId - the namespace entity IDqnameLocalName - the lock localnameprotected abstract LockResourceEntity createLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)
qnameNamespaceId - the namespace entity IDqnameLocalName - the lock localnameprotected abstract LockEntity getLock(java.lang.Long id)
id - the lock instance IDprotected abstract LockEntity getLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId)
sharedResourceId - the shared lock resource IDexclusiveResourceId - the exclusive lock resource IDprotected abstract java.util.List getLocksBySharedResourceIds(java.util.List sharedLockResourceIds)
lockResourceIds - a list of shared resource IDs for which to retrieve the current locksprotected abstract LockEntity createLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId, java.lang.String lockToken, long timeToLive)
sharedResourceId - the specific resource to lockexclusiveResourceId - the exclusive lock that is being soughtlockToken - the lock token to assigntimeToLive - the time, in milliseconds, for the lock to remain validorg.springframework.dao.ConcurrencyFailureException - if the lock was already taken at the time of creationprotected abstract LockEntity updateLock(LockEntity lockEntity, java.lang.String lockToken, long timeToLive)
lockEntity - the specific lock to updatelockApplicant - the new lock tokentimeToLive - the new lock time, in milliseconds, for the lock to remain validorg.springframework.dao.ConcurrencyFailureException - if the entity was not updatedprotected abstract int updateLocks(java.lang.Long exclusiveLockResourceId,
java.lang.String oldLockToken,
java.lang.String newLockToken,
long timeToLive)
exclusiveLockResourceId - the exclusive resource ID being locksoldLockToken - the lock token to change fromnewLockToken - the new lock tokentimeToLive - the new time to live (in milliseconds)protected java.util.List splitLockQName(org.alfresco.service.namespace.QName lockQName)
lockQName - the lock name to split into it's higher-level pathsCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.