public class BambooClusterNodeHeartBeatRawJdbcDao extends AbstractBambooRawJdbcDao implements ClusterNodeHeartbeatBootstrapDao
Modifier and Type | Field and Description |
---|---|
static int |
NODE_ID_MAX_LENGTH |
static int |
NODE_NAME_MAX_LENGTH |
dbmsBean, hibernateConfig
Constructor and Description |
---|
BambooClusterNodeHeartBeatRawJdbcDao() |
Modifier and Type | Method and Description |
---|---|
void |
ensureNodeHeartbeatTableExists()
Creates heartbeat table if required.
|
List<BambooNodeStatus> |
findAll()
Get all heartbeats.
|
@NotNull Collection<String> |
findNodesWithHeartbeatsAfter(long time) |
@Nullable Long |
getLastHeartbeatTime(@NotNull String nodeId)
Returns the last time a heartbeat was sent by the given node.
|
@NotNull 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.
|
ensureClusterTableExists, supplierWithConnection, withDatabaseConnection
public static final int NODE_ID_MAX_LENGTH
public static final int NODE_NAME_MAX_LENGTH
public BambooClusterNodeHeartBeatRawJdbcDao()
@NotNull public @NotNull String getNodeId()
ClusterNodeHeartbeatBootstrapDao
getNodeId
in interface ClusterNodeHeartbeatBootstrapDao
public void writeHeartBeat(long time)
ClusterNodeHeartbeatBootstrapDao
System.currentTimeMillis()
.writeHeartBeat
in interface ClusterNodeHeartbeatBootstrapDao
time
- the time in millis to write as the heartbeat.@Nullable public @Nullable Long getLastHeartbeatTime(@NotNull @NotNull String nodeId)
ClusterNodeHeartbeatBootstrapDao
A null
value indicates no heartbeats have been sent by this node.
getLastHeartbeatTime
in interface ClusterNodeHeartbeatBootstrapDao
nodeId
- the node@NotNull public @NotNull Collection<String> findNodesWithHeartbeatsAfter(long time)
findNodesWithHeartbeatsAfter
in interface ClusterNodeHeartbeatBootstrapDao
public List<BambooNodeStatus> findAll()
ClusterNodeHeartbeatBootstrapDao
findAll
in interface ClusterNodeHeartbeatBootstrapDao
public void ensureNodeHeartbeatTableExists()
ClusterNodeHeartbeatBootstrapDao
ensureNodeHeartbeatTableExists
in interface ClusterNodeHeartbeatBootstrapDao
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.