Class CKRequestProvider

java.lang.Object
ai.codekarma.CKRequestProvider

public class CKRequestProvider extends Object
Entry point for request lifecycle tracking in applications using this SDK.

Call startAndGet(...) at the start of each inbound request to obtain a CKRequestHandler. Use the handler throughout the request to report the final route and HTTP status. Any headers returned by handler methods must be forwarded in the outgoing response.

  • Constructor Details

    • CKRequestProvider

      public CKRequestProvider()
  • Method Details

    • startAndGet

      public static CKRequestHandler startAndGet(String requestMethod, Map<String,String> headers)
      Starts tracking a request lifecycle and returns a handler for subsequent updates.

      Call this once at the beginning of request handling, before any routing or business logic. Use the returned CKRequestHandler to report the resolved route and final HTTP status. Apply any headers returned by handler methods to the outgoing response.

      Parameters:
      requestMethod - HTTP method of the inbound request, such as GET or POST
      headers - inbound request headers as key-value pairs
      Returns:
      handler used to report route updates and complete the request lifecycle