Interface NotificationRulesHolder
-
- All Known Subinterfaces:
SUser,SUserGroup,UserEx,UserGroupEx
- All Known Implementing Classes:
AllUsersGroup,AssociatedUser,BaseUser,FeatureProviderNotificationRulesHolder,InMemoryUser,RestrictedUserImpl,SecuredUser,SecuredUserGroup,TestUser,UserGroupImpl,UserImpl
public interface NotificationRulesHolderRepresents the holder of 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 notifierType, NotificationRule rule)Adds new rule to the rules of specified user for specified notifier type.voidapplyOrder(String notifierType, long[] ruleIds)Sorts the notification rules in the specified order.Collection<Long>findConflictingRules(String notifierType, WatchedBuilds watch)Searches for rules which intersect with specified watched builds.NotificationRulefindRuleById(long ruleId)Searches for a rule with specified id.List<NotificationRulesHolder>getAllParentRulesHolders()Returns all (direct and inherited) parent notification rules holdersList<NotificationRule>getNotificationRules(String notifierType)Returns the notification rules for specified notifier for this holder (user or group).List<NotificationRulesHolder>getParentRulesHolders()Returns direct parent notification rules holdersvoidremoveRule(long ruleId)Removes the rule with specified id.voidremoveRule(NotificationRule rule)Removes the rule.voidsetNotificationRules(String notifierType, List<NotificationRule> rules)Sets the notification rules for specified notifier.
-
-
-
Method Detail
-
getNotificationRules
@NotNull List<NotificationRule> getNotificationRules(@NotNull String notifierType)
Returns the notification rules for specified notifier for this holder (user or group).- Parameters:
notifierType- type of the notifier- Returns:
- list of notification rules for specified notifier
-
setNotificationRules
void setNotificationRules(@NotNull String notifierType, @NotNull List<NotificationRule> rules)Sets the notification rules for specified notifier.- Parameters:
notifierType- type of the notifierrules- rules to save
-
removeRule
void removeRule(long ruleId)
Removes the rule with specified id.- Parameters:
ruleId- id of the rule
-
removeRule
void removeRule(@NotNull NotificationRule rule)Removes the rule. ThrowsNotificationRuleChangedExceptionif notification rule with same id was already changed. Does nothing if notification rule doesn't exist.- Parameters:
rule- rule to remove
-
applyOrder
void applyOrder(@NotNull String notifierType, @NotNull long[] ruleIds)Sorts the notification rules in the specified order.- Parameters:
notifierType- type of the notifierruleIds- ids of the rules in the required order
-
addNewRule
long addNewRule(@NotNull String notifierType, @NotNull NotificationRule rule) throws DuplicateNotificationRuleExceptionAdds new rule to the rules of specified user for specified notifier type.- Parameters:
notifierType- type of the notifierrule- rule to add- Returns:
- the id of the newly created rule
- Throws:
DuplicateNotificationRuleException- if similar rule already exists
-
findConflictingRules
@Nullable Collection<Long> findConflictingRules(@NotNull String notifierType, @NotNull WatchedBuilds watch)
Searches for rules which intersect with specified watched builds.- Parameters:
notifierType- type of the notifierwatch- watched builds- Returns:
- list of conflicting rules ids
-
findRuleById
@Nullable NotificationRule findRuleById(long ruleId)
Searches for a rule with specified id.- Parameters:
ruleId- id of the rule- Returns:
- a found rule, or null
-
getParentRulesHolders
@NotNull List<NotificationRulesHolder> getParentRulesHolders()
Returns direct parent notification rules holders- Returns:
- direct parent notification rules holders
-
getAllParentRulesHolders
@NotNull List<NotificationRulesHolder> getAllParentRulesHolders()
Returns all (direct and inherited) parent notification rules holders- Returns:
- all (direct and inherited) parent notification rules holders
-
-