Class RequestIdSettings.Builder

java.lang.Object
org.apache.juneau.rest.server.RequestIdSettings.Builder
Enclosing class:
RequestIdSettings

public static class RequestIdSettings.Builder extends Object
Builder for RequestIdSettings.
  • Constructor Details

    • Builder

      protected Builder()
      Constructor.
  • Method Details

    • validator

      Sets the predicate applied to a sanitized incoming X-Request-Id value.

      Defaults to accept-all (sanitize-and-accept): any candidate that survives sanitization within RequestIdConstants.MAX_LEN is honored. Supply a stricter predicate to reject-and-remint values that do not match a required shape.

      Parameters:
      value - The predicate, tested against the sanitized candidate. Must not be null.
      Returns:
      This object.
    • attributeKey

      Overrides the servlet-request attribute key under which the resolved id is stashed.

      Defaults to "requestId". Override only when coexisting with a third-party filter that publishes the id under a different key.

      Parameters:
      value - The attribute key. Must not be null or blank.
      Returns:
      This object.
    • idSupplier

      Sets the supplier used to mint a new id when none is honored from the request.

      Defaults to a time-ordered RFC 9562 version-7 UUID. Swap in a smaller / shorter id scheme when payload size matters.

      Parameters:
      value - The supplier. Must not be null.
      Returns:
      This object.
    • build

      Builds the settings.
      Returns:
      A new RequestIdSettings.