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)
          Adds new message to the build.
 void addBuildMessages(java.util.List<BuildMessage1> messages)
          Adds new messages to the build.
 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()
          Returns id of an agent this build was queued on (when build configuration was added to queue).
 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)
          Set current status of the running build.
 void setInterrupted(RunningBuildState state, User user, java.lang.String reason)
          Mark this build as interrupted.
 void setSignature(int newSignatureValue)
          This method should be used in form setSignature(getSignature() + n) to update build signature upon some reason
 void stop(User user, java.lang.String comment)
          Stops the build.
 
Methods inherited from interface jetbrains.buildServer.serverSide.SBuild
convertToAgentTime, convertToServerTime, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getBuildComment, getBuildDescription, getBuildLog, getBuildOwnParameters, getBuildProblems, getBuildStatistics, getBuildType, getChanges, getClientStartDate, getCommitters, getContainingChanges, getDownloadedArtifacts, getFileContent, getFirstInternalError, getFirstInternalErrorMessage, getFullStatistics, getLabels, getOwner, getProvidedArtifacts, getQueuedDate, getRawBuildNumber, getRelatedIssues, getRequestor, getRevisions, getServerStartDate, getShortStatistics, getTags, getTriggeredBy, getValueResolver, getVcsRootEntries, isArtifactsExists, isInternalError, isOutOfChangesSequence, isPinned, isResponsibleNeeded, isStartedOnAgent, isUsedByOtherBuilds, setBuildComment, setTags, setTags, visitBuildProblems
 
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, getBuildTypeId, getBuildTypeName, getCanceledInfo, getCompilationErrorMessages, getDuration, getFinishDate, getFullName, getLogMessages, 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.

Returns:
see above

getQueuedAgentId

@Nullable
java.lang.Integer getQueuedAgentId()
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

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)
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()

getCompletedPercent

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

addBuildMessages

void addBuildMessages(@NotNull
                      java.util.List<BuildMessage1> messages)
Adds new messages to the build.

Parameters:
message - new build message.

addBuildMessage

void addBuildMessage(@NotNull
                     BuildMessage1 message)
Adds new message to the build. If a bunch of messages is going to be added, consider using addBuildMessages(java.util.List) method.


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)
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

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(User user,
          java.lang.String comment)
Stops the build.

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