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 voidcheckHolderExists(String holderId)Same as previous, but throws an exception if holder does not exist.protected NotificationRuleInitcreateRuleForProjectsAndBuildTypes(String holderId, Collection<SProject> projects, Collection<SBuildType> buildTypes, Collection<NotificationRule.Event> events, Map<String,String> additionalData)protected SUserGroupfindHolder(String holderId)Possible implementations:protected longgetNextRuleId()protected StringinstantiateTemplate(String sql)Implement this method with your specifications of the DB column name and table prefix.protected voidnotifyHolderChanged(String holderId)Notify other nodes that notification rules holder with given Id was changedprotected StringretrieveHolderId(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:AbstractNotificationRulesManagerNotify other nodes that notification rules holder with given Id was changed- Specified by:
notifyHolderChangedin 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:AbstractNotificationRulesManagerPossible implementations:return rs.getLong(columnIndex);
orreturn rs.getString(columnIndex);
- Specified by:
retrieveHolderIdin 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:
createRuleForProjectsAndBuildTypesin classAbstractNotificationRulesManager<String,SUserGroup>
-
findHolder
protected SUserGroup findHolder(@NotNull String holderId)
Description copied from class:AbstractNotificationRulesManagerPossible implementations:return myUserModel.findUserById(holderId);
orreturn myUserGroupsManager.findUserGroupByCode(holderId);
- Specified by:
findHolderin classAbstractNotificationRulesManager<String,SUserGroup>- Parameters:
holderId- holder id- Returns:
- the holder, or null
-
checkHolderExists
protected void checkHolderExists(@NotNull String holderId) throws RuntimeExceptionDescription copied from class:AbstractNotificationRulesManagerSame as previous, but throws an exception if holder does not exist.- Specified by:
checkHolderExistsin classAbstractNotificationRulesManager<String,SUserGroup>- Parameters:
holderId- holder id- Throws:
RuntimeException- exception to throw
-
instantiateTemplate
@NotNull protected String instantiateTemplate(String sql)
Description copied from class:AbstractNotificationRulesManagerImplement this method with your specifications of the DB column name and table prefix. UseAbstractNotificationRulesManager.instantiateTemplate(String, String, String)method below.- Specified by:
instantiateTemplatein classAbstractNotificationRulesManager<String,SUserGroup>- Parameters:
sql- the sql template- Returns:
- sql query
-
getNextRuleId
protected long getNextRuleId()
- Specified by:
getNextRuleIdin classAbstractNotificationRulesManager<String,SUserGroup>
-
-