com.atlassian.beehive.spi
Interface ClusterNodeHeartBeatDao


public interface ClusterNodeHeartBeatDao

Clustered applications need to implement this DAO in order to be able to use the DatabaseClusterLockService.


Method Summary
 Collection<String> findNodesWithHeartbeatsAfter(long time)
           
 Long getLastHeartbeatTime(String nodeId)
          Returns the last time a heartbeat was sent by the given node.
 String getNodeId()
          Returns the globally unique Identifier for this cluster node.
 void writeHeartBeat(long time)
          Writes a heartbeat for this node at the given time.
 

Method Detail

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)


Copyright © 2014 Atlassian. All Rights Reserved.