Class FeatureProviderNotificationRulesHolder
- java.lang.Object
-
- jetbrains.buildServer.notification.FeatureProviderNotificationRulesHolder
-
- All Implemented Interfaces:
NotificationRulesHolder
public class FeatureProviderNotificationRulesHolder extends Object implements NotificationRulesHolder
Allows storing notification rules in [FeatureProvider] Stores each rule in separate build feature
-
-
Field Summary
Fields Modifier and Type Field Description static StringFEATURE_NAMEstatic StringNOTIFIER
-
Constructor Summary
Constructors Constructor Description FeatureProviderNotificationRulesHolder(FeatureProvider featureProvider)
-
Method Summary
All Methods Instance Methods Concrete 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 holdersStringgetId()List<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 holdersStringgetType()voidremoveRule(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.
-
-
-
Field Detail
-
FEATURE_NAME
public static final String FEATURE_NAME
- See Also:
- Constant Field Values
-
NOTIFIER
public static final String NOTIFIER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FeatureProviderNotificationRulesHolder
public FeatureProviderNotificationRulesHolder(FeatureProvider featureProvider)
-
-
Method Detail
-
getNotificationRules
@NotNull public List<NotificationRule> getNotificationRules(@NotNull String notifierType)
Description copied from interface:NotificationRulesHolderReturns the notification rules for specified notifier for this holder (user or group).- Specified by:
getNotificationRulesin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifier- Returns:
- list of notification rules for specified notifier
-
setNotificationRules
public void setNotificationRules(@NotNull String notifierType, @NotNull List<NotificationRule> rules)Description copied from interface:NotificationRulesHolderSets the notification rules for specified notifier.- Specified by:
setNotificationRulesin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierrules- rules to save
-
applyOrder
public void applyOrder(@NotNull String notifierType, @NotNull long[] ruleIds)Description copied from interface:NotificationRulesHolderSorts the notification rules in the specified order.- Specified by:
applyOrderin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierruleIds- ids of the rules in the required order
-
removeRule
public void removeRule(long ruleId)
Description copied from interface:NotificationRulesHolderRemoves the rule with specified id.- Specified by:
removeRulein interfaceNotificationRulesHolder- Parameters:
ruleId- id of the rule
-
findConflictingRules
@Nullable public Collection<Long> findConflictingRules(@NotNull String notifierType, @NotNull WatchedBuilds watch)
Description copied from interface:NotificationRulesHolderSearches for rules which intersect with specified watched builds.- Specified by:
findConflictingRulesin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierwatch- watched builds- Returns:
- list of conflicting rules ids
-
removeRule
public void removeRule(@NotNull NotificationRule rule)Description copied from interface:NotificationRulesHolderRemoves the rule. ThrowsNotificationRuleChangedExceptionif notification rule with same id was already changed. Does nothing if notification rule doesn't exist.- Specified by:
removeRulein interfaceNotificationRulesHolder- Parameters:
rule- rule to remove
-
getParentRulesHolders
@NotNull public List<NotificationRulesHolder> getParentRulesHolders()
Description copied from interface:NotificationRulesHolderReturns direct parent notification rules holders- Specified by:
getParentRulesHoldersin interfaceNotificationRulesHolder- Returns:
- direct parent notification rules holders
-
getAllParentRulesHolders
@NotNull public List<NotificationRulesHolder> getAllParentRulesHolders()
Description copied from interface:NotificationRulesHolderReturns all (direct and inherited) parent notification rules holders- Specified by:
getAllParentRulesHoldersin interfaceNotificationRulesHolder- Returns:
- all (direct and inherited) parent notification rules holders
-
addNewRule
public long addNewRule(@NotNull String notifierType, @NotNull NotificationRule rule) throws DuplicateNotificationRuleExceptionDescription copied from interface:NotificationRulesHolderAdds new rule to the rules of specified user for specified notifier type.- Specified by:
addNewRulein interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierrule- rule to add- Returns:
- the id of the newly created rule
- Throws:
DuplicateNotificationRuleException- if similar rule already exists
-
findRuleById
@Nullable public NotificationRule findRuleById(long ruleId)
Description copied from interface:NotificationRulesHolderSearches for a rule with specified id.- Specified by:
findRuleByIdin interfaceNotificationRulesHolder- Parameters:
ruleId- id of the rule- Returns:
- a found rule, or null
-
getId
@NotNull public String getId()
-
getType
@NotNull public String getType()
-
-