org.sakaiproject.component.legacy.content
Class LockManagerImpl

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.component.legacy.content.LockManagerImpl
All Implemented Interfaces:
InitializingBean, LockManager

public class LockManagerImpl
extends HibernateDaoSupport
implements LockManager


Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
LockManagerImpl()
           
 
Method Summary
protected  Lock findLock(String assetId, String qualifierId)
           
protected  Lock findOrCreateLock(String assetId, String qualifierId, boolean expected)
           
 Collection getLocks(String assetId)
           
protected  Collection getQualifierLocks(String qualifier)
           
 boolean isLocked(String assetId)
           
 void lockObject(String assetId, String qualifierId, String reason, boolean system)
           
protected  Date now()
           
 void removeAllLocks(String qualifier)
           
 void removeLock(String assetId, String qualifierId)
           
protected  Object safePopList(List list)
           
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

LockManagerImpl

public LockManagerImpl()
Method Detail

lockObject

public void lockObject(String assetId,
                       String qualifierId,
                       String reason,
                       boolean system)
Specified by:
lockObject in interface LockManager

removeLock

public void removeLock(String assetId,
                       String qualifierId)
Specified by:
removeLock in interface LockManager

findLock

protected Lock findLock(String assetId,
                        String qualifierId)

findOrCreateLock

protected Lock findOrCreateLock(String assetId,
                                String qualifierId,
                                boolean expected)

safePopList

protected Object safePopList(List list)

now

protected Date now()

getLocks

public Collection getLocks(String assetId)
Specified by:
getLocks in interface LockManager
Returns:
- a non-empty Collection of active Locks, or null

isLocked

public boolean isLocked(String assetId)
Specified by:
isLocked in interface LockManager

removeAllLocks

public void removeAllLocks(String qualifier)
Specified by:
removeAllLocks in interface LockManager

getQualifierLocks

protected Collection getQualifierLocks(String qualifier)