com.hazelcast.instance

## Enum NodeState

- java.lang.Object
- - java.lang.Enum<NodeState>
  - - com.hazelcast.instance.NodeState

- All Implemented Interfaces:
    Serializable, Comparable<NodeState>

      @PrivateApi
      public enum NodeState
      extends Enum<NodeState>

  Possible states of a `Node` during its lifecycle. Some actions/operations may be allowed or denied according to current state of the `Node`.
  Since:
    3.6
  See Also:
    `Node.start()`, `Node.shutdown(boolean)`, `AllowedDuringPassiveState`, `ClusterState`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ACTIVE` Initial state of the Node.
    `PASSIVE` Node can go into the `PASSIVE` when one of the following things happen: When `Node.shutdown(boolean)` is called, until the shut down process is completed.
    `SHUT_DOWN` After `Node.shutdown(boolean)` call completes, node's state will be `SHUT_DOWN`.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static NodeState` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static NodeState[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### ACTIVE

          public static final NodeState ACTIVE

      Initial state of the Node. An `ACTIVE` node is allowed to execute/process all kinds of operations. A node is in `ACTIVE` state while cluster state is one of `ClusterState.ACTIVE`, `ClusterState.NO_MIGRATION` or `ClusterState.FROZEN`.

    - #### PASSIVE

          public static final NodeState PASSIVE

      Node can go into the `PASSIVE` when one of the following things happen:
      - When `Node.shutdown(boolean)` is called, until the shut down process is completed. When the shut down process is completed, node goes into the `SHUT_DOWN` state.
      - When the cluster state moves to `ClusterState.PASSIVE` via `Cluster.changeClusterState(ClusterState)`

      In `PASSIVE` state, all operations will be rejected except operations marked as `ReadonlyOperation`, join operations of some members that are explained in `ClusterState`, replication / migration operations and heartbeat operations. Operations those are to be allowed during `PASSIVE` state should be marked as `AllowedDuringPassiveState`.

    - #### SHUT_DOWN

          public static final NodeState SHUT_DOWN

      After `Node.shutdown(boolean)` call completes, node's state will be `SHUT_DOWN`. In `SHUT_DOWN` state node will be completely inactive. All operations/invocations will be rejected. Once a node is shutdown, it cannot be restarted.

  - ### Method Detail

    - #### values

          public static NodeState[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (NodeState c : NodeState.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static NodeState valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

Copyright © 2019. All rights reserved.