Package net.officefloor.server.aws.sam
Class SamHttpResponseWriter
java.lang.Object
net.officefloor.server.aws.sam.SamHttpResponseWriter
- All Implemented Interfaces:
HttpResponseWriter<ByteBuffer>
SAM
HttpResponseWriter.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEventObtains theAPIGatewayProxyResponseEvent.voidwriteHttpResponse(HttpVersion version, HttpStatus status, WritableHttpHeader headHttpHeader, WritableHttpCookie headHttpCookie, long contentLength, HttpHeaderValue contentType, StreamBuffer<ByteBuffer> contentHeadStreamBuffer) Writes theHttpResponse.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.server.http.HttpResponseWriter
writeHttpExternalResponse
-
Constructor Details
-
SamHttpResponseWriter
Instantiate.- Parameters:
bufferPool-StreamBufferPool.
-
-
Method Details
-
getApiGatewayProxyResponseEvent
public com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent getApiGatewayProxyResponseEvent() throws RuntimeExceptionObtains theAPIGatewayProxyResponseEvent.- Returns:
APIGatewayProxyResponseEvent.- Throws:
RuntimeException- If fails to write the response.
-
writeHttpResponse
public void writeHttpResponse(HttpVersion version, HttpStatus status, WritableHttpHeader headHttpHeader, WritableHttpCookie headHttpCookie, long contentLength, HttpHeaderValue contentType, StreamBuffer<ByteBuffer> contentHeadStreamBuffer) Description copied from interface:HttpResponseWriterWrites theHttpResponse.- Specified by:
writeHttpResponsein interfaceHttpResponseWriter<ByteBuffer>- Parameters:
version-HttpVersion.status-HttpStatus.headHttpHeader- HeadWritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponse.headHttpCookie- HeadWritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponse.contentLength- Number of bytes in the HTTP entity.contentType-Content-Typeof the HTTP entity.contentHeadStreamBuffer- HeadStreamBufferto the linked list ofStreamBufferinstances containing theHttpResponseentity. May benullif no entity content.
-