Class SnsEventHandler

java.lang.Object
io.quarkus.funqy.lambda.event.sns.SnsEventHandler
All Implemented Interfaces:
EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>

public class SnsEventHandler extends Object implements EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
  • Constructor Details

    • SnsEventHandler

      public SnsEventHandler()
  • Method Details

    • streamEvent

      public Stream<com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord> streamEvent(com.amazonaws.services.lambda.runtime.events.SNSEvent event, FunqyAmazonConfig amazonConfig)
      Description copied from interface: EventHandler
      Provides all messages from the event. Specially for events with multiple messages from a batch.
      Specified by:
      streamEvent in interface EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
      Parameters:
      event - event to provide messages from
      amazonConfig - config
      Returns:
      a stream of messages
    • getIdentifier

      public String getIdentifier(com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord message, FunqyAmazonConfig amazonConfig)
      Description copied from interface: EventHandler
      Get the identifier of a message.
      Specified by:
      getIdentifier in interface EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
      Parameters:
      message - message to extract the identifier from
      amazonConfig - config
      Returns:
      the identifier
    • getBody

      public Supplier<InputStream> getBody(com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord message, FunqyAmazonConfig amazonConfig)
      Description copied from interface: EventHandler
      Get the body of a message as an InputStream
      Specified by:
      getBody in interface EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
      Parameters:
      message - message to extract the body from
      amazonConfig - config
      Returns:
      the body input stream
    • createResponse

      public Void createResponse(List<String> failures, FunqyAmazonConfig amazonConfig)
      Description copied from interface: EventHandler
      Create the response based on the collected failures.
      Specified by:
      createResponse in interface EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
      Parameters:
      failures - a list of message identifier, which failed
      amazonConfig - config
      Returns:
      the created response
    • getMessageClass

      public Class<com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord> getMessageClass()
      Description copied from interface: EventHandler
      The class of the message
      Specified by:
      getMessageClass in interface EventHandler<com.amazonaws.services.lambda.runtime.events.SNSEvent,com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord,Void>
      Returns:
      the class of the message