public class

DefaultClusterNodes

extends Object
implements ClusterNodes
java.lang.Object
   ↳ com.atlassian.jira.cluster.DefaultClusterNodes

Summary

Public Constructors
DefaultClusterNodes(ClusterNodeProperties clusterNodeProperties, OfBizClusterNodeStore ofBizClusterNodeStore)
Public Methods
Set<Node> all()
Returns all the known nodes in a JIRA cluster.
Node current()
Returns the current cluster node in JIRA.
String getHostname()
Returns the IP/hostname configured to be used for this JIRA Cluster.
void reset()
Resets the cached reference to the current cluster node.
Protected Methods
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
Long getCacheListenerPort()
boolean stateHasChanged(Node node)
We validate if the state of the node has changed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.cluster.ClusterNodes

Public Constructors

public DefaultClusterNodes (ClusterNodeProperties clusterNodeProperties, OfBizClusterNodeStore ofBizClusterNodeStore)

Public Methods

public Set<Node> all ()

Returns all the known nodes in a JIRA cluster. If not clustered this will return an empty set.

Returns
  • a collection of Nodes in a cluster.

public Node current ()

Returns the current cluster node in JIRA.

Returns
  • a non-null instance; call isClustered() to see if it's part of a cluster.

public 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.

public void reset ()

Resets the cached reference to the current cluster node.

Protected Methods

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

Returns
  • the ip/hostname

protected Long getCacheListenerPort ()

protected boolean stateHasChanged (Node node)

We validate if the state of the node has changed.

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

Parameters
node the node
Returns
  • true if the state has changed, false if not