Class GroupNotificationRulesManager
- java.lang.Object
-
- jetbrains.buildServer.notification.impl.AbstractNotificationRulesManager<String,SUserGroup>
-
- jetbrains.buildServer.notification.impl.GroupNotificationRulesManager
-
- All Implemented Interfaces:
EventListener
,NotificationRulesListener<String>
public class GroupNotificationRulesManager extends AbstractNotificationRulesManager<String,SUserGroup>
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jetbrains.buildServer.notification.impl.AbstractNotificationRulesManager
AbstractNotificationRulesManager.DBWatchType
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.notification.impl.AbstractNotificationRulesManager
DELETE_ALL_NOTIFICATION_EVENTS_QUERY, DELETE_ALL_WATCHED_BUILDS_QUERY, DELETE_NOTIFICATION_DATA_QUERY, myIdSequences, myProjectManager, myRulesFactory, mySecurityContext, mySQLRunner
-
-
Constructor Summary
Constructors Constructor Description GroupNotificationRulesManager(ProjectManager projectManager, SecurityContextEx securityContext, NotificationRuleFactory rulesFactory, SQLRunnerEx sqlRunner, NumericIdSequences idSequences, UserGroupManager userGroupManager, NotificationRuleIdProvider ruleIdProvider, EventDispatcher<ProjectsImportListener> projectImportListenerEventDispatcher, ServerResponsibility serverResponsibility, MultiNodesEvents multiNodesEvents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkHolderExists(String holderId)
Same as previous, but throws an exception if holder does not exist.protected NotificationRuleInit
createRuleForProjectsAndBuildTypes(String holderId, Collection<SProject> projects, Collection<SBuildType> buildTypes, Collection<NotificationRule.Event> events, Map<String,String> additionalData)
protected SUserGroup
findHolder(String holderId)
Possible implementations:protected long
getNextRuleId()
protected String
instantiateTemplate(String sql)
Implement this method with your specifications of the DB column name and table prefix.protected void
notifyHolderChanged(String holderId)
Notify other nodes that notification rules holder with given Id was changedprotected String
retrieveHolderId(ResultSet rs, int columnIndex)
Possible implementations:-
Methods inherited from class jetbrains.buildServer.notification.impl.AbstractNotificationRulesManager
addListener, addNewRule, applyOrder, buildTypeCopied, buildTypesCopied, clearCaches, findConflictingRules, findRuleById, findRulesByNotificatorType, findRulesByNotificatorType, findRulesByNotificatorType, getListeners, getNotificationRules, instantiateTemplate, isRulesWithEventsConfigured, notificationRulesChanged, removeRule, removeRule, setNotificationRules, updateNotificationRule
-
-
-
-
Constructor Detail
-
GroupNotificationRulesManager
public GroupNotificationRulesManager(@NotNull ProjectManager projectManager, @NotNull SecurityContextEx securityContext, @NotNull NotificationRuleFactory rulesFactory, @NotNull SQLRunnerEx sqlRunner, @NotNull NumericIdSequences idSequences, @NotNull UserGroupManager userGroupManager, @NotNull NotificationRuleIdProvider ruleIdProvider, @NotNull EventDispatcher<ProjectsImportListener> projectImportListenerEventDispatcher, @NotNull ServerResponsibility serverResponsibility, @NotNull MultiNodesEvents multiNodesEvents)
-
-
Method Detail
-
notifyHolderChanged
protected void notifyHolderChanged(@Nullable String holderId)
Description copied from class:AbstractNotificationRulesManager
Notify other nodes that notification rules holder with given Id was changed- Specified by:
notifyHolderChanged
in classAbstractNotificationRulesManager<String,SUserGroup>
- Parameters:
holderId
- id of notification rules holder
-
retrieveHolderId
@NotNull protected String retrieveHolderId(ResultSet rs, int columnIndex) throws SQLException
Description copied from class:AbstractNotificationRulesManager
Possible implementations:return rs.getLong(columnIndex);
orreturn rs.getString(columnIndex);
- Specified by:
retrieveHolderId
in classAbstractNotificationRulesManager<String,SUserGroup>
- Parameters:
rs
- result setcolumnIndex
- the column- Returns:
- the id
- Throws:
SQLException
- if database error occured
-
createRuleForProjectsAndBuildTypes
@Nullable protected NotificationRuleInit createRuleForProjectsAndBuildTypes(@NotNull String holderId, @NotNull Collection<SProject> projects, @NotNull Collection<SBuildType> buildTypes, @NotNull Collection<NotificationRule.Event> events, @NotNull Map<String,String> additionalData)
- Specified by:
createRuleForProjectsAndBuildTypes
in classAbstractNotificationRulesManager<String,SUserGroup>
-
findHolder
protected SUserGroup findHolder(@NotNull String holderId)
Description copied from class:AbstractNotificationRulesManager
Possible implementations:return myUserModel.findUserById(holderId);
orreturn myUserGroupsManager.findUserGroupByCode(holderId);
- Specified by:
findHolder
in classAbstractNotificationRulesManager<String,SUserGroup>
- Parameters:
holderId
- holder id- Returns:
- the holder, or null
-
checkHolderExists
protected void checkHolderExists(@NotNull String holderId) throws RuntimeException
Description copied from class:AbstractNotificationRulesManager
Same as previous, but throws an exception if holder does not exist.- Specified by:
checkHolderExists
in classAbstractNotificationRulesManager<String,SUserGroup>
- Parameters:
holderId
- holder id- Throws:
RuntimeException
- exception to throw
-
instantiateTemplate
@NotNull protected String instantiateTemplate(String sql)
Description copied from class:AbstractNotificationRulesManager
Implement this method with your specifications of the DB column name and table prefix. UseAbstractNotificationRulesManager.instantiateTemplate(String, String, String)
method below.- Specified by:
instantiateTemplate
in classAbstractNotificationRulesManager<String,SUserGroup>
- Parameters:
sql
- the sql template- Returns:
- sql query
-
getNextRuleId
protected long getNextRuleId()
- Specified by:
getNextRuleId
in classAbstractNotificationRulesManager<String,SUserGroup>
-
-