Enum Class NodePreference

java.lang.Object
java.lang.Enum<NodePreference>
com.eventstore.dbclient.NodePreference
All Implemented Interfaces:
Serializable, Comparable<NodePreference>, Constable

public enum NodePreference extends Enum<NodePreference>
Indicates which order of preferred nodes for connecting to.
  • Enum Constant Details

    • LEADER

      public static final NodePreference LEADER
      When attempting connection, prefers leader nodes.
    • FOLLOWER

      public static final NodePreference FOLLOWER
      When attempting connection, prefers follower nodes.
    • READ_ONLY_REPLICA

      public static final NodePreference READ_ONLY_REPLICA
      When attempting connection, prefers read-replica nodes.
    • RANDOM

      public static final NodePreference RANDOM
      When attempting connection, has no node preference.
  • Method Details

    • values

      public static NodePreference[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NodePreference valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null