Package com.groiss.cluster
Class ClusterInfo
java.lang.Object
com.groiss.cluster.ClusterInfo
This class can be used to acquire cluster specific data.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Gets the id of this node.static boolean
Determines if the system is clustered.static boolean
isMainNode
(boolean withDBCheck) Determines if this node is the main cluster node which runs the cluster timers.
-
Method Details
-
isClustered
public static boolean isClustered()Determines if the system is clustered.- Returns:
- true, if the node is part of a cluster, false otherwise.
-
isMainNode
public static boolean isMainNode(boolean withDBCheck) Determines if this node is the main cluster node which runs the cluster timers.- Parameters:
withDBCheck
- if false, the check is done in memory, if true the check is done by consulting the database.- Returns:
- true, if the system is clustered and the node is the main node.
-
getMyNodeId
Gets the id of this node.- Returns:
- The id of this node, or null if the system is not clustered.
-