Interface CKRequestHandler


public interface CKRequestHandler
Handles request lifecycle events for an active inbound request.

Obtain an instance via CKRequestProvider.startAndGet(String, Map). Call updateRoute(String) once the final HTTP route is resolved, and onEnd(int) exactly once when the response status is known. Any headers returned by these methods must be included in the outgoing response.

  • Method Summary

    Modifier and Type
    Method
    Description
    onEnd(int httpStatusCode)
    Completes the request lifecycle with the final HTTP status code.
    updateRoute(String httpRoute)
    Updates route information for the active request lifecycle.
  • Method Details

    • updateRoute

      Map<String,String> updateRoute(String httpRoute)
      Updates route information for the active request lifecycle.

      Call this when the normalized or final route becomes available after request start. Returns headers that should be included in the outgoing response.

      Parameters:
      httpRoute - normalized route value such as /users/{id}
      Returns:
      response headers to apply before sending the response
    • onEnd

      Map<String,String> onEnd(int httpStatusCode)
      Completes the request lifecycle with the final HTTP status code.

      Call this once when response handling is complete. Returns final headers that should be included in the outgoing response.

      Parameters:
      httpStatusCode - HTTP response status code
      Returns:
      response headers to apply before sending the response