Class ClusterInfo

java.lang.Object
com.groiss.cluster.ClusterInfo

public class ClusterInfo extends Object
This class can be used to acquire cluster specific data.
  • 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

      public static String getMyNodeId()
      Gets the id of this node.
      Returns:
      The id of this node, or null if the system is not clustered.