use of fish.payara.nucleus.notification.domain.NotificationExecutionOptions 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);
}
}
}
use of fish.payara.nucleus.notification.domain.NotificationExecutionOptions in project Payara by payara.
the class NotificationExecutionOptionsTest method logNotifierConfigurationExecutionOptionEnabledSuccessfully.
@Test
public void logNotifierConfigurationExecutionOptionEnabledSuccessfully() {
NotificationExecutionOptions executionOptions = new NotificationExecutionOptions();
LogNotifierConfigurationExecutionOptions logExecOptions = new LogNotifierConfigurationExecutionOptions();
logExecOptions.setEnabled(true);
executionOptions.addNotifierConfigurationExecutionOption(logExecOptions);
assertNotNull(executionOptions.getNotifierConfigurationExecutionOptionsList());
assertThat(executionOptions.isNotifierServiceEnabled(LOG), is(true));
}
Aggregations