Interface ClusterNodeHeartBeatDao

All Known Subinterfaces:
ClusterHeartbeatManager
All Known Implementing Classes:
CrowdClusterHeartbeatManager, NoOpClusterHeartbeatManager

public interface ClusterNodeHeartBeatDao
Clustered applications need to implement this DAO in order to be able to use the DatabaseClusterLockService.
  • Method Details

    • getNodeId

      @Nonnull String getNodeId()
      Returns the globally unique Identifier for this cluster node.
      Returns:
      the globally unique Identifier for this cluster node.
    • writeHeartBeat

      void writeHeartBeat(long time)
      Writes a heartbeat for this node at the given time. Caller will pass the time to stamp; in production this would normally be System.currentTimeMillis().
      Parameters:
      time - the time in millis to write as the heartbeat.
    • getLastHeartbeatTime

      @Nullable Long getLastHeartbeatTime(@Nonnull String nodeId)
      Returns the last time a heartbeat was sent by the given node.

      A null value indicates no heartbeats have been sent by this node.

      Parameters:
      nodeId - the node
      Returns:
      the last time a heartbeat was sent by the given node.
    • findNodesWithHeartbeatsAfter

      @Nonnull Collection<String> findNodesWithHeartbeatsAfter(long time)