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 Details

    • NotificationManager

      public NotificationManager(Notifier... notifiers)
  • Method Details

    • 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 sent
      subject - of the notification
      message - of the notification
      destinations - 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 sent
      subject - of the notification
      message - of the notification