
pl.chilldev.commons.aws.sns.NotificationHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-aws Show documentation
Show all versions of commons-aws Show documentation
Helper components for working with Amazon Web Services.
// Generated by delombok at Thu Nov 16 16:28:10 UTC 2017
/**
* This file is part of the ChillDev-Commons.
*
* @license http://mit-license.org/ The MIT license
* @copyright 2017 © by Rafał Wrzeszcz - Wrzasq.pl.
*/
package pl.chilldev.commons.aws.sns;
import java.util.function.Consumer;
import com.amazonaws.services.lambda.runtime.events.SNSEvent;
/**
* SNS notifications handler.
*/
public class NotificationHandler {
/**
* Message consumer.
*/
private Consumer messageHandler;
/**
* Processes event notification.
*
* @param event Notification message.
*/
public void process(SNSEvent event) {
// SNS event for lambda always contain one record, but keep it uniform
event.getRecords().stream().map(SNSEvent.SNSRecord::getSNS).forEach(this.messageHandler);
}
@java.beans.ConstructorProperties({"messageHandler"})
@SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public NotificationHandler(final Consumer messageHandler) {
this.messageHandler = messageHandler;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy