Class NoOpClusterHeartbeatManager
java.lang.Object
com.atlassian.crowd.manager.cluster.heartbeat.NoOpClusterHeartbeatManager
- All Implemented Interfaces:
ClusterNodeHeartBeatDao
,ClusterHeartbeatManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindHeartbeatsAfter
(long timestamp) findNodesWithHeartbeatsAfter
(long time) getLastHeartbeatTime
(String nodeId) Returns the last time a heartbeat was sent by the given node.Returns the globally unique Identifier for this cluster node.int
removeHeartbeatsBefore
(long timestamp) Removes the heartbeats that heven't reported live before the given timestampvoid
writeHeartBeat
(long time) Writes a heartbeat for this node at the given time.
-
Constructor Details
-
NoOpClusterHeartbeatManager
public NoOpClusterHeartbeatManager()
-
-
Method Details
-
getNodeId
Description copied from interface:ClusterNodeHeartBeatDao
Returns the globally unique Identifier for this cluster node.- Specified by:
getNodeId
in interfaceClusterNodeHeartBeatDao
- Returns:
- the globally unique Identifier for this cluster node.
-
writeHeartBeat
public void writeHeartBeat(long time) Description copied from interface:ClusterNodeHeartBeatDao
Writes a heartbeat for this node at the given time. Caller will pass the time to stamp; in production this would normally beSystem.currentTimeMillis()
.- Specified by:
writeHeartBeat
in interfaceClusterNodeHeartBeatDao
- Parameters:
time
- the time in millis to write as the heartbeat.
-
getLastHeartbeatTime
Description copied from interface:ClusterNodeHeartBeatDao
Returns the last time a heartbeat was sent by the given node.A
null
value indicates no heartbeats have been sent by this node.- Specified by:
getLastHeartbeatTime
in interfaceClusterNodeHeartBeatDao
- Parameters:
nodeId
- the node- Returns:
- the last time a heartbeat was sent by the given node.
-
findNodesWithHeartbeatsAfter
- Specified by:
findNodesWithHeartbeatsAfter
in interfaceClusterNodeHeartBeatDao
-
findHeartbeatsAfter
- Specified by:
findHeartbeatsAfter
in interfaceClusterHeartbeatManager
- Returns:
- a list of hearbeats that reported live after the given timestamp
-
removeHeartbeatsBefore
public int removeHeartbeatsBefore(long timestamp) Description copied from interface:ClusterHeartbeatManager
Removes the heartbeats that heven't reported live before the given timestamp- Specified by:
removeHeartbeatsBefore
in interfaceClusterHeartbeatManager
- Returns:
- the number of heartbeats removed
-