Class FinishedBuildImpl

    • Constructor Detail

      • FinishedBuildImpl

        public FinishedBuildImpl​(long buildId,
                                 long buildPromotionId,
                                 @NotNull
                                 String buildTypeId,
                                 String agentName,
                                 int agentTypeId,
                                 @NotNull
                                 Date buildStartTimeServer,
                                 Date buildStartTimeAgent,
                                 @NotNull
                                 Date buildFinishTimeServer,
                                 @NotNull
                                 Status buildStatus,
                                 String finalStatusText,
                                 String buildNumber,
                                 boolean pinned,
                                 boolean personal,
                                 CanceledInfo canceledInfo,
                                 String rawTriggeredBy,
                                 String buildDescription,
                                 @NotNull
                                 BuildPromotionEx buildPromotion,
                                 @NotNull
                                 BuildContext context)
    • Method Detail

      • getBuildTypeId

        @NotNull
        public String getBuildTypeId()
        Description copied from interface: Build
        Returns build configuration internal id
        Specified by:
        getBuildTypeId in interface Build
        Overrides:
        getBuildTypeId in class BaseBuild
        Returns:
        ID of the configuration this build belongs to.
      • getBuildTypeExternalId

        @NotNull
        public String getBuildTypeExternalId()
        Description copied from interface: Build
        Returns the build type external ID.

        If the external identifier does not exist (this might happen for a running build if the build type was deleted, and a new build type with same external id was created), a BuildPromotion#NOT_EXISTING_BUILD_TYPE_ID value is returned.

        Specified by:
        getBuildTypeExternalId in interface Build
        Overrides:
        getBuildTypeExternalId in class BaseBuild
        Returns:
        build type external ID
      • isAgentLessBuild

        public boolean isAgentLessBuild()
        Specified by:
        isAgentLessBuild in interface SBuild
        Overrides:
        isAgentLessBuild in class BaseBuild
        Returns:
        true if this build does not require an agent (for now this is true for composite builds only)
      • isDetachedFromAgent

        public boolean isDetachedFromAgent()
        Description copied from interface: SBuild
        Returns true if this build was detached from agent at some point.
        Specified by:
        isDetachedFromAgent in interface SBuild
        Overrides:
        isDetachedFromAgent in class BaseBuild
        Returns:
        see above
      • isCompositeBuild

        public boolean isCompositeBuild()
        Description copied from interface: SBuild
        Returns true if this build is a composite build.
        Specified by:
        isCompositeBuild in interface SBuild
        Returns:
        see above
      • getBuildNumber

        @NotNull
        public String getBuildNumber()
        Description copied from interface: Build
        Returns build number in the user defined format (unresolved parameters in build number will be replaced with '???').
        Specified by:
        getBuildNumber in interface Build
        Returns:
        presentable build number
      • isPinned

        public boolean isPinned()
        Description copied from interface: SBuild
        Returns true if this build is pinned
        Specified by:
        isPinned in interface SBuild
        Overrides:
        isPinned in class BaseBuild
        Returns:
        true if this build is pinned
      • setPinned

        public void setPinned​(boolean pinned,
                              @Nullable
                              User user,
                              @Nullable
                              String comment)
        Description copied from interface: SFinishedBuild
        Sets pin status for this build. Pinned builds will not be cleaned by the server cleanup process.
        Specified by:
        setPinned in interface SFinishedBuild
        Parameters:
        pinned - whether to pin build or not.
        user - user who pins/unpins build
        comment - comment
      • setPinned

        public void setPinned​(boolean pinned)
        Description copied from interface: SFinishedBuild
        Sets pin status for this build. Pinned builds will not be cleaned by the server cleanup process.
        Specified by:
        setPinned in interface SFinishedBuild
        Parameters:
        pinned - whether to pin build or not.
      • getPinComment

        @Nullable
        public Comment getPinComment()
        Description copied from interface: SFinishedBuild
        Returns the pin/unpin comment
        Specified by:
        getPinComment in interface SFinishedBuild
        Returns:
        the pin/unpin comment or null if the build has never been pinned/unpinned
      • getAgentName

        public String getAgentName()
        Description copied from interface: Build
        Returns agent name where build is running or happened to run if finished.
        Specified by:
        getAgentName in interface Build
        Returns:
        Agent name where build has been started on
      • getStatusDescriptor

        public StatusDescriptor getStatusDescriptor()
        Description copied from interface: Build
        Returns status descriptor of the build
        Specified by:
        getStatusDescriptor in interface Build
        Returns:
        Descriptor of the current status of the build
      • getBuildDescription

        @Nullable
        public String getBuildDescription()
        Description copied from interface: SBuild
        Returns build description set to this build explicitly or null.
        Specified by:
        getBuildDescription in interface SBuild
        Returns:
        see above
      • getProjectId

        @Nullable
        public String getProjectId()
        Description copied from interface: Build
        Returns internal id of the project this build belongs to. Same as getBuildType().getProjectId().
        Specified by:
        getProjectId in interface Build
        Returns:
        internal id of the project this build belongs to. Same as getBuildType().getProjectId().
      • getProjectExternalId

        @Nullable
        public String getProjectExternalId()
        Description copied from interface: Build
        Returns external id of the project this build belongs to. Same as getBuildType().getProjectId().
        Specified by:
        getProjectExternalId in interface Build
        Returns:
        external id of the project this build belongs to. Same as getBuildType().getProjectId().
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isFinished

        public boolean isFinished()
        Specified by:
        isFinished in interface Build
        Returns:
        true if the build was finished and was saved to the history
      • setLabel

        public void setLabel​(String labelValue,
                             List<VcsRootInstance> rootsToLabel)
                      throws VcsException
        Description copied from interface: SFinishedBuild
        Sets a label on files in VCS repository used by this build in the specified VCS roots
        Specified by:
        setLabel in interface SFinishedBuild
        Parameters:
        labelValue - VCS label to set (references to properties are not supported)
        rootsToLabel - VCS roots to label
        Throws:
        VcsException - if labeling failed
      • getCachedShortStatistics

        @Nullable
        public ShortStatistics getCachedShortStatistics​(boolean calculateIfAbsent)
        Description copied from interface: BuildEx
        Return cached short statistics for this build.
        Specified by:
        getCachedShortStatistics in interface BuildEx
        Parameters:
        calculateIfAbsent - if true, then statistics is calculated if it is not cached yet, if false and there is no statistics in cache, then null is returned
        Returns:
        see above
      • getRawBuildNumber

        public String getRawBuildNumber()
        Description copied from interface: SBuild
        Returns raw build number (i.e. build number with unresolved parameters if they exist) in contradistinction to Build.getBuildNumber() method which will return build number with all unresolved parameters replaced with ???.
        Specified by:
        getRawBuildNumber in interface SBuild
        Specified by:
        getRawBuildNumber in class BaseBuild
        Returns:
        raw build number which can contain unresolved parameters
      • beforeDelete

        public void beforeDelete​(boolean sendEvent)
        Description copied from interface: FinishedBuildEx
        This method should be called before build is going to be deleted. This method will send corresponding event, and will remember state (build promotion) inside the build to make sure this instance of the build can still be used even after data is deleted from database.
        Specified by:
        beforeDelete in interface FinishedBuildEx
      • buildEvictedFromCache

        public void buildEvictedFromCache()
        Description copied from interface: FinishedBuildEx
        This method is called when the build is about to be removed from the cache
        Specified by:
        buildEvictedFromCache in interface FinishedBuildEx
      • getCanceledInfo

        public CanceledInfo getCanceledInfo()
        Description copied from interface: Build
        Returns info related to interrupted build. If build is finished, not interrupted, the value is null.
        Specified by:
        getCanceledInfo in interface Build
        Returns:
        info about canceled reason and canceler if build was actually interrupted, null otherwise.
      • isPersonal

        public boolean isPersonal()
        Description copied from interface: Build
        Returns if this build has been run to test personal changes
        Specified by:
        isPersonal in interface Build
        Overrides:
        isPersonal in class BaseBuild
        Returns:
        true is the build has been started as personal, and its changes were not committed to the VCS
      • getDeploymentStatus

        @NotNull
        public SortedMap<BuildTypeEx,​BuildPromotionEx> getDeploymentStatus()
        Specified by:
        getDeploymentStatus in interface FinishedBuildEx
        Returns:
        map of environment build configurations depending directly on configuration of this build by snapshot or artifact dependencies to the latest triggered build promotion which is using this build. If there is no triggered build yet, then corresponding value in map entry is null.