jetbrains.buildServer.notification
Interface NotificationRulesHolder

All Known Subinterfaces:
SUser, SUserGroup

public interface NotificationRulesHolder

Represents the holder of notification rules.

Since:
4.5
Author:
Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
See Also:
NotificationRulesManager

Method Summary
 long addNewRule(java.lang.String notifierType, NotificationRule rule)
          Adds new rule to the rules of specified user for specified notifier type.
 void applyOrder(java.lang.String notifierType, long[] ruleIds)
          Sorts the notification rules in the specified order.
 java.util.Collection<java.lang.Long> findConflictingRules(java.lang.String notifierType, WatchedBuilds watch)
          Searches for rules which intersect with specified watched builds.
 NotificationRule findRuleById(long ruleId)
          Searches for a rule with specified id.
 java.util.List<NotificationRule> getNotificationRules(java.lang.String notifierType)
          Returns the notification rules for specified notifier for this holder (user or group).
 java.util.List<NotificationRulesHolder> getParentRulesHolders()
          Returns parent notification rules holders
 void removeRule(long ruleId)
          Removes the rule with specified id.
 void setNotificationRules(java.lang.String notifierType, java.util.List<NotificationRule> rules)
          Sets the notification rules for specified notifier.
 

Method Detail

getNotificationRules

@NotNull
java.util.List<NotificationRule> getNotificationRules(@NotNull
                                                              java.lang.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
                          java.lang.String notifierType,
                          @NotNull
                          java.util.List<NotificationRule> rules)
Sets the notification rules for specified notifier.

Parameters:
notifierType - type of the notifier
rules - rules to save

removeRule

void removeRule(long ruleId)
Removes the rule with specified id.

Parameters:
ruleId - id of the rule

applyOrder

void applyOrder(@NotNull
                java.lang.String notifierType,
                @NotNull
                long[] ruleIds)
Sorts the notification rules in the specified order.

Parameters:
notifierType - type of the notifier
ruleIds - ids of the rules in the required order

addNewRule

long addNewRule(@NotNull
                java.lang.String notifierType,
                @NotNull
                NotificationRule rule)
                throws DuplicateNotificationRuleException
Adds new rule to the rules of specified user for specified notifier type.

Parameters:
notifierType - type of the notifier
rule - rule to add
Returns:
the id of the newly created rule
Throws:
DuplicateNotificationRuleException - if similar rule already exists

findConflictingRules

@Nullable
java.util.Collection<java.lang.Long> findConflictingRules(@NotNull
                                                                   java.lang.String notifierType,
                                                                   @NotNull
                                                                   WatchedBuilds watch)
Searches for rules which intersect with specified watched builds.

Parameters:
notifierType - type of the notifier
watch - 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

java.util.List<NotificationRulesHolder> getParentRulesHolders()
Returns parent notification rules holders

Returns:
parent notification rules holders