public class JerseyAwsProxyRequestReader extends RequestReader<AwsProxyRequest,org.glassfish.jersey.server.ContainerRequest>
RequestReader object. This object reads an incoming AwsProxyRequest
event and transform it into a Jersey ContainerRequest object. The object sets three custom properties in the
request's PropertiesDelegate object: The API Gateway request context, the Map of stage variables, and the
Lambda context object.
The useStageAsBasePath configuration variable lets you set whether the stage name should be included in the
request path passed to the Jersey application handler.API_GATEWAY_CONTEXT_PROPERTY, API_GATEWAY_STAGE_VARS_PROPERTY, LAMBDA_CONTEXT_PROPERTY| Constructor and Description |
|---|
JerseyAwsProxyRequestReader() |
| Modifier and Type | Method and Description |
|---|---|
static com.amazonaws.services.lambda.runtime.Context |
getCurrentLambdaContext() |
static AwsProxyRequest |
getCurrentRequest() |
protected java.lang.Class<? extends AwsProxyRequest> |
getRequestClass() |
org.glassfish.jersey.server.ContainerRequest |
readRequest(AwsProxyRequest request,
javax.ws.rs.core.SecurityContext securityContext,
com.amazonaws.services.lambda.runtime.Context lambdaContext,
ContainerConfig config)
Reads an request object generated by an AWS_PROXY integration in API Gateway and transforms it into a Jersey
ContainerRequest object. |
stripBasePathpublic org.glassfish.jersey.server.ContainerRequest readRequest(AwsProxyRequest request, javax.ws.rs.core.SecurityContext securityContext, com.amazonaws.services.lambda.runtime.Context lambdaContext, ContainerConfig config) throws InvalidRequestEventException
ContainerRequest object.readRequest in class RequestReader<AwsProxyRequest,org.glassfish.jersey.server.ContainerRequest>request - The incoming request objectsecurityContext - A jax-rs SecurityContext object (@see com.amazonaws.serverless.proxy.internal.SecurityContextWriter)lambdaContext - The AWS Lambda context for the requestconfig - The container config object, this is passed in by the LambdaContainerHandlerInvalidRequestEventException - When the method fails to parse the incoming requestprotected java.lang.Class<? extends AwsProxyRequest> getRequestClass()
getRequestClass in class RequestReader<AwsProxyRequest,org.glassfish.jersey.server.ContainerRequest>public static AwsProxyRequest getCurrentRequest()
public static com.amazonaws.services.lambda.runtime.Context getCurrentLambdaContext()
Copyright © 2017. All Rights Reserved.