Package net.officefloor.server.aws.sam
Class SamHttpResponseWriter
- java.lang.Object
-
- net.officefloor.server.aws.sam.SamHttpResponseWriter
-
- All Implemented Interfaces:
HttpResponseWriter<java.nio.ByteBuffer>
public class SamHttpResponseWriter extends java.lang.Object implements HttpResponseWriter<java.nio.ByteBuffer>
SAMHttpResponseWriter.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description SamHttpResponseWriter(StreamBufferPool<java.nio.ByteBuffer> bufferPool)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEventgetApiGatewayProxyResponseEvent()Obtains theAPIGatewayProxyResponseEvent.voidwriteHttpResponse(HttpVersion version, HttpStatus status, WritableHttpHeader headHttpHeader, WritableHttpCookie headHttpCookie, long contentLength, HttpHeaderValue contentType, StreamBuffer<java.nio.ByteBuffer> contentHeadStreamBuffer)Writes theHttpResponse.
-
-
-
Constructor Detail
-
SamHttpResponseWriter
public SamHttpResponseWriter(StreamBufferPool<java.nio.ByteBuffer> bufferPool)
Instantiate.- Parameters:
bufferPool-StreamBufferPool.
-
-
Method Detail
-
getApiGatewayProxyResponseEvent
public com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent getApiGatewayProxyResponseEvent() throws java.lang.RuntimeExceptionObtains theAPIGatewayProxyResponseEvent.- Returns:
APIGatewayProxyResponseEvent.- Throws:
java.lang.RuntimeException- If fails to write the response.
-
writeHttpResponse
public void writeHttpResponse(HttpVersion version, HttpStatus status, WritableHttpHeader headHttpHeader, WritableHttpCookie headHttpCookie, long contentLength, HttpHeaderValue contentType, StreamBuffer<java.nio.ByteBuffer> contentHeadStreamBuffer)
Description copied from interface:HttpResponseWriterWrites theHttpResponse.- Specified by:
writeHttpResponsein interfaceHttpResponseWriter<java.nio.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.
-
-