public class DefaultClusterNodes extends Object implements ClusterNodes
| Constructor and Description |
|---|
DefaultClusterNodes(ClusterNodeProperties clusterNodeProperties,
OfBizClusterNodeStore ofBizClusterNodeStore,
BuildUtilsInfo buildUtilsInfo) |
| Modifier and Type | Method and Description |
|---|---|
Set<Node> |
all()
Returns all the known nodes in a JIRA cluster.
|
protected String |
buildHostname()
We are going to evaluate if the user set a hostname in the .properties file
if that is the case then we need to use that one all over the cluster
|
Node |
current()
Returns the current cluster node in JIRA.
|
protected Long |
getCacheListenerPort() |
String |
getHostname()
Returns the IP/hostname configured to be used for this JIRA Cluster.
|
void |
moveToOffline(String nodeId)
Update nodes's state to OFFLINE if current state is ACTIVE and nonalive
|
Node |
node(String nodeId) |
void |
removeIfOffline(String nodeId)
Remove node from cluster if node is OFFLINE
|
void |
reset()
Resets the cached reference to the current cluster node.
|
protected boolean |
stateHasChanged(Node node)
We validate if the state of the node has changed.
|
public DefaultClusterNodes(ClusterNodeProperties clusterNodeProperties, OfBizClusterNodeStore ofBizClusterNodeStore, BuildUtilsInfo buildUtilsInfo)
public Node current()
ClusterNodescurrent in interface ClusterNodesNode.isClustered() to see if it's part of a
cluster.public void reset()
ClusterNodesreset in interface ClusterNodespublic Set<Node> all()
ClusterNodesall in interface ClusterNodesNodes in a cluster.@Nullable public Node node(String nodeId)
node in interface ClusterNodesNode with given nodeID; note that this method may be eventually consistentprotected boolean stateHasChanged(Node node)
1) if the node is in offline state in the db, and we are initializing it. 2) if the node has a different IP address. 3) if the port of multicasting has changed
node - the nodeprotected Long getCacheListenerPort()
protected String buildHostname()
public String getHostname()
ClusterNodesgetHostname in interface ClusterNodesNetworkUtils.getLocalHostName()public void removeIfOffline(@NotNull
String nodeId)
throws ClusterStateException
ClusterNodesremoveIfOffline in interface ClusterNodesClusterStateException - if node is not offline or we are not able to remove nodepublic void moveToOffline(@NotNull
String nodeId)
throws ClusterStateException
ClusterNodesmoveToOffline in interface ClusterNodesClusterStateException - if node is aliveCopyright © 2002-2021 Atlassian. All Rights Reserved.