Class NotificationManager
- java.lang.Object
-
- org.duracloud.common.notification.NotificationManager
-
public class NotificationManager extends Object
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 Constructor Description NotificationManager(Notifier... notifiers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitializeNotifiers(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 Detail
-
NotificationManager
public NotificationManager(Notifier... notifiers)
-
-
Method Detail
-
initializeNotifiers
public void initializeNotifiers(Collection<NotificationConfig> notificationConfigs)
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
public void sendAdminNotification(NotificationType type, String subject, String message)
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
-
-