Class LockDAOImpl
- java.lang.Object
-
- org.alfresco.repo.domain.locks.AbstractLockDAOImpl
-
- org.alfresco.repo.domain.locks.ibatis.LockDAOImpl
-
- All Implemented Interfaces:
LockDAO
public class LockDAOImpl extends AbstractLockDAOImpl
iBatis-specific implementation of the Locks DAO.- Since:
- 3.2
- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description LockDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LockEntitycreateLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId, java.lang.String lockToken, long timeToLive)Create a new lock.protected LockResourceEntitycreateLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)Create a unique lock resourceprotected LockEntitygetLock(java.lang.Long id)protected LockEntitygetLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId)protected LockResourceEntitygetLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)Override to get the unique, lock resource entity if one exists.protected java.util.List<LockEntity>getLocksBySharedResourceIds(java.util.List<java.lang.Long> sharedLockResourceIds)Get any existing lock data for the shared resources.voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)protected LockEntityupdateLock(LockEntity lockEntity, java.lang.String lockToken, long timeToLive)Update an existing lockprotected intupdateLocks(java.lang.Long exclusiveLockResourceId, java.lang.String oldLockToken, java.lang.String newLockToken, long timeToLive)-
Methods inherited from class org.alfresco.repo.domain.locks.AbstractLockDAOImpl
getLock, getQNameDAO, refreshLock, releaseLock, setQnameDAO, splitLockQName
-
-
-
-
Method Detail
-
setSqlSessionTemplate
public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
-
getLockResource
protected LockResourceEntity getLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)
Description copied from class:AbstractLockDAOImplOverride to get the unique, lock resource entity if one exists.- Specified by:
getLockResourcein classAbstractLockDAOImpl- Parameters:
qnameNamespaceId- the namespace entity IDqnameLocalName- the lock localname- Returns:
- Returns the lock resource entity, or null if it doesn't exist
-
createLockResource
protected LockResourceEntity createLockResource(java.lang.Long qnameNamespaceId, java.lang.String qnameLocalName)
Description copied from class:AbstractLockDAOImplCreate a unique lock resource- Specified by:
createLockResourcein classAbstractLockDAOImpl- Parameters:
qnameNamespaceId- the namespace entity IDqnameLocalName- the lock localname- Returns:
- Returns the newly created lock resource entity
-
getLocksBySharedResourceIds
protected java.util.List<LockEntity> getLocksBySharedResourceIds(java.util.List<java.lang.Long> sharedLockResourceIds)
Description copied from class:AbstractLockDAOImplGet any existing lock data for the shared resources. The locks returned are not filtered and may be expired.- Specified by:
getLocksBySharedResourceIdsin classAbstractLockDAOImpl- Parameters:
sharedLockResourceIds- a list of shared resource IDs for which to retrieve the current locks- Returns:
- Returns a list of locks (expired or not) for the given lock resources
-
getLock
protected LockEntity getLock(java.lang.Long id)
- Specified by:
getLockin classAbstractLockDAOImpl- Parameters:
id- the lock instance ID- Returns:
- Returns the lock, if it exists, otherwise null
-
getLock
protected LockEntity getLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId)
- Specified by:
getLockin classAbstractLockDAOImpl- Parameters:
sharedResourceId- the shared lock resource IDexclusiveResourceId- the exclusive lock resource ID- Returns:
- Returns the lock, if it exists, otherwise null
-
createLock
protected LockEntity createLock(java.lang.Long sharedResourceId, java.lang.Long exclusiveResourceId, java.lang.String lockToken, long timeToLive)
Description copied from class:AbstractLockDAOImplCreate a new lock.- Specified by:
createLockin classAbstractLockDAOImpl- Parameters:
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- Returns:
- Returns the new lock
-
updateLock
protected LockEntity updateLock(LockEntity lockEntity, java.lang.String lockToken, long timeToLive)
Description copied from class:AbstractLockDAOImplUpdate an existing lock- Specified by:
updateLockin classAbstractLockDAOImpl- Parameters:
lockEntity- the specific lock to updatelockToken- the new lock tokentimeToLive- the new lock time, in milliseconds, for the lock to remain valid- Returns:
- Returns the updated lock
-
updateLocks
protected int updateLocks(java.lang.Long exclusiveLockResourceId, java.lang.String oldLockToken, java.lang.String newLockToken, long timeToLive)- Specified by:
updateLocksin classAbstractLockDAOImpl- Parameters:
exclusiveLockResourceId- the exclusive resource ID being locksoldLockToken- the lock token to change fromnewLockToken- the new lock tokentimeToLive- the new time to live (in milliseconds)- Returns:
- the number of rows updated
-
-