jetbrains.buildServer.serverSide
Interface BuildServerListener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
BuildServerAdapter, TeamCityInfoStatsProvider

public interface BuildServerListener
extends java.util.EventListener

Generic TeamCity server listeners. Most operations with builds, agents, queue can be detected by implementing this listener.

See Also:
BuildServerAdapter

Method Summary
 void agentRegistered(SBuildAgent agent, long currentlyRunningBuildId)
          Called when build agent is registered (connected)
 void agentRemoved(SBuildAgent agent)
          Called when agent was completely removed from server storage.
 void agentStatusChanged(SBuildAgent agent, boolean wasEnabled, boolean wasAuthorized)
          Called when the status of an agent is changed by a user
 void agentUnregistered(SBuildAgent agent)
          Called after build agent unregistration
 void beforeAgentUnregistered(SBuildAgent agent)
          Called before build agent unregistration
 void beforeBuildFinish(SRunningBuild runningBuild)
          Called right before build finishing, allows to write additional messages to the build log, update build status.
 void beforeBuildFinish(SRunningBuild runningBuild, boolean buildFailed)
          Deprecated. see beforeBuildFinish(SRunningBuild runningBuild)
 void beforeBuildTypeDeleted(java.lang.String buildTypeId)
          Called before cleaning the build configuration data from the database.
 void beforeEntryDelete(SFinishedBuild entry)
          Called before deletion of the build history entry
 void buildChangedStatus(SRunningBuild build, Status oldStatus, Status newStatus)
          Called when build status changes from successful to failed
 void buildCommented(SBuild build, User user, java.lang.String comment)
          Called when user comment the build
 void buildFinished(SRunningBuild build)
          Called after build finishing, only if build was not interrupted
 void buildInterrupted(SRunningBuild build)
          Called after build finishing, only if build was interrupted
 void buildPinned(SBuild build, User user, java.lang.String comment)
          Called when user pinned the build
 void buildQueueOrderChanged()
          Called when user reordered build queue order.
 void buildRemovedFromQueue(SQueuedBuild queuedBuild, User user, java.lang.String comment)
          Called when build configuration removed from build queue
 void buildStarted(SRunningBuild build)
          Called when build is about to start.
 void buildTagsChanged(SBuild build, java.util.List<java.lang.String> oldTags, java.util.List<java.lang.String> newTags)
          Deprecated. Use buildTagsChanged(SBuild, User, List, List)
 void buildTagsChanged(SBuild build, User user, java.util.List<java.lang.String> oldTags, java.util.List<java.lang.String> newTags)
          Called when build tags have been set to specifiled values
 void buildTypeActiveStatusChanged(SBuildType buildType)
          Called when build configuration status changed from active to paused and vice versa.
 void buildTypeAddedToQueue(SBuildType buildType)
          Deprecated.  
 void buildTypeAddedToQueue(SQueuedBuild queuedBuild)
          Called when build configration was added to build queue
 void buildTypeDeleted(java.lang.String buildTypeId)
          Called after the cleaning the build configuration data from the database.
 void buildTypeMoved(SBuildType buildType, SProject original)
          Called when build configuration is moved to another project.
 void buildTypeRegistered(SBuildType buildType)
          Called when build configuration is created or build configuration is reloaded from the disk
 void buildTypeRemovedFromQueue(SBuildType buildType, User user, java.lang.String comment, java.lang.String requestor, java.util.Date whenQueued)
          Deprecated.  
 void buildTypeUnregistered(SBuildType buildType)
          Called when build configuration is deleted
 void buildUnpinned(SBuild build, User user, java.lang.String comment)
          Called when user unpinned the build
 void changeAdded(VcsModification modification, VcsRoot root, java.util.Collection<SBuildType> buildTypes)
          Called when a new modification (user commit) was detected.
 void changeAdded(VcsModification modification, VcsRoot root, SRunningBuild startingBuild)
          Deprecated.  
 void changesLoaded(SRunningBuild build)
          Occurres when changes for a newly started build has been loaded
 void cleanupFinished()
          Called when database cleanup has been finished.
 void cleanupStarted()
          Called when database cleanup is going to start.
 void entryDeleted(SFinishedBuild entry)
          Called after deletion of the build history entry
 void labelingFailed(SBuild build, VcsRoot root, java.lang.Throwable exception)
          Labeling process failed for the specified build and root with the specified problem.
 void labelingSucceed(SBuild build, BuildRevision revision)
          Labeling process succeed for the specified build and revision
 void messageReceived(SRunningBuild build, BuildMessage1 message)
          Called each time when running build got a message from build agent
 void pluginsLoaded()
          Called when all server plugins are loaded
 void projectCreated(java.lang.String projectId)
          Generated when new project was created
 void projectPersisted(java.lang.String projectId)
          Generated when project configuration persisted on a disk
 void projectRemoved(java.lang.String projectId)
          Generated when project was removed
 void projectRestored(java.lang.String projectId)
          Generated when project configuration reloaded from disk
 void responsibleChanged(SBuildType bt, ResponsibilityInfo oldValue, ResponsibilityInfo newValue, boolean isUserAction)
          Called when build configuration responsible has changed, or responsibility status has changed
 void serverConfigurationReloaded()
          Called when the main server configuration file is reloaded
 void serverShutdown()
          Called when server shutdown has been started
 void serverShutdownComplete()
          Event called after server shutdown complete.
 void serverStartup()
          Called when server has been started and its configuration has been loaded from the disk
 void sourcesVersionReleased(BuildAgent agent)
          Clean sources performed for the given agent
 void sourcesVersionReleased(BuildType configuration)
          Clean sources performed for the given configuraton on all agents
 void sourcesVersionReleased(BuildType configuration, BuildAgent agent)
          Clean sources performed for the given configuraton on the given agent
 

Method Detail

agentRegistered

void agentRegistered(SBuildAgent agent,
                     long currentlyRunningBuildId)
Called when build agent is registered (connected)

Parameters:
agent - which was registered
currentlyRunningBuildId - id of the build which is running on this build agent

beforeAgentUnregistered

void beforeAgentUnregistered(SBuildAgent agent)
Called before build agent unregistration

Parameters:
agent - which is about to unregister

agentUnregistered

void agentUnregistered(SBuildAgent agent)
Called after build agent unregistration

Parameters:
agent - which was unregistered

agentStatusChanged

void agentStatusChanged(@NotNull
                        SBuildAgent agent,
                        boolean wasEnabled,
                        boolean wasAuthorized)
Called when the status of an agent is changed by a user

Parameters:
agent - the agent
wasEnabled - the previous status
wasAuthorized - previous authorized state

agentRemoved

void agentRemoved(SBuildAgent agent)
Called when agent was completely removed from server storage.

Parameters:
agent - removed agent

buildTypeAddedToQueue

void buildTypeAddedToQueue(SBuildType buildType)
Deprecated. 

Called when build configration was added to build queue

Parameters:
buildType - build configuration added to build queue

buildTypeAddedToQueue

void buildTypeAddedToQueue(@NotNull
                           SQueuedBuild queuedBuild)
Called when build configration was added to build queue

Parameters:
queuedBuild - queued build added to the queue

buildTypeRemovedFromQueue

void buildTypeRemovedFromQueue(SBuildType buildType,
                               User user,
                               java.lang.String comment,
                               java.lang.String requestor,
                               java.util.Date whenQueued)
Deprecated. 

Called when build configration was removed from build queue

Parameters:
buildType - build configuration descriptor
user - if build was removed manually, contains the user who removed build configuration from queue
comment - provided by user when removeding build from queue
requestor - initial requestor who put build configuration to queue
whenQueued - time when build was added to queue.

buildRemovedFromQueue

void buildRemovedFromQueue(@NotNull
                           SQueuedBuild queuedBuild,
                           User user,
                           java.lang.String comment)
Called when build configuration removed from build queue

Parameters:
queuedBuild - queued build removed from the queue
user - if build was removed manually, contains the user who removed build configuration from queue
comment - provided by user when removeding build from queue

buildPinned

void buildPinned(@NotNull
                 SBuild build,
                 @Nullable
                 User user,
                 @Nullable
                 java.lang.String comment)
Called when user pinned the build

Parameters:
build - pinned build
user - the user who pinned the build
comment - comment provided by user when pinning build

buildUnpinned

void buildUnpinned(@NotNull
                   SBuild build,
                   @Nullable
                   User user,
                   @Nullable
                   java.lang.String comment)
Called when user unpinned the build

Parameters:
build - unpinned build
user - the user who unpinned the build
comment - comment provided by user when unpinning build

buildQueueOrderChanged

void buildQueueOrderChanged()
Called when user reordered build queue order. Is not called when build is started.


buildTypeRegistered

void buildTypeRegistered(SBuildType buildType)
Called when build configuration is created or build configuration is reloaded from the disk

Parameters:
buildType - registered build configuration

buildTypeUnregistered

void buildTypeUnregistered(SBuildType buildType)
Called when build configuration is deleted

Parameters:
buildType - unregistered build configuration

buildTypeMoved

void buildTypeMoved(SBuildType buildType,
                    SProject original)
Called when build configuration is moved to another project.

Parameters:
buildType - build type
original - the original project

beforeBuildTypeDeleted

void beforeBuildTypeDeleted(@NotNull
                            java.lang.String buildTypeId)
Called before cleaning the build configuration data from the database.

Parameters:
buildTypeId - id of build configuration

buildTypeDeleted

void buildTypeDeleted(@NotNull
                      java.lang.String buildTypeId)
Called after the cleaning the build configuration data from the database.

Parameters:
buildTypeId - id of build configuration

buildTypeActiveStatusChanged

void buildTypeActiveStatusChanged(SBuildType buildType)
Called when build configuration status changed from active to paused and vice versa.

Parameters:
buildType - build configuration whose status has changed

buildStarted

void buildStarted(SRunningBuild build)
Called when build is about to start. Changes are not loaded yet, and build agent didn't start the build yet.

Parameters:
build - build configuration whose status has changed

changesLoaded

void changesLoaded(SRunningBuild build)
Occurres when changes for a newly started build has been loaded

Parameters:
build - build, whose changes are loaded

buildChangedStatus

void buildChangedStatus(SRunningBuild build,
                        Status oldStatus,
                        Status newStatus)
Called when build status changes from successful to failed

Parameters:
build - corresponding running build
oldStatus - previous status
newStatus - new status

beforeBuildFinish

void beforeBuildFinish(SRunningBuild runningBuild,
                       boolean buildFailed)
Deprecated. see beforeBuildFinish(SRunningBuild runningBuild)


beforeBuildFinish

void beforeBuildFinish(SRunningBuild runningBuild)
Called right before build finishing, allows to write additional messages to the build log, update build status.

Parameters:
runningBuild - corresponding running build

buildFinished

void buildFinished(SRunningBuild build)
Called after build finishing, only if build was not interrupted

Parameters:
build - running build // TODO: shall pass SFinishedBuild as parameter

buildInterrupted

void buildInterrupted(SRunningBuild build)
Called after build finishing, only if build was interrupted

Parameters:
build - running build // TODO: shall pass SFinishedBuild as parameter

messageReceived

void messageReceived(SRunningBuild build,
                     BuildMessage1 message)
Called each time when running build got a message from build agent

Parameters:
build - running build
message - message sent to the build

responsibleChanged

void responsibleChanged(@NotNull
                        SBuildType bt,
                        @NotNull
                        ResponsibilityInfo oldValue,
                        @NotNull
                        ResponsibilityInfo newValue,
                        boolean isUserAction)
Called when build configuration responsible has changed, or responsibility status has changed

Parameters:
bt - build configuration
oldValue - previous responsibility state
newValue - new responsibility state
isUserAction - true if responsibility status was changed manually via Web UI

beforeEntryDelete

void beforeEntryDelete(SFinishedBuild entry)
Called before deletion of the build history entry

Parameters:
entry - build to be deleted

entryDeleted

void entryDeleted(SFinishedBuild entry)
Called after deletion of the build history entry

Parameters:
entry - deleted build

projectCreated

void projectCreated(java.lang.String projectId)
Generated when new project was created

Parameters:
projectId - id of the created project

projectRemoved

void projectRemoved(java.lang.String projectId)
Generated when project was removed

Parameters:
projectId - deleted projectId

projectPersisted

void projectPersisted(java.lang.String projectId)
Generated when project configuration persisted on a disk

Parameters:
projectId - id of the saved project

projectRestored

void projectRestored(java.lang.String projectId)
Generated when project configuration reloaded from disk

Parameters:
projectId - id of the reloaded project

serverShutdown

void serverShutdown()
Called when server shutdown has been started


serverStartup

void serverStartup()
Called when server has been started and its configuration has been loaded from the disk


pluginsLoaded

void pluginsLoaded()
Called when all server plugins are loaded


changeAdded

void changeAdded(VcsModification modification,
                 VcsRoot root,
                 SRunningBuild startingBuild)
Deprecated. 

Called when new modification (user commit) in project was detected

Parameters:
modification - detected user modification
root - VCS root, modification belongs to
startingBuild - build is being started when the change was loaded (checking for changes was made during the build start), null if change was loaded during regular checking for changes process.

changeAdded

void changeAdded(@NotNull
                 VcsModification modification,
                 @NotNull
                 VcsRoot root,
                 @Nullable
                 java.util.Collection<SBuildType> buildTypes)
Called when a new modification (user commit) was detected. Vcs modification can be detected during periodical process of changes collecting (in this case buildTypes parameter is null) or during build(s) startup phase. In the latter case buildTypes parameter will contain collection of build configurations for which changes collection was performed.

Parameters:
modification - detected VCS modification
root - VCS root where modification was detected
buildTypes - if changes were detected when a build starts collection of buildTypes where changes collection was performed

cleanupStarted

void cleanupStarted()
Called when database cleanup is going to start.


cleanupFinished

void cleanupFinished()
Called when database cleanup has been finished.


serverShutdownComplete

void serverShutdownComplete()
Event called after server shutdown complete. Used to terminate hung child processes.


sourcesVersionReleased

void sourcesVersionReleased(@NotNull
                            BuildAgent agent)
Clean sources performed for the given agent

Parameters:
agent - build agent whose sources are about to clean

sourcesVersionReleased

void sourcesVersionReleased(@NotNull
                            BuildType configuration)
Clean sources performed for the given configuraton on all agents

Parameters:
configuration - build configuration, whose sources to clean

sourcesVersionReleased

void sourcesVersionReleased(@NotNull
                            BuildType configuration,
                            @NotNull
                            BuildAgent agent)
Clean sources performed for the given configuraton on the given agent

Parameters:
configuration - build configuration, whose sources to clean
agent - agent where to clean sources

labelingFailed

void labelingFailed(SBuild build,
                    VcsRoot root,
                    java.lang.Throwable exception)
Labeling process failed for the specified build and root with the specified problem.

Parameters:
build - build for which labeling failed.
root - root for which labeling failed.
exception - labeling cause.

labelingSucceed

void labelingSucceed(SBuild build,
                     BuildRevision revision)
Labeling process succeed for the specified build and revision

Parameters:
build - build for which labeling failed.
revision - labeled.

buildTagsChanged

void buildTagsChanged(SBuild build,
                      java.util.List<java.lang.String> oldTags,
                      java.util.List<java.lang.String> newTags)
Deprecated. Use buildTagsChanged(SBuild, User, List, List)

Called when build tags have been set to specifiled values

Parameters:
build - corresponding build, which tags have been set
oldTags - previous tags on the build
newTags - new tags on the build

buildTagsChanged

void buildTagsChanged(SBuild build,
                      User user,
                      java.util.List<java.lang.String> oldTags,
                      java.util.List<java.lang.String> newTags)
Called when build tags have been set to specifiled values

Parameters:
build - corresponding build, which tags have been set
user - user who set new tags
oldTags - previous tags on the build
newTags - new tags on the build
Since:
4.0.1

buildCommented

void buildCommented(@NotNull
                    SBuild build,
                    @Nullable
                    User user,
                    @Nullable
                    java.lang.String comment)
Called when user comment the build

Parameters:
build - commented build
user - the user who commented the build
comment - comment provided by user

serverConfigurationReloaded

void serverConfigurationReloaded()
Called when the main server configuration file is reloaded

Since:
4.5