use of com.netflix.metacat.main.services.notifications.DefaultNotificationServiceImpl in project metacat by Netflix.
the class SNSNotificationServiceImplProvider method get.
/**
* {@inheritDoc}
*/
@Override
public NotificationService get() {
if (this.config.isSnsNotificationEnabled()) {
final String tableArn = this.config.getSnsTopicTableArn();
if (StringUtils.isEmpty(tableArn)) {
throw new ProvisionException("SNS Notifications are enabled but no table ARN provided. Unable to configure.");
}
final String partitionArn = this.config.getSnsTopicPartitionArn();
if (StringUtils.isEmpty(partitionArn)) {
throw new ProvisionException("SNS Notifications are enabled but no partition ARN provided. Unable to configure.");
}
log.info("SNS notifications are enabled. Providing SNSNotificationServiceImpl implementation.");
return new SNSNotificationServiceImpl(new AmazonSNSClient(), tableArn, partitionArn, this.mapper, registry);
} else {
log.info("SNS notifications are not enabled. Ignoring and providing default implementation.");
return new DefaultNotificationServiceImpl();
}
}
Aggregations