Interface RouteProviderContextHandlerInterface
- All Known Implementing Classes:
DefaultRouteProviderContextHandler
public interface RouteProviderContextHandlerInterface
Interface for bidirectional mapping between Javalin HTTP context and QQQ process execution.
This interface defines how HTTP requests are translated into process inputs
and how process outputs are translated back into HTTP responses for
ProcessBasedRouter routes.
Implementations handle:
- Request mapping: Extract data from HTTP request (params, headers, body)
and populate RunProcessInput for the process to consume
- Response mapping: Extract data from RunProcessOutput and construct
HTTP response (status, headers, body)
The default implementation (DefaultRouteProviderContextHandler) handles
common cases like form parameters, JSON bodies, and string/byte responses.
Custom implementations can support specialized content types, file uploads,
streaming responses, or custom authentication flows.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleRequest(io.javalin.http.Context context, RunProcessInput runProcessInput) Map HTTP request data into process input.booleanhandleResponse(io.javalin.http.Context context, RunProcessOutput runProcessOutput) Map process output into HTTP response.
-
Method Details
-
handleRequest
Map HTTP request data into process input. Extract relevant data from the Javalin context (path, method, parameters, headers, body) and populate the RunProcessInput so the process can access it.- Parameters:
context- the Javalin HTTP contextrunProcessInput- the process input to populate with request data
-
handleResponse
boolean handleResponse(io.javalin.http.Context context, RunProcessOutput runProcessOutput) throws QException Map process output into HTTP response. Extract response data from the RunProcessOutput (status code, headers, body) and write it to the Javalin context to construct the HTTP response.- Parameters:
context- the Javalin HTTP contextrunProcessOutput- the process output containing response data- Returns:
- true if the response was handled; false otherwise
- Throws:
QException- if response processing fails
-