Class BuildServerAdapter

    • Constructor Detail

      • BuildServerAdapter

        public BuildServerAdapter()
    • Method Detail

      • agentRegistered

        public void agentRegistered​(@NotNull
                                    SBuildAgent agent,
                                    long currentlyRunningBuildId)
        Description copied from interface: BuildServerListener
        Called when build agent is registered (connected)
        Some events may be skipped when an agent was registered on another node. For example on read-only node the event is not called for an agent which was registered on the main server for a short period of time (registered and then immediately unregistered).
        Specified by:
        agentRegistered in interface BuildServerListener
        Parameters:
        agent - which was registered
        currentlyRunningBuildId - id of the build which is running on this build agent, -1 if no build is running on agent
      • agentDescriptionUpdated

        public void agentDescriptionUpdated​(@NotNull
                                            SBuildAgent agent)
        Description copied from interface: BuildServerListener
        Called when build agent description update is finished.
        Some events may be skipped when an agent was registered on another node. For example on read-only node the event is not called for an agent which was registered on the main server for a short period of time (registered and then immediately unregistered).
        Specified by:
        agentDescriptionUpdated in interface BuildServerListener
        Parameters:
        agent - agent with updated agent description
      • agentUnregistered

        @Deprecated
        public void agentUnregistered​(@NotNull
                                      SBuildAgent agent)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called after build agent unregistration
        Some events may be skipped when an agent was registered on another node. For example on read-only node the event is not called for an agent which was registered on the main server for a short period of time (registered and then immediately unregistered).
        Specified by:
        agentUnregistered in interface BuildServerListener
        Parameters:
        agent - which was unregistered
      • agentUnregistered

        public void agentUnregistered​(@NotNull
                                      SBuildAgent agent,
                                      @NotNull
                                      java.lang.String reason)
        Description copied from interface: BuildServerListener
        Called after build agent unregistration
        Some events may be skipped when an agent was registered on another node. For example on read-only node the event is not called for an agent which was registered on the main server for a short period of time (registered and then immediately unregistered).
        Specified by:
        agentUnregistered in interface BuildServerListener
        Parameters:
        agent - which was unregistered
        reason - why the agent unregistered
      • beforeAgentUnregistered

        public void beforeAgentUnregistered​(@NotNull
                                            SBuildAgent agent)
        Description copied from interface: BuildServerListener
        Called before build agent unregistration
        Some events may be skipped when an agent was registered on another node. For example on read-only node the event is not called for an agent which was registered on the main server for a short period of time (registered and then immediately unregistered).
        Specified by:
        beforeAgentUnregistered in interface BuildServerListener
        Parameters:
        agent - which is about to unregister
      • agentRemoved

        public void agentRemoved​(@NotNull
                                 SBuildAgent agent)
        Description copied from interface: BuildServerListener
        Called when agent was completely removed from server storage.
        The event is not called when the current node doesn't manage agents, i.e. on read-only node
        Specified by:
        agentRemoved in interface BuildServerListener
        Parameters:
        agent - removed agent
        See Also:
        see #agentRemoved(int)
      • agentRemoved

        public void agentRemoved​(int agentId)
        Description copied from interface: BuildServerListener
        Called when agent with specified id is removed. If server has agent instance then both BuildServerListener.agentRemoved(SBuildAgent) and this method are called. If server does not have an agent, for example, if agent was removed by another node, then only this method is called.
        Specified by:
        agentRemoved in interface BuildServerListener
        Parameters:
        agentId - id of the removed agent
      • buildTypeAddedToQueue

        @Deprecated
        public void buildTypeAddedToQueue​(@NotNull
                                          SBuildType buildType)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called when build configuration was added to build queue
        Specified by:
        buildTypeAddedToQueue in interface BuildServerListener
        Parameters:
        buildType - build configuration added to build queue
      • buildTypeAddedToQueue

        public void buildTypeAddedToQueue​(@NotNull
                                          SQueuedBuild queuedBuild)
        Description copied from interface: BuildServerListener
        Called when build configuration was added to build queue Some events may be missing when the current node is not responsible for managing build queue. For example, on read-only node the event may be skipped if a build was in the queue for a short period of time, i.e. removed shortly after being added.
        Specified by:
        buildTypeAddedToQueue in interface BuildServerListener
        Parameters:
        queuedBuild - queued build added to the queue
      • buildRemovedFromQueue

        public void buildRemovedFromQueue​(@NotNull
                                          SQueuedBuild queued,
                                          User user,
                                          java.lang.String comment)
        Description copied from interface: BuildServerListener
        Called when a build is removed from the build queue (started, deleted, optimized, etc.) Some events may be missing when the current node is not responsible for managing build queue. For example, on read-only node the event may be skipped if a build was in the queue for a short period of time, i.e. removed shortly after being added.
        Specified by:
        buildRemovedFromQueue in interface BuildServerListener
        Parameters:
        queued - 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 removing build from queue
      • buildPinned

        public void buildPinned​(@NotNull
                                SBuild build,
                                @Nullable
                                User user,
                                @Nullable
                                java.lang.String comment)
        Description copied from interface: BuildServerListener
        Called when user pinned the build. NB build could be pinned multiple times without unpinning
        user and comment parameters are omitted (nulls) when the build was pinned on another node (i.e. it's not called on read-only node)
        Specified by:
        buildPinned in interface BuildServerListener
        Parameters:
        build - pinned build
        user - the user who pinned the build
        comment - comment provided by user when pinning build
      • buildUnpinned

        public void buildUnpinned​(@NotNull
                                  SBuild build,
                                  @Nullable
                                  User user,
                                  @Nullable
                                  java.lang.String comment)
        Description copied from interface: BuildServerListener
        Called when user unpinned the build. NB build could be unpinned multiple times without pinning
        user and comment parameters are omitted (nulls) when the build was unpinned on another node (i.e. it's not called on read-only node)
        Specified by:
        buildUnpinned in interface BuildServerListener
        Parameters:
        build - unpinned build
        user - the user who unpinned the build
        comment - comment provided by user when unpinning build
      • buildQueueOrderChanged

        public void buildQueueOrderChanged()
        Description copied from interface: BuildServerListener
        Called when user reordered build queue order. Is not called when build is started. Some events may be missing when the current node is not responsible for managing build queue. For example, read-only node is not aware of all the queue changes which happened on the main server.
        Specified by:
        buildQueueOrderChanged in interface BuildServerListener
      • changesLoaded

        public void changesLoaded​(@NotNull
                                  BuildPromotion buildPromotion)
        Description copied from interface: BuildServerListener
        This method is called if changes are loaded for a build promotion while it was in the queue or when it was starting. The method is called irregardless of whether the checking for changes operation was successful or not. If operation failed, then BuildPromotion.isFailedToCollectChanges() will return true. Note: TeamCity collects changes for builds in the queue in several cases, the most common one if the build participates in a build chain. This is a more general version of the now deprecated BuildServerListener.changesLoaded(SRunningBuild) method.
        Specified by:
        changesLoaded in interface BuildServerListener
        Parameters:
        buildPromotion - a build promotion for which changes have been collected
      • buildStarted

        public void buildStarted​(@NotNull
                                 SRunningBuild build)
        Description copied from interface: BuildServerListener
        Called when build is about to start. Changes are not loaded yet, and build agent didn't start the build yet.
        Specified by:
        buildStarted in interface BuildServerListener
        Parameters:
        build - build configuration whose status has changed
      • changesLoaded

        public void changesLoaded​(@NotNull
                                  SRunningBuild build)
        Description copied from interface: BuildServerListener
        Called when changes for a newly started build have been loaded successfully. The method is not called if checking for changes operation failed.
        Specified by:
        changesLoaded in interface BuildServerListener
        Parameters:
        build - build, whose changes are loaded
      • buildChangedStatus

        public void buildChangedStatus​(@NotNull
                                       SRunningBuild build,
                                       Status oldStatus,
                                       Status newStatus)
        Description copied from interface: BuildServerListener
        Called when build status changes from successful to failed
        Specified by:
        buildChangedStatus in interface BuildServerListener
        Parameters:
        build - corresponding running build
        oldStatus - previous status
        newStatus - 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 interface BuildServerListener
        Parameters:
        build - running build // TODO: shall pass SFinishedBuild as parameter
      • beforeBuildFinish

        public void beforeBuildFinish​(@NotNull
                                      SRunningBuild runningBuild)
        Description copied from interface: BuildServerListener
        Called right before build finishing, allows to write additional messages to the build log, update build status.
        Specified by:
        beforeBuildFinish in interface BuildServerListener
        Parameters:
        runningBuild - corresponding running build
      • messageReceived

        @Deprecated
        public void messageReceived​(@NotNull
                                    SRunningBuild build,
                                    @NotNull
                                    BuildMessage1 message)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called each time when running build got a message from build agent
        Specified by:
        messageReceived in interface BuildServerListener
        Parameters:
        build - running build
        message - message sent to the build
      • 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 interface BuildServerListener
        Parameters:
        bt - build configuration
        oldValue - previous responsibility entry
        newValue - new responsibility entry
      • responsibleChanged

        @Deprecated
        public void responsibleChanged​(@NotNull
                                       SProject project,
                                       @Nullable
                                       TestNameResponsibilityEntry oldValue,
                                       @NotNull
                                       TestNameResponsibilityEntry newValue,
                                       boolean isUserAction)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called when test responsibility is changed.
        Specified by:
        responsibleChanged in interface BuildServerListener
        Parameters:
        project - the project in which test responsibility has changed
        oldValue - old responsibility entry
        newValue - new responsibility entry
        isUserAction - true if responsibility status was changed manually via Web UI
      • responsibleChanged

        public void responsibleChanged​(@NotNull
                                       SProject project,
                                       @NotNull
                                       java.util.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 interface BuildServerListener
        Parameters:
        project - the project
        testNames - test names
        entry - the new responsibility entry for each test
        isUserAction - true if responsibility status was changed manually via Web UI
      • responsibleRemoved

        public void responsibleRemoved​(@NotNull
                                       SProject project,
                                       @NotNull
                                       TestNameResponsibilityEntry entry)
        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:
        responsibleRemoved in interface BuildServerListener
        Parameters:
        project - the project
        entry - the new responsibility entry for each test
      • responsibleRemoved

        public void responsibleRemoved​(@NotNull
                                       SProject project,
                                       @NotNull
                                       java.util.Collection<BuildProblemInfo> buildProblems,
                                       @NotNull
                                       ResponsibilityEntry entry)
        Description copied from interface: BuildServerListener
        Called when responsibility for build problems is removed.
        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:
        responsibleRemoved in interface BuildServerListener
        Parameters:
        project - the project
        buildProblems - build problems
        entry - the removed responsibility entry
      • 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 interface ServerListener
      • 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 interface ServerListener
      • 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 interface BuildServerListener
        Parameters:
        build - running build // TODO: shall pass SFinishedBuild as parameter
      • changeAdded

        public void changeAdded​(@NotNull
                                VcsModification modification,
                                @NotNull
                                VcsRoot root,
                                @Nullable
                                java.util.Collection<SBuildType> buildTypes)
        Description copied from interface: BuildServerListener
        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.
        Specified by:
        changeAdded in interface BuildServerListener
        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
      • agentStatusChanged

        public void agentStatusChanged​(@NotNull
                                       SBuildAgent agent,
                                       boolean wasEnabled,
                                       boolean wasAuthorized)
        Description copied from interface: BuildServerListener
        Called when the status of an agent is changed by a user
        Some events may be skipped when an agent is registered on another node. For example on read-only node the event is not called for an agent which status was changed twice (enabled and then immediately disabled) on the main server.
        Specified by:
        agentStatusChanged in interface BuildServerListener
        Parameters:
        agent - the agent
        wasEnabled - the previous status
        wasAuthorized - previous authorized state
      • sourcesVersionReleased

        public void sourcesVersionReleased​(@NotNull
                                           BuildAgent agent)
        Description copied from interface: BuildServerListener
        Clean sources performed for the given agent
        Specified by:
        sourcesVersionReleased in interface BuildServerListener
        Parameters:
        agent - build agent whose sources are about to clean todo: change to S-interfaces
      • sourcesVersionReleased

        public void sourcesVersionReleased​(@NotNull
                                           BuildType configuration)
        Description copied from interface: BuildServerListener
        Clean sources performed for the given configuration on all agents
        Specified by:
        sourcesVersionReleased in interface BuildServerListener
        Parameters:
        configuration - build configuration, whose sources to clean todo: change to S-interfaces
      • sourcesVersionReleased

        public void sourcesVersionReleased​(@NotNull
                                           BuildType configuration,
                                           @NotNull
                                           BuildAgent agent)
        Description copied from interface: BuildServerListener
        Clean sources performed for the given configuration on the given agent
        Specified by:
        sourcesVersionReleased in interface BuildServerListener
        Parameters:
        configuration - build configuration, whose sources to clean
        agent - agent where to clean sources todo: change to S-interfaces
      • labelingFailed

        public void labelingFailed​(@NotNull
                                   SBuild build,
                                   @NotNull
                                   VcsRoot root,
                                   @NotNull
                                   java.lang.Throwable exception)
        Description copied from interface: BuildServerListener
        Labeling process failed for the specified build and root with the specified problem.
        Specified by:
        labelingFailed in interface BuildServerListener
        Parameters:
        build - build for which labeling failed.
        root - root for which labeling failed.
        exception - labeling cause.
      • labelingSucceed

        public void labelingSucceed​(@NotNull
                                    SBuild build,
                                    @NotNull
                                    BuildRevision revision)
        Description copied from interface: BuildServerListener
        Labeling process succeed for the specified build and revision
        Specified by:
        labelingSucceed in interface BuildServerListener
        Parameters:
        build - build for which labeling failed.
        revision - labeled.
      • buildTagsChanged

        @Deprecated
        public void buildTagsChanged​(@NotNull
                                     SBuild build,
                                     @NotNull
                                     java.util.List<java.lang.String> oldTags,
                                     @NotNull
                                     java.util.List<java.lang.String> newTags)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called when build tags have been set to specified values
        Specified by:
        buildTagsChanged in interface BuildServerListener
        Parameters:
        build - corresponding build, which tags have been set
        oldTags - previous tags on the build
        newTags - new tags on the build
      • buildTagsChanged

        @Deprecated
        public void buildTagsChanged​(@NotNull
                                     SBuild build,
                                     User user,
                                     @NotNull
                                     java.util.List<java.lang.String> oldTags,
                                     @NotNull
                                     java.util.List<java.lang.String> newTags)
        Deprecated.
        Description copied from interface: BuildServerListener
        Called when build tags have been set to specified values
        Specified by:
        buildTagsChanged in interface BuildServerListener
        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
      • buildPromotionTagsChanged

        public void buildPromotionTagsChanged​(@NotNull
                                              BuildPromotion buildPromotion,
                                              @Nullable
                                              User user,
                                              @NotNull
                                              java.util.Collection<TagData> oldTags,
                                              @NotNull
                                              java.util.Collection<TagData> newTags)
        Description copied from interface: BuildServerListener
        Called when build promotion tags have been set to specified values
        Some parameters may be omitted when the tags were changed on another node (i.e. when the event is called on read-only node): user is null, oldTags are empty.
        Specified by:
        buildPromotionTagsChanged in interface BuildServerListener
        Parameters:
        buildPromotion - corresponding build promotion, which tags have been set
        user - user who set new tags
        oldTags - previous tags on the build promotion (public and private)
        newTags - new tags on the build promotion (public and private)
      • buildCommented

        public void buildCommented​(@NotNull
                                   SBuild build,
                                   @Nullable
                                   User user,
                                   @Nullable
                                   java.lang.String comment)
        Description copied from interface: BuildServerListener
        Called when user comment the build.
        user and comment parameters are omitted (nulls) when the build was commented on another node (i.e. when the event is called on read-only node).
        Specified by:
        buildCommented in interface BuildServerListener
        Parameters:
        build - commented build
        user - the user who commented the build
        comment - comment provided by user
      • 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 interface BuildServerListener
        Parameters:
        muteInfo - mute info
      • testsUnmuted

        public void testsUnmuted​(@Nullable
                                 SUser user,
                                 @NotNull
                                 java.util.Map<MuteInfo,​java.util.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 interface BuildServerListener
        Parameters:
        user - user that unmuted tests, or null if they were unmuted automatically.
        unmutedGroups - groups of tests that were unmuted.
      • buildProblemsChanged

        public void buildProblemsChanged​(@NotNull
                                         SBuild build,
                                         @NotNull
                                         java.util.List<BuildProblemData> before,
                                         @NotNull
                                         java.util.List<BuildProblemData> after)
        Description copied from interface: BuildServerListener
        Called when list of build problems changes (problems added, removed)

        before parameter may be empty or contain some outdated data when the problems are changed on another node:
        • current node is main server but the problem was added on messages processing node
        • current node is read-only but the problem was added on the main server
        Specified by:
        buildProblemsChanged in interface BuildServerListener
        Parameters:
        build - corresponding build
        before - list of build problems before change
        after - list of build problems after change
      • statisticValuePublished

        public void statisticValuePublished​(@NotNull
                                            SBuild build,
                                            @NotNull
                                            java.lang.String valueTypeKey,
                                            @NotNull
                                            java.math.BigDecimal value)
        Description copied from interface: BuildServerListener
        Called upon statistic-value related to the given build have been published
        Specified by:
        statisticValuePublished in interface BuildServerListener
        Parameters:
        build - build this particular value pertains to
        valueTypeKey - target statistic-value's type-key
        value - target build-value
      • 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 interface BuildServerListener
        Parameters:
        muteInfo - mute info
      • buildProblemsUnmuted

        public void buildProblemsUnmuted​(@Nullable
                                         SUser user,
                                         @NotNull
                                         java.util.Map<MuteInfo,​java.util.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 interface BuildServerListener
        Parameters:
        user - user that unmuted problems, or null if they were unmuted automatically.
        unmutedGroups - groups of build problems that were unmuted.
      • buildArtifactsChanged

        public void buildArtifactsChanged​(@NotNull
                                          SBuild build)
        Description copied from interface: BuildServerListener
        Called when build artifacts are changed by the server on disk, for example, when cleanup removed some files.
        Specified by:
        buildArtifactsChanged in interface BuildServerListener
        Parameters:
        build - build whose artifacts were changed