Package com.io7m.idstore.server.internal

# Class IdServerRequestDecoration

java.lang.Object
com.io7m.idstore.server.internal.IdServerRequestDecoration

All Implemented Interfaces:
  `EventListener`, `org.eclipse.jetty.server.HttpChannel.Listener`

public final class IdServerRequestDecoration extends Object implements org.eclipse.jetty.server.HttpChannel.Listener
A request listener that appends a probably-unique ID to every request.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdServerRequestDecoration(IdServiceDirectoryType services)`
  A request listener that appends a probably-unique ID to every request.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onRequestBegin(org.eclipse.jetty.server.Request request)`
  `static UUID`
  `requestIdFor(jakarta.servlet.http.HttpServletRequest request)`
  Get the unique ID for the given request.
  `static OffsetDateTime`
  `requestStartTimeFor(jakarta.servlet.http.HttpServletRequest request)`
  Get the unique ID for the given request.
  `static String`
  `uniqueRequestIDKey()`
  `static String`
  `uniqueRequestTimeKey()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.eclipse.jetty.server.HttpChannel.Listener

  `onAfterDispatch, onBeforeDispatch, onComplete, onDispatchFailure, onRequestContent, onRequestContentEnd, onRequestEnd, onRequestFailure, onRequestTrailers, onResponseBegin, onResponseCommit, onResponseContent, onResponseEnd, onResponseFailure`

- ## Constructor Details

  - ### IdServerRequestDecoration

    public IdServerRequestDecoration(IdServiceDirectoryType services)
    A request listener that appends a probably-unique ID to every request.
    Parameters:
      `services` - A service directory

- ## Method Details

  - ### uniqueRequestIDKey

    public static String uniqueRequestIDKey()
    Returns:
      The attribute name used to hold a unique ID

  - ### uniqueRequestTimeKey

    public static String uniqueRequestTimeKey()
    Returns:
      The attribute name used to hold a start time

  - ### requestIdFor

    public static UUID requestIdFor(jakarta.servlet.http.HttpServletRequest request)
    Get the unique ID for the given request.
    Parameters:
      `request` - The request
    Returns:
      The unique ID

  - ### requestStartTimeFor

    public static OffsetDateTime requestStartTimeFor(jakarta.servlet.http.HttpServletRequest request)
    Get the unique ID for the given request.
    Parameters:
      `request` - The request
    Returns:
      The unique ID

  - ### onRequestBegin

    public void onRequestBegin(org.eclipse.jetty.server.Request request)
    Specified by:
      `onRequestBegin` in interface `org.eclipse.jetty.server.HttpChannel.Listener`