NodeType (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je.rep

## Enum NodeType

- java.lang.Object
- - java.lang.Enum<NodeType>
  - - com.sleepycat.je.rep.NodeType

- All Implemented Interfaces:
    Serializable, Comparable<NodeType>

      public enum NodeType
      extends Enum<NodeType>

  The different types of nodes that can be in a replication group.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ELECTABLE` A full fledged member of the replication group with an associated replicated environment that can serve as both a Master and a Replica.
    `MONITOR` A node that passively listens for the results of elections, but does not participate in them.
    `SECONDARY` A member of the replication group with an associated replicated environment that serves as a Replica but does not participate in elections or durability decisions.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isDataNode()` Returns whether this type represents a data node, either `ELECTABLE` or `SECONDARY`.
    `boolean` | `isElectable()` Returns whether this is the `ELECTABLE` type.
    `boolean` | `isMonitor()` Returns whether this is the `MONITOR` type.
    `boolean` | `isSecondary()` Returns whether this is the `SECONDARY` type.
    `static NodeType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static NodeType[]` | `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

    - #### MONITOR

          public static final NodeType MONITOR

      A node that passively listens for the results of elections, but does not participate in them. It does not have a replicated environment associated with it.
      See Also:
        `Monitor`

    - #### ELECTABLE

          public static final NodeType ELECTABLE

      A full fledged member of the replication group with an associated replicated environment that can serve as both a Master and a Replica.

    - #### SECONDARY

          public static final NodeType SECONDARY

      A member of the replication group with an associated replicated environment that serves as a Replica but does not participate in elections or durability decisions. Secondary nodes are only remembered by the group while they maintain contact with the Master.

      You can use SECONDARY nodes to:

      - Provide a copy of the data available at a distant location
      - Maintain an extra copy of the data to increase redundancy
      - Change the number of replicas to adjust to dynamically changing read loads
      Since:
        6.0

  - ### Method Detail

    - #### values

          public static NodeType[] 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 (NodeType c : NodeType.values())
              System.out.println(c);

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

    - #### valueOf

          public static NodeType 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

    - #### isMonitor

          public boolean isMonitor()

      Returns whether this is the `MONITOR` type.
      Returns:
        whether this is `MONITOR`
      Since:
        6.0

    - #### isElectable

          public boolean isElectable()

      Returns whether this is the `ELECTABLE` type.
      Returns:
        whether this is `ELECTABLE`
      Since:
        6.0

    - #### isSecondary

          public boolean isSecondary()

      Returns whether this is the `SECONDARY` type.
      Returns:
        whether this is `SECONDARY`
      Since:
        6.0

    - #### isDataNode

          public boolean isDataNode()

      Returns whether this type represents a data node, either `ELECTABLE` or `SECONDARY`.
      Returns:
        whether this represents a data node
      Since:
        6.0

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.