Interface UserGroupNotificationRulesManager
-
- All Known Implementing Classes:
NotificationRulesManagerImpl
public interface UserGroupNotificationRulesManagerManages group notification rules.- Since:
- 4.5
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
- See Also:
NotificationRulesManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longaddNewRule(String groupCode, String notifierType, NotificationRule rule)Adds a new rule to the rules of the specified group for the specified notifier type.voidapplyOrder(String groupCode, String notifierType, long[] ruleIds)Sorts the notification rules in the specified orderCollection<Long>findConflictingRules(String groupCode, String notifierType, WatchedBuilds watch)Searches for the conflicting rules with the specified watched builds and the notifier type.NotificationRulefindRuleById(String groupCode, long ruleId)Searches for a rule with specified id among rules of the specified group.List<NotificationRule>getDefaultRules()Returns the list of default notification rules.List<NotificationRule>getGroupNotificationRules(String groupCode, String notifierType)Returns user group notification rules for the specified notifier.voidremoveRule(String groupCode, long ruleId)Removes the rule with specified id from the list of rules associated with specified group.voidremoveRule(String groupCode, NotificationRule rule)Removes the specified rule from the list of rules associated with specified group.voidsetGroupNotificationRules(String groupCode, String notifierType, List<NotificationRule> rules)Sets the group notification rules for the specified notifier.
-
-
-
Method Detail
-
getGroupNotificationRules
@NotNull List<NotificationRule> getGroupNotificationRules(@NotNull String groupCode, @NotNull String notifierType) throws UserGroupException
Returns user group notification rules for the specified notifier.- Parameters:
groupCode- the group codenotifierType- type of the notifier- Returns:
- list of notification rules
- Throws:
UserGroupException- if user group with the given code does not exist
-
setGroupNotificationRules
void setGroupNotificationRules(@NotNull String groupCode, @NotNull String notifierType, @NotNull List<NotificationRule> rules) throws UserGroupExceptionSets the group notification rules for the specified notifier.- Parameters:
groupCode- the group codenotifierType- type of the notifierrules- the rules to set- Throws:
UserGroupException- if user group with the given code does not exist
-
removeRule
void removeRule(@NotNull String groupCode, long ruleId) throws UserGroupExceptionRemoves the rule with specified id from the list of rules associated with specified group.- Parameters:
groupCode- the group coderuleId- id of the rule- Throws:
UserGroupException- if user group with the given code does not exist
-
removeRule
void removeRule(@NotNull String groupCode, @NotNull NotificationRule rule) throws UserGroupExceptionRemoves the specified rule from the list of rules associated with specified group.- Parameters:
groupCode- the group coderule- rule to remove- Throws:
UserGroupException- if user group with the given code does not exist
-
applyOrder
void applyOrder(@NotNull String groupCode, @NotNull String notifierType, @NotNull long[] ruleIds)Sorts the notification rules in the specified order- Parameters:
groupCode- the group codenotifierType- type of the notifierruleIds- ids of the rules in the required order
-
addNewRule
long addNewRule(@NotNull String groupCode, @NotNull String notifierType, @NotNull NotificationRule rule) throws UserGroupException, DuplicateNotificationRuleExceptionAdds a new rule to the rules of the specified group for the specified notifier type.- Parameters:
groupCode- the group codenotifierType- type of the notifierrule- rule to add- Returns:
- id of a newly created rule
- Throws:
UserGroupException- if user group with the given code does not existDuplicateNotificationRuleException- if similar rule already exists
-
findConflictingRules
@Nullable Collection<Long> findConflictingRules(@NotNull String groupCode, @NotNull String notifierType, @NotNull WatchedBuilds watch) throws UserGroupException
Searches for the conflicting rules with the specified watched builds and the notifier type.- Parameters:
groupCode- the group codenotifierType- type of the notifierwatch- watched builds- Returns:
- list of conflicting rules ids
- Throws:
UserGroupException- if user group with the given code does not exist
-
findRuleById
@Nullable NotificationRule findRuleById(@NotNull String groupCode, long ruleId) throws UserGroupException
Searches for a rule with specified id among rules of the specified group.- Parameters:
groupCode- the group coderuleId- id of the rule- Returns:
- a found rule, or null
- Throws:
UserGroupException- if user group with the given code does not exist
-
getDefaultRules
@NotNull List<NotificationRule> getDefaultRules()
Returns the list of default notification rules.- Returns:
- the list of default notification rules
-
-