Class ProcessBasedRouter

java.lang.Object
com.kingsrook.qqq.middleware.javalin.routeproviders.ProcessBasedRouter
All Implemented Interfaces:
QJavalinRouteProviderInterface

public class ProcessBasedRouter extends Object implements QJavalinRouteProviderInterface
Route provider that executes QQQ processes in response to HTTP requests. This provider bridges Javalin HTTP routes to QQQ's process execution engine, allowing processes to be exposed as REST endpoints. Request data (path params, query params, body, headers) is passed into the process via ProcessBasedRouterPayload, and process output is used to construct the HTTP response. Supports: - Multiple HTTP methods (GET, POST, PUT, DELETE, etc.) - Custom authentication via RouteAuthenticatorInterface - Custom request/response handling via RouteProviderContextHandlerInterface - Path parameters, query parameters, form data, and request bodies Usage Example:
 new ProcessBasedRouter("/api/orders/{orderId}", "processOrderRequest")
    .withRouteAuthenticator(new QCodeReference(ApiAuthenticator.class))
    .withMethods(List.of("GET", "POST"))
 
  • Constructor Details

    • ProcessBasedRouter

      public ProcessBasedRouter(String hostedPath, String processName)
      Constructor for process-based route with default GET method.
      Parameters:
      hostedPath - the URL path where this route will be hosted
      processName - the name of the QQQ process to execute
    • ProcessBasedRouter

      public ProcessBasedRouter(JavalinRouteProviderMetaData routeProvider)
      Constructor that builds router from meta-data configuration.
      Parameters:
      routeProvider - meta-data containing route configuration
    • ProcessBasedRouter

      public ProcessBasedRouter(String hostedPath, String processName, List<String> methods)
      Constructor for process-based route with specified HTTP methods.
      Parameters:
      hostedPath - the URL path where this route will be hosted (e.g., "/api/orders/{id}")
      processName - the name of the QQQ process to execute for this route
      methods - list of HTTP methods to support (GET, POST, PUT, DELETE, PATCH); defaults to GET if null
  • Method Details