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 |
|---|---|
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)
Reads an request object generated by an AWS_PROXY integration in API Gateway and transforms it into a Jersey
ContainerRequest object. |
void |
setUseStageAsBasePath(boolean useStageAsBasePath)
Sets whether the stage name should be used as base path for the Jersey request.
|
public org.glassfish.jersey.server.ContainerRequest readRequest(AwsProxyRequest request, javax.ws.rs.core.SecurityContext securityContext, com.amazonaws.services.lambda.runtime.Context lambdaContext) 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 requestInvalidRequestEventException - When the method fails to parse the incoming requestpublic void setUseStageAsBasePath(boolean useStageAsBasePath)
falseuseStageAsBasePath - True if the stage name should be included in the request path, false otherwiseprotected java.lang.Class<? extends AwsProxyRequest> getRequestClass()
getRequestClass in class RequestReader<AwsProxyRequest,org.glassfish.jersey.server.ContainerRequest>Copyright © 2017. All Rights Reserved.