aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-01-29 12:59:58 +0100
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-01-29 18:01:15 +0100
commit6d28b25606431eef5b911c4900a7ea4fd764b3df (patch)
tree027e196563cd4cd6c2535e8383f60d68b27353d9 /sonar-plugin-api
parent8a8a8eb17a2ec05fb4bb8873145721e198cd73a3 (diff)
downloadsonarqube-6d28b25606431eef5b911c4900a7ea4fd764b3df.tar.gz
sonarqube-6d28b25606431eef5b911c4900a7ea4fd764b3df.zip
SONAR-3959 Enhance NotifManager to help finding subscribed users
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java
index 10879bf19de..f03dd9b68e5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java
@@ -19,9 +19,12 @@
*/
package org.sonar.api.notifications;
+import com.google.common.collect.SetMultimap;
import org.sonar.api.BatchComponent;
import org.sonar.api.ServerComponent;
+import javax.annotation.Nullable;
+
/**
* <p>
* The notification manager receives notifications and is in charge of storing them so that they are processed by the notification service.
@@ -42,4 +45,19 @@ public interface NotificationManager extends ServerComponent, BatchComponent {
*/
void scheduleForSending(Notification notification);
+ /**
+ * <p>
+ * Returns the list of users who subscribed to the given dispatcher, along with the notification channels (email, twitter, ...) that they choose
+ * for this dispatcher.
+ * </p>
+ * <p>
+ * The resource ID can be null in case of notifications that have nothing to do with a specific project (like system notifications).
+ * </p>
+ *
+ * @param dispatcher the dispatcher for which this list of users is requested
+ * @param resourceId the optional resource which is concerned by this request
+ * @return the list of user login along with the subscribed channels
+ */
+ SetMultimap<String, NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher, @Nullable Integer resourceId);
+
}