Class LockDAOImpl
java.lang.Object
org.alfresco.repo.domain.locks.AbstractLockDAOImpl
org.alfresco.repo.domain.locks.ibatis.LockDAOImpl
- All Implemented Interfaces:
LockDAO
iBatis-specific implementation of the Locks DAO.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LockEntitycreateLock(Long sharedResourceId, Long exclusiveResourceId, String lockToken, long timeToLive) Create a new lock.protected LockResourceEntitycreateLockResource(Long qnameNamespaceId, String qnameLocalName) Create a unique lock resourceprotected LockEntityprotected LockEntityprotected LockResourceEntitygetLockResource(Long qnameNamespaceId, String qnameLocalName) Override to get the unique, lock resource entity if one exists.protected List<LockEntity>getLocksBySharedResourceIds(List<Long> sharedLockResourceIds) Get any existing lock data for the shared resources.final voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate) protected LockEntityupdateLock(LockEntity lockEntity, String lockToken, long timeToLive) Update an existing lockprotected intupdateLocks(Long exclusiveLockResourceId, String oldLockToken, String newLockToken, long timeToLive) Methods inherited from class org.alfresco.repo.domain.locks.AbstractLockDAOImpl
getLock, getQNameDAO, refreshLock, releaseLock, setQnameDAO, splitLockQName
-
Constructor Details
-
LockDAOImpl
public LockDAOImpl()
-
-
Method Details
-
setSqlSessionTemplate
public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate) -
getLockResource
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
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
-
getLock
- Specified by:
getLockin classAbstractLockDAOImpl- Parameters:
id- the lock instance ID- Returns:
- Returns the lock, if it exists, otherwise null
-
getLock
- 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(Long sharedResourceId, Long exclusiveResourceId, 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
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(Long exclusiveLockResourceId, String oldLockToken, 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
-