Search in sources :

Example 1 with DefaultNotificationServiceImpl

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();
    }
}
Also used : ProvisionException(com.google.inject.ProvisionException) DefaultNotificationServiceImpl(com.netflix.metacat.main.services.notifications.DefaultNotificationServiceImpl) AmazonSNSClient(com.amazonaws.services.sns.AmazonSNSClient)

Aggregations

AmazonSNSClient (com.amazonaws.services.sns.AmazonSNSClient)1 ProvisionException (com.google.inject.ProvisionException)1 DefaultNotificationServiceImpl (com.netflix.metacat.main.services.notifications.DefaultNotificationServiceImpl)1