Class DefaultServletToAwsProxyResponseAdapter

java.lang.Object
io.micronaut.function.aws.proxy.test.DefaultServletToAwsProxyResponseAdapter
All Implemented Interfaces:
ServletToAwsProxyResponseAdapter

@Singleton public class DefaultServletToAwsProxyResponseAdapter extends Object implements ServletToAwsProxyResponseAdapter
DefaultImplementation of ServletToAwsProxyResponseAdapter.
Author:
Sergio del Amo
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Charset
     
    void
    handle(@NonNull io.micronaut.core.convert.ConversionService conversionService, @NonNull jakarta.servlet.http.HttpServletRequest request, @NonNull com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse awsProxyResponse, @NonNull jakarta.servlet.http.HttpServletResponse response)
    Writes the contents of a APIGatewayV2HTTPResponse to a HttpServletResponse.
    protected @io.micronaut.core.annotation.Nullable byte[]
    parseBodyAsBytes(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse awsProxyResponse)
    Returns the response's body bytes considering whether the body was Base64 encoded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultServletToAwsProxyResponseAdapter

      public DefaultServletToAwsProxyResponseAdapter()
  • Method Details

    • handle

      public void handle(@NonNull @NonNull io.micronaut.core.convert.ConversionService conversionService, @NonNull @NonNull jakarta.servlet.http.HttpServletRequest request, @NonNull @NonNull com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse awsProxyResponse, @NonNull @NonNull jakarta.servlet.http.HttpServletResponse response) throws IOException
      Description copied from interface: ServletToAwsProxyResponseAdapter
      Writes the contents of a APIGatewayV2HTTPResponse to a HttpServletResponse.
      Specified by:
      handle in interface ServletToAwsProxyResponseAdapter
      Parameters:
      conversionService - The conversion service
      request - Servlet Request
      awsProxyResponse - The AWS proxy response
      response - The Servlet Response
      Throws:
      IOException - can be thrown while writing the response
    • parseBodyAsBytes

      @Nullable protected @io.micronaut.core.annotation.Nullable byte[] parseBodyAsBytes(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse awsProxyResponse)
      Returns the response's body bytes considering whether the body was Base64 encoded.
      Parameters:
      awsProxyResponse - The response
      Returns:
      The response's body bytes.
    • getBodyCharset

      protected Charset getBodyCharset()
      Returns:
      The charset used to read the response's body bytes.