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 Details

    • LockDAOImpl

      public LockDAOImpl()
  • Method Details

    • setSqlSessionTemplate

      public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
    • getLockResource

      protected LockResourceEntity getLockResource(Long qnameNamespaceId, String qnameLocalName)
      Description copied from class: AbstractLockDAOImpl
      Override to get the unique, lock resource entity if one exists.
      Specified by:
      getLockResource in class AbstractLockDAOImpl
      Parameters:
      qnameNamespaceId - the namespace entity ID
      qnameLocalName - the lock localname
      Returns:
      Returns the lock resource entity, or null if it doesn't exist
    • createLockResource

      protected LockResourceEntity createLockResource(Long qnameNamespaceId, String qnameLocalName)
      Description copied from class: AbstractLockDAOImpl
      Create a unique lock resource
      Specified by:
      createLockResource in class AbstractLockDAOImpl
      Parameters:
      qnameNamespaceId - the namespace entity ID
      qnameLocalName - the lock localname
      Returns:
      Returns the newly created lock resource entity
    • getLocksBySharedResourceIds

      protected List<LockEntity> getLocksBySharedResourceIds(List<Long> sharedLockResourceIds)
      Description copied from class: AbstractLockDAOImpl
      Get any existing lock data for the shared resources. The locks returned are not filtered and may be expired.
      Specified by:
      getLocksBySharedResourceIds in class AbstractLockDAOImpl
      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(Long id)
      Specified by:
      getLock in class AbstractLockDAOImpl
      Parameters:
      id - the lock instance ID
      Returns:
      Returns the lock, if it exists, otherwise null
    • getLock

      protected LockEntity getLock(Long sharedResourceId, Long exclusiveResourceId)
      Specified by:
      getLock in class AbstractLockDAOImpl
      Parameters:
      sharedResourceId - the shared lock resource ID
      exclusiveResourceId - 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: AbstractLockDAOImpl
      Create a new lock.
      Specified by:
      createLock in class AbstractLockDAOImpl
      Parameters:
      sharedResourceId - the specific resource to lock
      exclusiveResourceId - the exclusive lock that is being sought
      lockToken - the lock token to assign
      timeToLive - the time, in milliseconds, for the lock to remain valid
      Returns:
      Returns the new lock
    • updateLock

      protected LockEntity updateLock(LockEntity lockEntity, String lockToken, long timeToLive)
      Description copied from class: AbstractLockDAOImpl
      Update an existing lock
      Specified by:
      updateLock in class AbstractLockDAOImpl
      Parameters:
      lockEntity - the specific lock to update
      lockToken - the new lock token
      timeToLive - 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:
      updateLocks in class AbstractLockDAOImpl
      Parameters:
      exclusiveLockResourceId - the exclusive resource ID being locks
      oldLockToken - the lock token to change from
      newLockToken - the new lock token
      timeToLive - the new time to live (in milliseconds)
      Returns:
      the number of rows updated