Class ScanDatabaseRequest

java.lang.Object
no.unit.nva.events.models.ScanDatabaseRequest
All Implemented Interfaces:
no.unit.nva.commons.json.JsonSerializable, EventBody

public class ScanDatabaseRequest extends Object implements EventBody, no.unit.nva.commons.json.JsonSerializable
Class that can be sent as an event to a lambda handler for scanning a page of a DynamoDB table. The startMarker is a scan start marker as required by the DynamoDb client. The pageSize is the number of the results the scan will return (max 1000). The topic is the event topic that the handler is listening for events.
  • Field Details

  • Constructor Details

    • ScanDatabaseRequest

      public ScanDatabaseRequest(String topic, Integer pageSize, Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> startMarker)
  • Method Details

    • fromJson

      public static ScanDatabaseRequest fromJson(String detail) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getTopic

      public String getTopic()
      Specified by:
      getTopic in interface EventBody
    • getPageSize

      public int getPageSize()
    • getStartMarker

      public Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> getStartMarker()
    • newScanDatabaseRequest

      public ScanDatabaseRequest newScanDatabaseRequest(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> newStartMarker)
      Utility method for creating easily the next scan request.
      Parameters:
      newStartMarker - the start marker for the next scan operation.
      Returns:
      a new ScanDatabaseRequest containing the the newStartMarker
    • createNewEventEntry

      public software.amazon.awssdk.services.eventbridge.model.PutEventsRequestEntry createNewEventEntry(String eventBusName, String detailType, String invokedFunctionArn)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object