Class NotificationManager
java.lang.Object
org.duracloud.common.notification.NotificationManager
Manages the set of notifiers which have been configured. Provides a way to
both initialize and send notifications to the notifiers based on the
notification type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitializeNotifiers(Collection<NotificationConfig> notificationConfigs) Initializes notifiers using the provided configuration.voidsendAdminNotification(NotificationType type, String subject, String message) Sends a notification to system administrators through all configured notifiers of a given type.voidsendNotification(NotificationType type, String subject, String message, String... destinations) Sends a notification through all configured notifiers of a given type.
-
Constructor Details
-
NotificationManager
-
-
Method Details
-
initializeNotifiers
Initializes notifiers using the provided configuration. It is expected that there will be exactly one config for each notifier type. - If there is more than one config for a given type, the last configuration of that type in the list will win. - If there is a type not represented in the config list, then all notifiers of that type will remain uninitialized.- Parameters:
notificationConfigs- set of configuration for notifiers
-
sendNotification
public void sendNotification(NotificationType type, String subject, String message, String... destinations) Sends a notification through all configured notifiers of a given type.- Parameters:
type- of notification to be sentsubject- of the notificationmessage- of the notificationdestinations- where notification is to be sent
-
sendAdminNotification
Sends a notification to system administrators through all configured notifiers of a given type.- Parameters:
type- of notification to be sentsubject- of the notificationmessage- of the notification
-