Interface ClusterNode

    • Method Detail

      • id

        ClusterNodeId id()
        Returns the universally unique identifier of this node.
        Specified by:
        id in interface ClusterNodeIdSupport
        Returns:
        Universally unique identifier of this node.
      • name

        String name()
        Returns the name of this node. Returns an empty string if this node doesn't have a configured name.

        Value of this property can be configured via HekateBootstrap.setNodeName(String) method.

        Returns:
        Name of this node or an empty string if node name is not configured.
      • isLocal

        boolean isLocal()
        Returns true if this is a local node.
        Returns:
        true if this is a local node.
        See Also:
        isRemote()
      • isRemote

        boolean isRemote()
        Returns true if this is a remote node.
        Returns:
        true if this is a remote node.
        See Also:
        isLocal()
      • runtime

        ClusterNodeRuntime runtime()
        Returns information about the JVM of this node.
        Returns:
        Information about the JVM of this node.
      • roles

        Set<String> roles()
        Returns the immutable set of roles that are configured for this node. Returns an empty set if roles are not configured for this node.

        Roles can be configured via HekateBootstrap.setRoles(List) method.

        Returns:
        Immutable set of node roles aor an empty set if roles are not configured.
      • hasRole

        boolean hasRole​(String role)
        Returns true if this node has the specified role (see roles()).
        Parameters:
        role - Role.
        Returns:
        true if this node has the specified role.
      • properties

        Map<String,​String> properties()
        Returns the immutable map of properties that are configured for this node. Returns an empty map if properties are not configured for this node.

        Properties can be configured via HekateBootstrap.setProperties(Map) method.

        Returns:
        Immutable map of node properties or an empty map if properties are not configured.
      • property

        String property​(String name)
        Returns value for the specified property name (see properties()).
        Parameters:
        name - Property name.
        Returns:
        Property value or null if there is no such property.
      • hasProperty

        boolean hasProperty​(String name)
        Returns true if this node has a property with the specified name (see properties()).
        Parameters:
        name - Property name.
        Returns:
        true if this node has a property with the specified name.
      • hasService

        boolean hasService​(Class<? extends Service> type)
        Returns true if this node has a service of the specified type.
        Parameters:
        type - Service type (must be an interface that extends Service).
        Returns:
        true if this node has a service of the specified type.
        See Also:
        services()
      • service

        ServiceInfo service​(Class<? extends Service> type)
        Returns the service information for the specified type.
        Parameters:
        type - Service type (must be an interface that extends Service).
        Returns:
        Service instance or null if there is no such service.
        See Also:
        services()
      • joinOrder

        int joinOrder()
        Returns the cluster join order. Indexing the join order begins with 1, so the first node that joins the cluster has a value of 1, the second node has a value of 2, and so on. The value of this property is initialized only when the node joins the cluster and is NOT updated if the previous (old) node leaves the cluster.

        Note that the default value for this property is 0 and it is initialized with its actual value only when the node switches to the Hekate.State.UP state.

        Returns:
        Cluster join order or 0 if node is not joined yet.