public class ClusterLockDAOHibernate extends HibernateDao
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSourcesessionFactory| 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
#load(long) 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.
|
createHibernateQuery, findByProperties, findByProperties, load, load, loadOptional, loadOptional, loadReference, loadReference, remove, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, updatesetSessionFactory, withStatelessSessionpublic Class<ClusterLockEntity> getPersistentClass()
HibernateDao#load(long) to work correctly.getPersistentClass in class HibernateDaopublic 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.