|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.domain.locks.AbstractLockDAOImpl
public abstract class AbstractLockDAOImpl
Abstract implementation of the Locks DAO.
Constructor Summary | |
---|---|
AbstractLockDAOImpl()
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractLockDAOImpl()
Method Detail |
---|
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)
LockDAO
A lock can be re-taken if it has expired and if the lock token has not changed
getLock
in interface LockDAO
lockQName
- the unique name of the lock to acquirelockToken
- the potential lock token (max 36 chars)timeToLive
- the time (in milliseconds) that the lock must remainpublic void refreshLock(org.alfresco.service.namespace.QName lockQName, java.lang.String lockToken, long timeToLive)
LockDAO
refreshLock
in interface LockDAO
lockQName
- 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)
LockDAO
Note: Failure to release a lock due to a exception condition is dealt with by passing the exception out.
releaseLock
in interface LockDAO
lockQName
- 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 localname
protected abstract LockResourceEntity createLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)
qnameNamespaceId
- the namespace entity IDqnameLocalName
- the lock localname
protected abstract LockEntity getLock(java.lang.Long id)
id
- the lock instance ID
protected abstract LockEntity getLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId)
sharedResourceId
- the shared lock resource IDexclusiveResourceId
- the exclusive lock resource ID
protected abstract java.util.List getLocksBySharedResourceIds(java.util.List sharedLockResourceIds)
lockResourceIds
- a list of shared resource IDs for which to retrieve the current locks
protected 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 valid
org.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 valid
org.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 paths
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |