Search in sources :

Example 1 with LogNotifierExecutionOptions

use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.

the class MonitoringService method bootstrapNotifierList.

/**
 * Starts notifiers that are enabled with the monitoring service
 * @since 4.1.2.174
 */
public void bootstrapNotifierList() {
    notifierExecutionOptionsList = new ArrayList<>();
    if (configuration.getNotifierList() != null) {
        for (Notifier notifier : configuration.getNotifierList()) {
            ConfigView view = ConfigSupport.getImpl(notifier);
            NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
            notifierExecutionOptionsList.add(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
        }
    }
    if (notifierExecutionOptionsList.isEmpty()) {
        // Add logging execution options by default
        LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
        logNotifierExecutionOptions.setEnabled(true);
        notifierExecutionOptionsList.add(logNotifierExecutionOptions);
    }
}
Also used : NotifierConfigurationType(fish.payara.nucleus.notification.configuration.NotifierConfigurationType) ConfigView(org.jvnet.hk2.config.ConfigView) Notifier(fish.payara.nucleus.notification.configuration.Notifier) LogNotifierExecutionOptions(fish.payara.nucleus.notification.log.LogNotifierExecutionOptions)

Example 2 with LogNotifierExecutionOptions

use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.

the class LogNotificationEventFactoryMock method configureService.

@Before
public void configureService() {
    executionOptions.setEnabled(false);
    executionOptions.setSampleRate(1.0);
    executionOptions.setSampleRateFirstEnabled(false);
    executionOptions.setThresholdValue(1000L);
    executionOptions.setThresholdUnit(TimeUnit.MILLISECONDS);
    executionOptions.setHistoricTraceStoreEnabled(false);
    LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
    logNotifierExecutionOptions.setEnabled(true);
    executionOptions.getNotifierExecutionOptionsList().put(NotifierType.LOG, logNotifierExecutionOptions);
}
Also used : LogNotifierExecutionOptions(fish.payara.nucleus.notification.log.LogNotifierExecutionOptions) Before(org.junit.Before)

Example 3 with LogNotifierExecutionOptions

use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.

the class HealthCheckService method bootstrapNotifierList.

/**
 * Starts all notifiers that have been enable with the healthcheck service.
 */
public void bootstrapNotifierList() {
    notifierExecutionOptionsList = new ArrayList<>();
    if (configuration.getNotifierList() != null) {
        for (Notifier notifier : configuration.getNotifierList()) {
            ConfigView view = ConfigSupport.getImpl(notifier);
            NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
            notifierExecutionOptionsList.add(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
        }
    }
    if (notifierExecutionOptionsList.isEmpty()) {
        // Add logging execution options by default
        LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
        logNotifierExecutionOptions.setEnabled(true);
        notifierExecutionOptionsList.add(logNotifierExecutionOptions);
    }
}
Also used : NotifierConfigurationType(fish.payara.nucleus.notification.configuration.NotifierConfigurationType) LogNotifier(fish.payara.nucleus.notification.log.LogNotifier) Notifier(fish.payara.nucleus.notification.configuration.Notifier) LogNotifierExecutionOptions(fish.payara.nucleus.notification.log.LogNotifierExecutionOptions)

Example 4 with LogNotifierExecutionOptions

use of fish.payara.nucleus.notification.log.LogNotifierExecutionOptions in project Payara by payara.

the class RequestTracingService method bootstrapNotifierList.

/**
 * Configures notifiers with request tracing and starts any enabled ones.
 * If no options are set then the log notifier is automatically turned on.
 * @since 4.1.2.173
 */
public void bootstrapNotifierList() {
    executionOptions.resetNotifierExecutionOptions();
    if (configuration.getNotifierList() != null) {
        for (Notifier notifier : configuration.getNotifierList()) {
            ConfigView view = ConfigSupport.getImpl(notifier);
            NotifierConfigurationType annotation = view.getProxyType().getAnnotation(NotifierConfigurationType.class);
            executionOptions.addNotifierExecutionOption(executionOptionsFactoryStore.get(annotation.type()).build(notifier));
        }
    }
    if (executionOptions.getNotifierExecutionOptionsList().isEmpty()) {
        // Add logging execution options by default
        LogNotifierExecutionOptions logNotifierExecutionOptions = new LogNotifierExecutionOptions();
        logNotifierExecutionOptions.setEnabled(true);
        executionOptions.addNotifierExecutionOption(logNotifierExecutionOptions);
    }
}
Also used : NotifierConfigurationType(fish.payara.nucleus.notification.configuration.NotifierConfigurationType) LogNotifier(fish.payara.nucleus.notification.log.LogNotifier) Notifier(fish.payara.nucleus.notification.configuration.Notifier) LogNotifierExecutionOptions(fish.payara.nucleus.notification.log.LogNotifierExecutionOptions)

Aggregations

LogNotifierExecutionOptions (fish.payara.nucleus.notification.log.LogNotifierExecutionOptions)4 Notifier (fish.payara.nucleus.notification.configuration.Notifier)3 NotifierConfigurationType (fish.payara.nucleus.notification.configuration.NotifierConfigurationType)3 LogNotifier (fish.payara.nucleus.notification.log.LogNotifier)2 Before (org.junit.Before)1 ConfigView (org.jvnet.hk2.config.ConfigView)1