Package com.atlassian.jira.cluster
Interface ClusterNodes
- All Known Implementing Classes:
DefaultClusterNodes
public interface ClusterNodes
Provides access to cluster nodes.
- Since:
- v7.1.0
-
Method Summary
Modifier and TypeMethodDescriptionall()
Returns all the known nodes in a JIRA cluster.current()
Returns the current cluster node in JIRA.Returns the IP/hostname configured to be used for this JIRA Cluster.void
moveToOffline
(@NotNull String nodeId) Update nodes's state to OFFLINE if current state is ACTIVE and nonalivevoid
removeIfOffline
(@NotNull String nodeId) Remove node from cluster if node is OFFLINEvoid
reset()
Resets the cached reference to the current cluster node.
-
Method Details
-
current
Node current()Returns the current cluster node in JIRA.- Returns:
- a non-null instance; call
Node.isClustered()
to see if it's part of a cluster.
-
reset
void reset()Resets the cached reference to the current cluster node. -
all
Returns all the known nodes in a JIRA cluster. If not clustered this will return an empty set.- Returns:
- a collection of
Node
s in a cluster.
-
node
- Returns:
Node
with given nodeID; note that this method may be eventually consistent
-
getHostname
String getHostname()Returns the IP/hostname configured to be used for this JIRA Cluster. If none is configured, localhost is returned.- Returns:
- The IP/hostname configured to be used for this JIRA Cluster.
- See Also:
-
removeIfOffline
Remove node from cluster if node is OFFLINE- Throws:
ClusterStateException
- if node is not offline or we are not able to remove node- Since:
- v8.1
-
moveToOffline
Update nodes's state to OFFLINE if current state is ACTIVE and nonalive- Throws:
ClusterStateException
- if node is alive- Since:
- v8.1
-