org.sonar.api.notifications
Interface NotificationManager

All Superinterfaces:
BatchComponent, ServerComponent

public interface NotificationManager
extends ServerComponent, BatchComponent

The notification manager receives notifications and is in charge of storing them so that they are processed by the notification service.

Pico provides an instance of this class, and plugins just need to create notifications and pass them to this manager with the scheduleForSending(Notification) method.

Since:
2.10

Method Summary
 com.google.common.collect.Multimap<String,NotificationChannel> findNotificationSubscribers(NotificationDispatcher dispatcher, String componentKey)
           
 com.google.common.collect.Multimap<String,NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher, Integer resourceId)
           Returns the list of users who subscribed to the given dispatcher, along with the notification channels (email, twitter, ...) that they choose for this dispatcher.
 void scheduleForSending(List<Notification> notifications)
          Receives notifications and stores them so that they are processed by the notification service.
 void scheduleForSending(Notification notification)
          Receives a notification and stores it so that it is processed by the notification service.
 

Method Detail

scheduleForSending

void scheduleForSending(Notification notification)
Receives a notification and stores it so that it is processed by the notification service.

Parameters:
notification - the notification.

scheduleForSending

void scheduleForSending(List<Notification> notifications)
Receives notifications and stores them so that they are processed by the notification service.

Parameters:
notifications - the notifications.
Since:
3.7.1

findSubscribedRecipientsForDispatcher

com.google.common.collect.Multimap<String,NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher,
                                                                                                     @Nullable
                                                                                                     Integer resourceId)

Returns the list of users who subscribed to the given dispatcher, along with the notification channels (email, twitter, ...) that they choose for this dispatcher.

The resource ID can be null in case of notifications that have nothing to do with a specific project (like system notifications).

Parameters:
dispatcher - the dispatcher for which this list of users is requested
resourceId - the optional resource which is concerned by this request
Returns:
the list of user login along with the subscribed channels

findNotificationSubscribers

com.google.common.collect.Multimap<String,NotificationChannel> findNotificationSubscribers(NotificationDispatcher dispatcher,
                                                                                           @Nullable
                                                                                           String componentKey)


Copyright © 2009–2015 SonarSource. All rights reserved.