jetbrains.buildServer.serverSide
Interface SRunningBuild

All Superinterfaces:
Build, BuildPromotionOwner, ParametersSupport, RunningBuild, SBuild

public interface SRunningBuild
extends SBuild, RunningBuild

Running build interface, contains information specific for running build.


Method Summary
 void addBuildMessage(BuildMessage1 message)
          Deprecated. since 10.0 messages in build log should be logged via BuildLog, see SBuild.getBuildLog() method.
 void addBuildMessages(java.util.List<BuildMessage1> messages)
          Deprecated. since 10.0 messages in build log should be logged via BuildLog, see SBuild.getBuildLog() method.
 SBuildAgent getAgent()
          Get build agent this running build is running on.
 java.lang.String getAgentAccessCode()
          Returns access code which can be used by agent to access server resources by HTTP.
 int getCompletedPercent()
           
 java.lang.String getCurrentPath()
          Returns short description of current running step.
 java.util.Date getLastBuildActivityTimestamp()
           
 java.lang.Integer getQueuedAgentId()
          Deprecated. use getQueuedAgentRestrictor(). Returns id of an agent this build was queued on (when build configuration was added to queue). Returns null if build was not queued on a specific agent.
 AgentRestrictor getQueuedAgentRestrictor()
          Returns an agent restrictor this build was queued with (when build configuration was added to queue).
 SFinishedBuild getRecentlyFinishedBuild()
           
 int getSignature()
          Signature is used to identify builds with the same results.
 long getTimeSpentSinceLastBuildActivity()
          Returns time in seconds spent since last build activity.
 boolean isInterrupted()
          When processing buildFinished event, returns true if build was finished unexpectedly (for instance, killed)
 boolean isOutdated()
          Returns true if this build is outdated.
 boolean isProbablyHanging()
          Returns true if server thinks this build has hung.
 void setBuildNumber(java.lang.String newBuildNumber)
          Set new value for this build build number instead of current one.
 void setBuildStatus(Status status)
          Deprecated. use jetbrains.buildServer.serverSide.SBuild#addBuildProblem to fail build and jetbrains.buildServer.serverSide.SBuild#muteBuildProblems to mark build as successful
 void setInterrupted(RunningBuildState state, User user, java.lang.String reason)
          Mark this build as interrupted.
 void setSignature(int newSignatureValue)
          Deprecated. setting signature to the builds is not req. any more, signature is calculated from build problems
 void stop(User user, java.lang.String comment)
          Stops the build.
 
Methods inherited from interface jetbrains.buildServer.serverSide.SBuild
addBuildProblem, addUserBuildProblem, convertToAgentTime, convertToServerTime, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getBranch, getBuildComment, getBuildDescription, getBuildFeaturesOfType, getBuildLog, getBuildOwnParameters, getBuildStatistics, getBuildType, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getContainingChanges, getDownloadedArtifacts, getFailureReasons, getFileContent, getFirstInternalError, getFirstInternalErrorMessage, getFullStatistics, getLabels, getOwner, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRawBuildNumber, getRelatedIssues, getRevisions, getServerStartDate, getShortStatistics, getStatisticValue, getStatisticValues, getTags, getTriggeredBy, getValueResolver, getVcsRootEntries, hasBuildProblemOfType, isArtifactsExists, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutOfChangesSequence, isPinned, isResponsibleNeeded, isStartedOnAgent, isUsedByOtherBuilds, muteBuildProblems, setBuildComment, setTags, setTags
 
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionOwner
getBuildPromotion, getSequenceBuild
 
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider
 
Methods inherited from interface jetbrains.buildServer.RunningBuild
getDurationEstimate, getDurationOvertime, getElapsedTime, getEstimationForTimeLeft
 
Methods inherited from interface jetbrains.buildServer.Build
getAgentName, getBuildId, getBuildNumber, getBuildStatus, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getCanceledInfo, getCompilationErrorMessages, getDuration, getFinishDate, getFullName, getLogMessages, getProjectExternalId, getProjectId, getStartDate, getStatusDescriptor, getTestMessages, isFinished, isPersonal
 

Method Detail

getCurrentPath

java.lang.String getCurrentPath()
Returns short description of current running step.

Returns:
short description of current running step.

getAgent

@NotNull
SBuildAgent getAgent()
Get build agent this running build is running on. May be unregistered or even dead agent, but never null.

Specified by:
getAgent in interface SBuild
Returns:
see above

getQueuedAgentId

@Deprecated
@Nullable
java.lang.Integer getQueuedAgentId()
Deprecated. use getQueuedAgentRestrictor(). Returns id of an agent this build was queued on (when build configuration was added to queue). Returns null if build was not queued on a specific agent.

Returns:
agent this build was queued on or null if build was not queued on a specific agent

getQueuedAgentRestrictor

@Nullable
AgentRestrictor getQueuedAgentRestrictor()
Returns an agent restrictor this build was queued with (when build configuration was added to queue). Returns null if build was not queued on a specific agent / agent set.

Returns:
see above
Since:
7.0

isInterrupted

boolean isInterrupted()
When processing buildFinished event, returns true if build was finished unexpectedly (for instance, killed)

Returns:
true or false

getSignature

int getSignature()
Signature is used to identify builds with the same results. This is needed when making various decisions about notifying a particular user. If builds have different signatures, they are considered to have different results (have different failing tests etc.).

Returns:
build signature

setSignature

void setSignature(int newSignatureValue)
Deprecated. setting signature to the builds is not req. any more, signature is calculated from build problems

This method should be used in form setSignature(getSignature() + n) to update build signature upon some reason

Parameters:
newSignatureValue - new signature value for the build
See Also:
getSignature(), SBuild.addBuildProblem(jetbrains.buildServer.BuildProblemData)

getCompletedPercent

int getCompletedPercent()
Returns:
completed percentage for the build according to build duration estimated time.

addBuildMessages

void addBuildMessages(@NotNull
                      java.util.List<BuildMessage1> messages)
Deprecated. since 10.0 messages in build log should be logged via BuildLog, see SBuild.getBuildLog() method.

Adds new server messages to the build.

Parameters:
messages - new build messages.

addBuildMessage

void addBuildMessage(@NotNull
                     BuildMessage1 message)
Deprecated. since 10.0 messages in build log should be logged via BuildLog, see SBuild.getBuildLog() method.

Adds new message from server to the build.


setBuildNumber

void setBuildNumber(@NotNull
                    java.lang.String newBuildNumber)
Set new value for this build build number instead of current one. If newBuildNumber has pattern {build.number}, it is replaced with the current build number

Parameters:
newBuildNumber - new value for this build build number

setBuildStatus

void setBuildStatus(Status status)
Deprecated. use jetbrains.buildServer.serverSide.SBuild#addBuildProblem to fail build and jetbrains.buildServer.serverSide.SBuild#muteBuildProblems to mark build as successful

Set current status of the running build. Useful before build finish to update build status.

Parameters:
status - new status of the build

setInterrupted

void setInterrupted(@NotNull
                    RunningBuildState state,
                    @Nullable
                    User user,
                    @Nullable
                    java.lang.String reason)
Mark this build as interrupted.

Parameters:
state - running build state
user - user who initiated interruption or null
reason - reason why interruption initiated or null

getAgentAccessCode

java.lang.String getAgentAccessCode()
Returns access code which can be used by agent to access server resources by HTTP.

Returns:
access code

isProbablyHanging

boolean isProbablyHanging()
Returns true if server thinks this build has hung. The build is considered hung if its estimate is exceeded and there were no messages from this build for some time.

Returns:
true if build is probably hanging

isOutdated

boolean isOutdated()
Returns true if this build is outdated. The build is considered outdated if there is a finished non-personal build which contains newer (or same) changes as contained in this build.

Returns:
see above
Since:
4.5

getRecentlyFinishedBuild

@Nullable
SFinishedBuild getRecentlyFinishedBuild()
Returns:
the build because of which this running build has been marked as outdated (see isOutdated()).
Since:
9.1

getLastBuildActivityTimestamp

java.util.Date getLastBuildActivityTimestamp()
Returns:
timestamp of last message received from a build.

getTimeSpentSinceLastBuildActivity

long getTimeSpentSinceLastBuildActivity()
Returns time in seconds spent since last build activity.

Returns:
time in seconds

stop

void stop(@Nullable
          User user,
          @Nullable
          java.lang.String comment)
Stops the build. If this is a user action, user who performs this action must be specified. If build is stopped without user it will be considered crashed and can be re-added into the queue.

Parameters:
user - user who stopped build or null
comment - comment for the action or null