public class SqsManager
extends java.lang.Object
Constructor and Description |
---|
SqsManager(AmazonSQS sqsClient,
ProcessingConfiguration config,
ExceptionHandler exceptionHandler,
ProgressReporter progressReporter,
SourceSerializer sourceSerializer)
SqsManager constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteMessageFromQueue(Message sqsMessage,
ProgressStatus progressStatus)
Delete a message from the SQS queue that you specified in the configuration file.
|
java.util.List<CloudTrailSource> |
parseMessage(java.util.List<Message> sqsMessages)
Given a list of raw SQS message parse each of them, and return a list of CloudTrailSource.
|
java.util.List<Message> |
pollQueue()
Poll SQS queue for incoming messages, filter them, and return a list of SQS Messages.
|
boolean |
shouldDeleteMessageUponFailure(boolean processSuccess)
Delete the message if the CPL failed to process the message and
ProcessingConfiguration.isDeleteMessageUponFailure()
is enabled. |
public SqsManager(AmazonSQS sqsClient, ProcessingConfiguration config, ExceptionHandler exceptionHandler, ProgressReporter progressReporter, SourceSerializer sourceSerializer)
sqsClient
- used to poll message from SQS.config
- user provided ProcessingConfiguration.exceptionHandler
- user provided exceptionHandler.progressReporter
- user provided progressReporter.sourceSerializer
- user provided SourceSerializer.public java.util.List<Message> pollQueue()
public java.util.List<CloudTrailSource> parseMessage(java.util.List<Message> sqsMessages)
sqsMessages
- list of SQS messages.public void deleteMessageFromQueue(Message sqsMessage, ProgressStatus progressStatus)
sqsMessage
- the Message
that you want to delete.progressStatus
- ProgressStatus
tracks the start and end status.public boolean shouldDeleteMessageUponFailure(boolean processSuccess)
ProcessingConfiguration.isDeleteMessageUponFailure()
is enabled.processSuccess
- Indicates whether the CPL processing is successful, such as parsing message, or
consuming the events in the CloudTrail log file.true
if the message is removable. Otherwise, false
.