Enum ConnectionMode

java.lang.Object
java.lang.Enum<ConnectionMode>
com.azure.cosmos.ConnectionMode
All Implemented Interfaces:
Serializable, Comparable<ConnectionMode>, java.lang.constant.Constable

public enum ConnectionMode extends Enum<ConnectionMode>
Represents the connection mode to be used by the client in the Azure Cosmos DB database service.

DIRECT and GATEWAY connectivity modes are supported. DIRECT is the default.

  • Enum Constant Details

    • GATEWAY

      public static final ConnectionMode GATEWAY
      Specifies that requests to server resources are made through a gateway proxy using HTTPS.

      In GATEWAY mode, all requests are made through a gateway proxy.

    • DIRECT

      public static final ConnectionMode DIRECT
      Specifies that requests to server resources are made directly to the data nodes.

      In DIRECT mode, all requests to server resources within a container, such as items, stored procedures and user-defined functions, etc., are made directly to the data nodes within the target Cosmos DB cluster using either the HTTPS or TCP/SSL transport protocol.

      Certain operations on account or database level resources, such as databases, containers and users, etc., are always routed through the gateway using HTTPS.

  • Method Details

    • values

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

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