Enum Class AccessMode

java.lang.Object
java.lang.Enum<AccessMode>
org.neo4j.driver.AccessMode
All Implemented Interfaces:
Serializable, Comparable<AccessMode>, Constable

public enum AccessMode extends Enum<AccessMode>
Used by Routing Driver to decide if a transaction should be routed to a write server or a read server in a cluster. When running a transaction, a write transaction requires a server that supports writes. A read transaction, on the other hand, requires a server that supports read operations. This classification is key for routing driver to route transactions to a cluster correctly.

While any AccessMode will be ignored while running transactions via a driver towards a single server. As the single server serves both read and write operations at the same time.

  • Enum Constant Details

    • READ

      public static final AccessMode READ
      Use this for transactions that requires a read server in a cluster
    • WRITE

      public static final AccessMode WRITE
      Use this for transactions that requires a write server in a cluster
  • Method Details

    • values

      public static AccessMode[] 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 AccessMode 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