Class CosmosAdditionalHeaderName

java.lang.Object
com.azure.cosmos.models.CosmosAdditionalHeaderName

public final class CosmosAdditionalHeaderName extends Object
Defines the set of additional headers that can be set on a CosmosClientBuilder via CosmosClientBuilder.additionalHeaders(java.util.Map).

Only headers with RNTBD encoding support are included, ensuring consistent behavior across both Gateway mode (HTTP) and Direct mode (RNTBD binary protocol).

This class uses the non-exhaustive final class pattern (rather than Java enum) for binary compatibility when new header names are added in future releases. See Azure SDK Java Guidelines - Enumerations.

  • Field Details

    • WORKLOAD_ID

      public static final CosmosAdditionalHeaderName WORKLOAD_ID
      The workload ID header (x-ms-cosmos-workload-id).

      Valid values: a string representation of an integer (e.g., "15"). The service accepts values in the range 1-50 for Azure Monitor metrics attribution. The SDK validates that the value is a valid integer but does not enforce range limits - range validation is the backend's responsibility.

  • Method Details

    • getHeaderName

      public String getHeaderName()
      Gets the canonical HTTP header name string (e.g., "x-ms-cosmos-workload-id").
      Returns:
      the header name string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object