Class NotificationEventAdapter
- java.lang.Object
-
- jetbrains.buildServer.serverSide.ProjectsModelListenerAdapter
-
- jetbrains.buildServer.serverSide.BuildServerAdapter
-
- jetbrains.buildServer.notification.NotificationEventAdapter
-
- All Implemented Interfaces:
EventListener
,BuildServerListener
,ProjectsModelListener
,ServerListener
public class NotificationEventAdapter extends BuildServerAdapter
Translates events of build server to NotificationEventListener events which are more convenient for notificators.- Author:
- Pavel.Sher Date: 01.11.2006
-
-
Constructor Summary
Constructors Constructor Description NotificationEventAdapter(EventDispatcher<BuildServerListener> events, ExecutorServices executors, BuildsManager buildsManager, NotificationEventListener eventAccumulator, TestName2Index testName2Index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildChangedStatus(SRunningBuild runningBuild, Status oldStatus, Status newStatus)
Called when build status changes from successful to failedvoid
buildFinished(SRunningBuild build)
Called after build finishing, only if build was not interruptedvoid
buildInterrupted(SRunningBuild build)
Called after build finishing, only if build was interruptedvoid
buildProblemsMuted(MuteInfo muteInfo)
Called when a set of build problems are muted (with same mute properties).void
buildProblemsUnmuted(SUser user, Map<MuteInfo,Collection<BuildProblemInfo>> unmutedGroups)
Called when a set of build problems are unmuted.void
changesLoaded(SRunningBuild build)
Called when changes for a newly started build have been loaded successfully.void
entryCreated(SFinishedBuild build)
Called when build is added to the history.void
handleFinishedBuild(SRunningBuild build)
void
labelingFailed(SBuild build, VcsRoot root, Throwable exception)
Labeling process failed for the specified build and root with the specified problem.void
responsibleChanged(SBuildType bt, ResponsibilityEntry oldValue, ResponsibilityEntry newValue)
Called when build configuration responsible has changed, or responsibility status has changed
Some events may be omitted when the responsibility was changed on another node, i.e.void
responsibleChanged(SProject project, Collection<BuildProblemInfo> buildProblems, ResponsibilityEntry entry)
Called when responsibility for several build problems at once is changed.void
responsibleChanged(SProject project, Collection<TestName> testNames, ResponsibilityEntry entry, boolean isUserAction)
Called when responsibility for several tests at once is changed.void
serverShutdown()
Called when server shutdown has been started.void
serverStartup()
Called when server has been started and its configuration has been loaded from the diskvoid
setBuildFailingDelay(int newDelayMillis)
void
setCheckHangedBuildsInterval(int checkHangedBuildsInterval)
void
testsMuted(MuteInfo muteInfo)
Called when a set of tests are muted (with same mute properties).void
testsUnmuted(SUser user, Map<MuteInfo,Collection<STest>> unmutedGroups)
Called when several of tests have been unmuted.-
Methods inherited from class jetbrains.buildServer.serverSide.BuildServerAdapter
agentDescriptionUpdated, agentRegistered, agentRemoved, agentRemoved, agentsDescriptionUpdated, agentStatusChanged, agentUnregistered, agentUnregistered, beforeAgentUnregistered, beforeBuildFinish, beforeEntryDelete, beforeServerConfigurationLoaded, buildArtifactsChanged, buildCommented, buildDetachedFromAgent, buildPinned, buildProblemsChanged, buildPromotionTagsChanged, buildQueueOrderChanged, buildRemovedFromQueue, buildStarted, buildTagsChanged, buildTagsChanged, buildTypeAddedToQueue, buildTypeAddedToQueue, buildUnpinned, changeAdded, changesLoaded, cleanupFinished, cleanupStarted, entriesDeleted, entryDeleted, labelingSucceed, messageReceived, pluginsLoaded, responsibleChanged, responsibleRemoved, responsibleRemoved, serverConfigurationReloaded, serverShutdownComplete, sourcesVersionReleased, sourcesVersionReleased, sourcesVersionReleased, statisticValuePublished
-
Methods inherited from class jetbrains.buildServer.serverSide.ProjectsModelListenerAdapter
beforeBuildTypeDeleted, beforeBuildTypesDeleted, buildTypeActiveStatusChanged, buildTypeDeleted, buildTypeDescriptionUpdated, buildTypeExternalIdChanged, buildTypeMoved, buildTypePersisted, buildTypeRegistered, buildTypeRenamed, buildTypeTemplateDeleted, buildTypeTemplateDeleted, buildTypeTemplateExternalIdChanged, buildTypeTemplateMoved, buildTypeTemplatePersisted, buildTypeTemplateRestored, buildTypeUnregistered, projectArchived, projectCreated, projectDearchived, projectDescriptionUpdated, projectExternalIdChanged, projectFeatureAdded, projectFeatureChanged, projectFeatureRemoved, projectMoved, projectPersisted, projectPluginDataFileRemoved, projectPluginDataFileSaved, projectRemoved, projectRemoved, projectRenamed, projectRestored, vcsRootExternalIdChanged, vcsRootMoved, vcsRootPersisted, vcsRootRemoved, vcsRootsPersisted, vcsRootUpdated
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.ProjectsModelListener
beforeBuildTypeDeleted, beforeBuildTypesDeleted, buildTypeActiveStatusChanged, buildTypeDeleted, buildTypeDescriptionUpdated, buildTypeExternalIdChanged, buildTypeMoved, buildTypePersisted, buildTypeRegistered, buildTypeRenamed, buildTypeTemplateDeleted, buildTypeTemplateDeleted, buildTypeTemplateExternalIdChanged, buildTypeTemplateMoved, buildTypeTemplatePersisted, buildTypeTemplateRestored, buildTypeUnregistered, projectArchived, projectCreated, projectDearchived, projectDescriptionUpdated, projectExternalIdChanged, projectFeatureAdded, projectFeatureChanged, projectFeatureRemoved, projectMoved, projectPersisted, projectPluginDataFileRemoved, projectPluginDataFileSaved, projectRemoved, projectRemoved, projectRenamed, projectRestored, vcsRootExternalIdChanged, vcsRootMoved, vcsRootPersisted, vcsRootRemoved, vcsRootsPersisted, vcsRootUpdated
-
-
-
-
Constructor Detail
-
NotificationEventAdapter
public NotificationEventAdapter(@NotNull EventDispatcher<BuildServerListener> events, @NotNull ExecutorServices executors, @NotNull BuildsManager buildsManager, @NotNull NotificationEventListener eventAccumulator, @NotNull TestName2Index testName2Index)
-
-
Method Detail
-
setCheckHangedBuildsInterval
public void setCheckHangedBuildsInterval(int checkHangedBuildsInterval)
-
setBuildFailingDelay
public void setBuildFailingDelay(int newDelayMillis)
-
serverStartup
public void serverStartup()
Description copied from interface:ServerListener
Called when server has been started and its configuration has been loaded from the disk- Specified by:
serverStartup
in interfaceServerListener
- Overrides:
serverStartup
in classBuildServerAdapter
-
changesLoaded
public void changesLoaded(@NotNull SRunningBuild build)
Description copied from interface:BuildServerListener
Called when changes for a newly started build have been loaded successfully. This event is always sent after the buildStarted. If the build changes were collected while the build was sitting in the queue, then this even will still be sent after the build starts. The method is not called if checking for changes operation failed.- Specified by:
changesLoaded
in interfaceBuildServerListener
- Overrides:
changesLoaded
in classBuildServerAdapter
- Parameters:
build
- build, whose changes are loaded
-
buildChangedStatus
public void buildChangedStatus(@NotNull SRunningBuild runningBuild, Status oldStatus, Status newStatus)
Description copied from interface:BuildServerListener
Called when build status changes from successful to failed- Specified by:
buildChangedStatus
in interfaceBuildServerListener
- Overrides:
buildChangedStatus
in classBuildServerAdapter
- Parameters:
runningBuild
- corresponding running buildoldStatus
- previous statusnewStatus
- new status
-
buildFinished
public void buildFinished(@NotNull SRunningBuild build)
Description copied from interface:BuildServerListener
Called after build finishing, only if build was not interrupted- Specified by:
buildFinished
in interfaceBuildServerListener
- Overrides:
buildFinished
in classBuildServerAdapter
- Parameters:
build
- running build // TODO: shall pass SFinishedBuild as parameter
-
entryCreated
public void entryCreated(@NotNull SFinishedBuild build)
Description copied from interface:BuildServerListener
Called when build is added to the history.- Specified by:
entryCreated
in interfaceBuildServerListener
- Overrides:
entryCreated
in classBuildServerAdapter
-
handleFinishedBuild
public void handleFinishedBuild(@NotNull SRunningBuild build)
-
buildInterrupted
public void buildInterrupted(@NotNull SRunningBuild build)
Description copied from interface:BuildServerListener
Called after build finishing, only if build was interrupted- Specified by:
buildInterrupted
in interfaceBuildServerListener
- Overrides:
buildInterrupted
in classBuildServerAdapter
- Parameters:
build
- running build // TODO: shall pass SFinishedBuild as parameter
-
labelingFailed
public void labelingFailed(@NotNull SBuild build, @NotNull VcsRoot root, @NotNull Throwable exception)
Description copied from interface:BuildServerListener
Labeling process failed for the specified build and root with the specified problem.- Specified by:
labelingFailed
in interfaceBuildServerListener
- Overrides:
labelingFailed
in classBuildServerAdapter
- Parameters:
build
- build for which labeling failed.root
- root for which labeling failed.exception
- labeling cause.
-
responsibleChanged
public void responsibleChanged(@NotNull SBuildType bt, @NotNull ResponsibilityEntry oldValue, @NotNull ResponsibilityEntry newValue)
Description copied from interface:BuildServerListener
Called when build configuration responsible has changed, or responsibility status has changed
Some events may be omitted when the responsibility was changed on another node, i.e. it's not called on read-only node when the responsibility was assigned and immediately removed on the main server.- Specified by:
responsibleChanged
in interfaceBuildServerListener
- Overrides:
responsibleChanged
in classBuildServerAdapter
- Parameters:
bt
- build configurationoldValue
- previous responsibility entrynewValue
- new responsibility entry
-
responsibleChanged
public void responsibleChanged(@NotNull SProject project, @NotNull Collection<TestName> testNames, @NotNull ResponsibilityEntry entry, boolean isUserAction)
Description copied from interface:BuildServerListener
Called when responsibility for several tests at once is changed.
Some events may be omitted when the responsibility was changed on another node, i.e. it's not called on read-only node when the responsibility was assigned and immediately removed on the main server.- Specified by:
responsibleChanged
in interfaceBuildServerListener
- Overrides:
responsibleChanged
in classBuildServerAdapter
- Parameters:
project
- the projecttestNames
- test namesentry
- the new responsibility entry for each testisUserAction
- true if responsibility status was changed manually via Web UI
-
responsibleChanged
public void responsibleChanged(@NotNull SProject project, @NotNull Collection<BuildProblemInfo> buildProblems, @Nullable ResponsibilityEntry entry)
Description copied from interface:BuildServerListener
Called when responsibility for several build problems at once is changed.
Some events may be omitted when the responsibility was changed on another node, i.e. it's not called on read-only node when the responsibility was assigned and immediately removed on the main server.- Specified by:
responsibleChanged
in interfaceBuildServerListener
- Overrides:
responsibleChanged
in classBuildServerAdapter
- Parameters:
project
- the projectbuildProblems
- build problemsentry
- the new responsibility entry or null if responsibility is removed (better useBuildServerListener.responsibleRemoved(SProject, Collection, ResponsibilityEntry)
method to subscribe to the 'removed' events)
-
serverShutdown
public void serverShutdown()
Description copied from interface:ServerListener
Called when server shutdown has been started. In addition, this method is called for a plugin before it is unloaded, may be used for releasing resources and cleanup.- Specified by:
serverShutdown
in interfaceServerListener
- Overrides:
serverShutdown
in classBuildServerAdapter
-
testsMuted
public void testsMuted(@NotNull MuteInfo muteInfo)
Description copied from interface:BuildServerListener
Called when a set of tests are muted (with same mute properties). All tests are in the same project.
The method in not called when the test was muted on another node (i.e. when the current node is a read-only node)- Specified by:
testsMuted
in interfaceBuildServerListener
- Overrides:
testsMuted
in classBuildServerAdapter
- Parameters:
muteInfo
- mute info
-
testsUnmuted
public void testsUnmuted(@Nullable SUser user, @NotNull Map<MuteInfo,Collection<STest>> unmutedGroups)
Description copied from interface:BuildServerListener
Called when several of tests have been unmuted. Tests can be belong to several projects.
The method in not called when the test was unmuted on another node (i.e. when the current node is a read-only node)- Specified by:
testsUnmuted
in interfaceBuildServerListener
- Overrides:
testsUnmuted
in classBuildServerAdapter
- Parameters:
user
- user that unmuted tests, or null if they were unmuted automatically.unmutedGroups
- groups of tests that were unmuted.
-
buildProblemsMuted
public void buildProblemsMuted(@NotNull MuteInfo muteInfo)
Description copied from interface:BuildServerListener
Called when a set of build problems are muted (with same mute properties). All problems belong the same project.
The method in not called when the problem was muted on another node (i.e. when the current node is a read-only node)- Specified by:
buildProblemsMuted
in interfaceBuildServerListener
- Overrides:
buildProblemsMuted
in classBuildServerAdapter
- Parameters:
muteInfo
- mute info
-
buildProblemsUnmuted
public void buildProblemsUnmuted(@Nullable SUser user, @NotNull Map<MuteInfo,Collection<BuildProblemInfo>> unmutedGroups)
Description copied from interface:BuildServerListener
Called when a set of build problems are unmuted. Problems can be belong to several projects.
The method in not called when the problem was unmuted on another node (i.e. when the current node is a read-only node)- Specified by:
buildProblemsUnmuted
in interfaceBuildServerListener
- Overrides:
buildProblemsUnmuted
in classBuildServerAdapter
- Parameters:
user
- user that unmuted problems, or null if they were unmuted automatically.unmutedGroups
- groups of build problems that were unmuted.
-
-