Search in sources :

Example 1 with ApiGatewayRequestHandler

use of com.formkiq.lambda.apigateway.ApiGatewayRequestHandler in project formkiq-core by formkiq.

the class CoreRequestHandler method findRequestHandler.

@Override
@SuppressWarnings("returncount")
public ApiGatewayRequestHandler findRequestHandler(final String method, final String resource) throws NotFoundException {
    String s = "options".equals(method) ? method : resource;
    if (isEnablePublicUrls && "/public/documents".equals(s)) {
        return new PublicDocumentsRequestHandler();
    }
    if (s.startsWith("/public/webhooks")) {
        return new PublicWebhooksRequestHandler();
    }
    if (s.startsWith("/private/webhooks")) {
        return new PrivateWebhooksRequestHandler();
    }
    ApiGatewayRequestHandler hander = URL_MAP.get(s);
    if (hander != null) {
        return hander;
    }
    throw new NotFoundException(resource + " not found");
}
Also used : ApiGatewayRequestHandler(com.formkiq.lambda.apigateway.ApiGatewayRequestHandler) PrivateWebhooksRequestHandler(com.formkiq.stacks.api.handler.PrivateWebhooksRequestHandler) NotFoundException(com.formkiq.lambda.apigateway.exception.NotFoundException) PublicWebhooksRequestHandler(com.formkiq.stacks.api.handler.PublicWebhooksRequestHandler) PublicDocumentsRequestHandler(com.formkiq.stacks.api.handler.PublicDocumentsRequestHandler)

Aggregations

ApiGatewayRequestHandler (com.formkiq.lambda.apigateway.ApiGatewayRequestHandler)1 NotFoundException (com.formkiq.lambda.apigateway.exception.NotFoundException)1 PrivateWebhooksRequestHandler (com.formkiq.stacks.api.handler.PrivateWebhooksRequestHandler)1 PublicDocumentsRequestHandler (com.formkiq.stacks.api.handler.PublicDocumentsRequestHandler)1 PublicWebhooksRequestHandler (com.formkiq.stacks.api.handler.PublicWebhooksRequestHandler)1