Search in sources :

Example 1 with NotifierType

use of fish.payara.nucleus.notification.configuration.NotifierType in project Payara by payara.

the class NotificationService method bootstrapNotificationService.

public void bootstrapNotificationService() {
    if (configuration != null) {
        executionOptions = new NotificationExecutionOptions();
        executionOptions.setEnabled(Boolean.parseBoolean(configuration.getEnabled()));
        for (NotifierConfiguration notifierConfiguration : configuration.getNotifierConfigurationList()) {
            NotifierType type = null;
            try {
                ConfigView view = ConfigSupport.getImpl(notifierConfiguration);
                NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
                type = annotation.type();
                executionOptions.addNotifierConfigurationExecutionOption(factoryStore.get(type).build(notifierConfiguration));
            } catch (UnsupportedEncodingException e) {
                logger.log(Level.SEVERE, "Notifier configuration with type " + type + " cannot be configured due to encoding problems in configuration parameters", e);
            }
        }
        if (executionOptions.isEnabled()) {
            logger.info("Payara Notification Service bootstrapped with configuration: " + executionOptions);
        }
    }
}
Also used : NotifierType(fish.payara.nucleus.notification.configuration.NotifierType) NotifierConfigurationType(fish.payara.nucleus.notification.configuration.NotifierConfigurationType) UnsupportedEncodingException(java.io.UnsupportedEncodingException) NotifierConfiguration(fish.payara.nucleus.notification.configuration.NotifierConfiguration) LogNotifierConfiguration(fish.payara.nucleus.notification.log.LogNotifierConfiguration) NotificationExecutionOptions(fish.payara.nucleus.notification.domain.NotificationExecutionOptions)

Aggregations

NotifierConfiguration (fish.payara.nucleus.notification.configuration.NotifierConfiguration)1 NotifierConfigurationType (fish.payara.nucleus.notification.configuration.NotifierConfigurationType)1 NotifierType (fish.payara.nucleus.notification.configuration.NotifierType)1 NotificationExecutionOptions (fish.payara.nucleus.notification.domain.NotificationExecutionOptions)1 LogNotifierConfiguration (fish.payara.nucleus.notification.log.LogNotifierConfiguration)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1