Package org.apache.juneau.rest.server
Class RequestIdSettings.Builder
java.lang.Object
org.apache.juneau.rest.server.RequestIdSettings.Builder
- Enclosing class:
- RequestIdSettings
Builder for
RequestIdSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattributeKey(String value) Overrides the servlet-request attribute key under which the resolved id is stashed.build()Builds the settings.idSupplier(Supplier<String> value) Sets the supplier used to mint a new id when none is honored from the request.Sets the predicate applied to a sanitized incomingX-Request-Idvalue.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
validator
Sets the predicate applied to a sanitized incomingX-Request-Idvalue.Defaults to accept-all (sanitize-and-accept): any candidate that survives sanitization within
RequestIdConstants.MAX_LENis 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 benull .- 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 benull 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 benull .- Returns:
- This object.
-
build
Builds the settings.- Returns:
- A new
RequestIdSettings.
-