public class ClusterHeartbeatDAOHibernate extends HibernateDao<ClusterHeartbeatEntity>
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
ClusterHeartbeatDAOHibernate() |
Modifier and Type | Method and Description |
---|---|
List<ClusterHeartbeatEntity> |
findHeartbeatsAfter(long timestamp) |
ClusterHeartbeatEntity |
getHeartbeat(String nodeId) |
Class<ClusterHeartbeatEntity> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
int |
removeHeartbeatsBefore(long timestamp) |
void |
writeHeartBeat(ClusterHeartbeatEntity heartbeatEntity)
Inserts or updates the heartbeat entity
|
String |
writeNewHeartbeat(Supplier<String> nodeIdSupplier,
String nodeName,
long timestamp)
Tries to insert a new heartbeat based on the parameters.
|
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
public Class<ClusterHeartbeatEntity> getPersistentClass()
HibernateDao
HibernateDao.load(Serializable)
to work
correctly.getPersistentClass
in class HibernateDao<ClusterHeartbeatEntity>
public String writeNewHeartbeat(Supplier<String> nodeIdSupplier, String nodeName, long timestamp) throws OperationFailedException
nodeIdSupplier
- a supplier of unique node idsnodeName
- the desired node namestimestamp
- the desired timestamp of the heartbeatOperationFailedException
- if insertion fails despite retriespublic void writeHeartBeat(ClusterHeartbeatEntity heartbeatEntity) throws org.springframework.dao.DataAccessException
org.springframework.dao.DataAccessException
@Nullable public ClusterHeartbeatEntity getHeartbeat(String nodeId)
nodeId
- the node id to find the heartbeat forpublic List<ClusterHeartbeatEntity> findHeartbeatsAfter(long timestamp)
public int removeHeartbeatsBefore(long timestamp)
Copyright © 2021 Atlassian. All rights reserved.