public class ClusterLockDAOHibernate extends HibernateDao<ClusterLockEntity>
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
ClusterLockDAOHibernate() |
Modifier and Type | Method and Description |
---|---|
void |
deleteLocksHeldByNode(String nodeId) |
ClusterLockEntity |
getLockByName(String lockName) |
Class<ClusterLockEntity> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
void |
insertEmptyClusterLock(String lockName,
long updateTime)
Attempt to insert an "unlocked" DB row for the named lock.
|
List<ClusterLockEntity> |
list() |
boolean |
tryUpdateAcquireLock(String lockName,
String nodeId,
long updateTime)
Attempt to acquire an existing named lock for the given nodeId.
|
void |
unlock(String lockName,
String nodeId,
long updateTime)
Unlock the named lock, if this node still holds the lock.
|
createDeleteQuery, createDeleteQuery, createHibernateQuery, createQuery, createQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
public Class<ClusterLockEntity> getPersistentClass()
HibernateDao
HibernateDao.load(Serializable)
to work
correctly.getPersistentClass
in class HibernateDao<ClusterLockEntity>
public ClusterLockEntity getLockByName(String lockName)
public boolean tryUpdateAcquireLock(@Nonnull String lockName, @Nonnull String nodeId, long updateTime)
lockName
- the globally unique id of the locknodeId
- This node's IDupdateTime
- the time in milliseconds that this update was writtenpublic void insertEmptyClusterLock(@Nonnull String lockName, long updateTime)
lockName
- the lock identifierupdateTime
- the time in milliseconds that this insert was writtenpublic void unlock(String lockName, String nodeId, long updateTime)
lockName
- the lock identifiernodeId
- This node's IDupdateTime
- the time in milliseconds that this update was writtenpublic List<ClusterLockEntity> list()
public void deleteLocksHeldByNode(String nodeId)
Copyright © 2019 Atlassian. All rights reserved.