public interface NotificationRulesManager
UserGroupNotificationRulesManager| Modifier and Type | Method and Description |
|---|---|
void |
addListener(NotificationRulesListener<java.lang.Long> listener)
Registers new user notification rules listener
|
long |
addNewRule(long userId,
java.lang.String notifierType,
NotificationRule rule)
Adds new rule to the rules of specified user for specified notifier type.
|
void |
applyOrder(long userId,
java.lang.String notifierType,
long[] ruleIds)
Sort notification rules in the specified order
|
java.util.Collection<java.lang.Long> |
findConflictingRules(long userId,
java.lang.String notifierType,
WatchedBuilds watch)
Searches for rules which intersect with specified watched builds in the list of user rules
for specified notifier type.
|
NotificationRule |
findRuleById(long userId,
long ruleId)
Searches for a rule with specified id among rules of specified user
|
java.util.Map<java.lang.Long,java.util.List<NotificationRule>> |
findRulesByNotificatorType(java.lang.String notifierType)
Returns map of user id to list of notification rules for specified notifier type.
|
java.util.Map<java.lang.Long,java.util.List<NotificationRule>> |
getAllRulesByNotificatorType(java.lang.String notifierType)
Returns a map of user id to list of all notification rules (including the rules of all groups
containing the user) for the specified notifier type.
|
java.util.Map<java.lang.Long,java.util.List<NotificationRule>> |
getAllRulesByNotificatorType(java.lang.String notificatorType,
Filter<NotificationRule> notificationRuleFilter)
Returns a map of user id to list of all notification rules (including the rules of all groups
containing the user) for the specified notifier type filtered with provided filter.
|
java.util.List<NotificationRule> |
getAllUserNotificationRules(long userId,
java.lang.String notifierType)
Returns all user notification rules (including the rules of all groups containing the user)
for the specified notifier type.
|
java.util.List<NotificationRule> |
getUserNotificationRules(long userId,
java.lang.String notifierType)
Returns user notification rules for specified notifier.
|
boolean |
isRulesWithEventsConfigured(long userId,
java.lang.String notifierType)
Returns true if specified user has notification rules with one or more events configured for
specified notifier type.
|
void |
removeRule(long userId,
long ruleId)
Removes rule with specified id from the list of rules of specified user.
|
void |
removeRule(long holderId,
NotificationRule rule)
Removes the rule.
|
void |
setUserNotificationRules(long userId,
java.lang.String notifierType,
java.util.List<NotificationRule> rules)
Sets user notification rules for specified notifier
|
void |
updateNotificationRule(long userId,
java.lang.String notifierType,
NotificationRule rule)
Sets user notification rules for specified notifier
|
@NotNull java.util.List<NotificationRule> getUserNotificationRules(long userId, @NotNull java.lang.String notifierType) throws UserNotFoundException
userId - id of the usernotifierType - type of the notifierUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).boolean isRulesWithEventsConfigured(long userId,
@NotNull
java.lang.String notifierType)
throws UserNotFoundException
userId - id of the usernotifierType - type of the notifierUserNotFoundException - if user does not existvoid setUserNotificationRules(long userId,
@NotNull
java.lang.String notifierType,
@NotNull
java.util.List<NotificationRule> rules)
throws UserNotFoundException
userId - id of the usernotifierType - type of the notifierrules - rules to saveUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).void updateNotificationRule(long userId,
@NotNull
java.lang.String notifierType,
@NotNull
NotificationRule rule)
throws UserNotFoundException
userId - id of the usernotifierType - type of the notifierrule - rule to updateUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).java.util.Map<java.lang.Long,java.util.List<NotificationRule>> findRulesByNotificatorType(@NotNull java.lang.String notifierType)
notifierType - type of the notifiervoid removeRule(long userId,
long ruleId)
throws UserNotFoundException
userId - id of the userruleId - id of the ruleUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).void removeRule(long holderId,
@NotNull
NotificationRule rule)
throws UserNotFoundException
NotificationRuleChangedException if notification rule with same id was already changed. Does nothing if notification rule doesn't exist.holderId - id of the userrule - rule to removeUserNotFoundExceptionvoid applyOrder(long userId,
@NotNull
java.lang.String notifierType,
@NotNull
long[] ruleIds)
userId - id of the usernotifierType - type of the notifierruleIds - ids of the rules in the required orderlong addNewRule(long userId,
@NotNull
java.lang.String notifierType,
@NotNull
NotificationRule rule)
throws UserNotFoundException,
DuplicateNotificationRuleException
userId - id of the usernotifierType - type of the notifierrule - rule to addUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).DuplicateNotificationRuleException - if similar rule already exists@Nullable
java.util.Collection<java.lang.Long> findConflictingRules(long userId,
@NotNull
java.lang.String notifierType,
@NotNull
WatchedBuilds watch)
throws UserNotFoundException
userId - id of the usernotifierType - type of the notifierwatch - watched buildsUserNotFoundException - if user does not exist@Nullable NotificationRule findRuleById(long userId, long ruleId) throws UserNotFoundException
userId - id of the userruleId - id of the ruleUserNotFoundException - if user does not existvoid addListener(@NotNull
NotificationRulesListener<java.lang.Long> listener)
listener - new listener.@NotNull java.util.Map<java.lang.Long,java.util.List<NotificationRule>> getAllRulesByNotificatorType(@NotNull java.lang.String notifierType)
The rules corresponding to one usergroup are grouped together, but the order of usergroups isn't well-defined. Guaranteed preceding the user rules of group rules.
notifierType - type of the notifier@NotNull java.util.List<NotificationRule> getAllUserNotificationRules(long userId, @NotNull java.lang.String notifierType) throws UserNotFoundException
notifierType - type of the notifierUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).java.util.Map<java.lang.Long,java.util.List<NotificationRule>> getAllRulesByNotificatorType(java.lang.String notificatorType, Filter<NotificationRule> notificationRuleFilter)
The rules corresponding to one usergroup are grouped together, but the order of usergroups isn't well-defined. Guaranteed preceding the user rules of group rules.
notificatorType - type of the notifiernotificationRuleFilter - notification rule filterUserNotFoundException - if user with specified id does not exist in
current login domain UserModel.findUserById(long).