jetbrains.buildServer.serverSide
Interface SBuild

All Superinterfaces:
Build, BuildPromotionOwner
All Known Subinterfaces:
SFinishedBuild, SRunningBuild

public interface SBuild
extends Build, BuildPromotionOwner

Server-side instance of a build.


Method Summary
 java.util.Date convertToAgentTime(java.util.Date serverTime)
          Converts server time to agent time by taking into account agent and server time difference.
 java.util.Date convertToServerTime(java.util.Date agentTime)
          Converts agent time to server time by taking into account agent and server time difference.
 java.io.File getArtifactsDirectory()
          Returns artifacts directory of this build.
 Comment getBuildComment()
          Returns build comment
 java.lang.String getBuildDescription()
          Returns build description set to this build explicitly or null.
 BuildLog getBuildLog()
          Returns build log.
 java.util.List<BuildProblem> getBuildProblems()
          Returns all problems for this build (including custom build problems defined in extensions).
 BuildStatistics getBuildStatistics(BuildStatisticsOptions options)
          Same as getFullStatistics() but with more control of data being loaded.
 SBuildType getBuildType()
          Returns build configuration this build belongs to.
 java.util.List<SVcsModification> getChanges(SelectPrevBuildPolicy policy, boolean includeModificationsIfPreviousBuildIsAbsent)
          List of modifications detected in the version control since the previous build (selected according to the specified policy)
 java.util.Date getClientStartDate()
          Returns the timestamp when the build was started on the build agent (in agent time)
 UserSet<SUser> getCommitters(SelectPrevBuildPolicy policy)
          Returns all users who made modifications since the previous build selected acoording to the speciifed policy.
 java.util.List<SVcsModification> getContainingChanges()
          Returns changes in this build.
 DownloadedArtifacts getDownloadedArtifacts()
          Returns information about artifacts downloaded by this build according to configured artifact dependencies.
 byte[] getFileContent(java.lang.String filePath)
          Get binary content of the single file related to this build.
 BuildStatistics getFullStatistics()
          Calculates full statistics for this build.
 java.util.List<VcsLabel> getLabels()
          VCS labels which were made by TeamCity for the build.
 SUser getOwner()
          If this build is personal one, returns the owner of this build.
 DownloadedArtifacts getProvidedArtifacts()
          Returns information about provided artifacts, i.e. artifacts that were downloaded from this build by other builds by artifact dependencies.
 java.util.Date getQueuedDate()
          Returns the date when the build was added to queue.
 java.lang.String getRequestor()
          Deprecated. see getTriggeredBy()
 java.util.List<BuildRevision> getRevisions()
          List of all revisions which were used for the build instance
 java.util.Date getServerStartDate()
          Returns the timestamp when the build was removed from the queue.
 ShortStatistics getShortStatistics()
          Calculates short statistics for this build.
 java.util.List<java.lang.String> getTags()
          Returns list of tags for this build
 TriggeredBy getTriggeredBy()
          Returns details about how this build was triggered.
 ValueResolver getValueResolver()
          Returns build-aware value resolver to be used to resolve values based on the build's properties.
 java.util.List<VcsRootEntry> getVcsRootEntries()
          Returns vcs roots with checkout rules for the build start moment.
 boolean isArtifactsExists()
          Returns true if this build has artifacts
 boolean isOutOfChangesSequence()
          Returns true if there is a build started before but having more recent changes then this build.
 boolean isPinned()
          Returns true if this build is pinned
 boolean isResponsibleNeeded()
          Always returns false for personal and/or cancelled builds.
 boolean isStartedOnAgent()
          Returns true if this build was started on agent.
 boolean isUsedByOtherBuilds()
          Returns true if this build is used by other builds, i.e. there are dependencies by sources on this build or artifacts of this build were downloaded by other builds.
 void setBuildComment(User user, java.lang.String comment)
          Sets the comment for the build
 void setTags(java.util.List<java.lang.String> tags)
          Deprecated. Use setTags(User, List)
 void setTags(User user, java.util.List<java.lang.String> tags)
          Sets tags for this build
 void visitBuildProblems(BuildProblemsVisitor visitor)
          Visit all problems of this build (including custom build problems defined in extensions).
 
Methods inherited from interface jetbrains.buildServer.Build
getAgentName, getBuildId, getBuildNumber, getBuildStatus, getBuildTypeId, getBuildTypeName, getCanceledInfo, getDuration, getFinishDate, getFullName, getLogMessages, getProjectId, getStartDate, getStatusDescriptor, getTestMessages, isFinished, isPersonal
 
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionOwner
getBuildPromotion, getSequenceBuild
 

Method Detail

getArtifactsDirectory

java.io.File getArtifactsDirectory()
Returns artifacts directory of this build. Artifacts should be locked with help of ArtifactsGuard for the period of their processing.

Returns:
artifacts directory of this build

isArtifactsExists

boolean isArtifactsExists()
Returns true if this build has artifacts

Returns:
true if this build has artifacts

isResponsibleNeeded

boolean isResponsibleNeeded()
Always returns false for personal and/or cancelled builds. Returns true if this build is failed (or failing) and there are no finished successful builds after this build. Returns true even if there is active responsible for the build configuration but the configuration status is failed.

Returns:
see above.

getBuildLog

@NotNull
BuildLog getBuildLog()
Returns build log.

Returns:
build log.

getShortStatistics

@NotNull
ShortStatistics getShortStatistics()
Calculates short statistics for this build. Short statistics provides details for failed tests only. If you need information about passed, ignored tests and compilation errors use getFullStatistics() method.

Returns:
short statistics for this build.

getFullStatistics

@NotNull
BuildStatistics getFullStatistics()
Calculates full statistics for this build. This method can be time consuming, if you do not need some parts of build statistics try to use method getBuildStatistics(BuildStatisticsOptions) instead.

Returns:
full statistics for this build.

getBuildStatistics

@NotNull
BuildStatistics getBuildStatistics(@NotNull
                                           BuildStatisticsOptions options)
Same as getFullStatistics() but with more control of data being loaded.

Parameters:
options - options
Returns:
build statistics according to specified options

getOwner

@Nullable
SUser getOwner()
If this build is personal one, returns the owner of this build.

Returns:
null if this build is not personal otherwise owner of this build
See Also:
Build.isPersonal()

getRequestor

@Nullable
java.lang.String getRequestor()
Deprecated. see getTriggeredBy()

Return the reason string how and why this build was triggered

Returns:
see above

getTriggeredBy

TriggeredBy getTriggeredBy()
Returns details about how this build was triggered.

Returns:
see above

getBuildType

@Nullable
SBuildType getBuildType()
Returns build configuration this build belongs to.

Specified by:
getBuildType in interface Build
Returns:
build configuration descriptor.

getDownloadedArtifacts

@NotNull
DownloadedArtifacts getDownloadedArtifacts()
Returns information about artifacts downloaded by this build according to configured artifact dependencies.

Returns:
information about downloaded artifacts.

getProvidedArtifacts

@NotNull
DownloadedArtifacts getProvidedArtifacts()
Returns information about provided artifacts, i.e. artifacts that were downloaded from this build by other builds by artifact dependencies.

Returns:
see above

isUsedByOtherBuilds

boolean isUsedByOtherBuilds()
Returns true if this build is used by other builds, i.e. there are dependencies by sources on this build or artifacts of this build were downloaded by other builds.

Returns:
see above

getContainingChanges

@NotNull
java.util.List<SVcsModification> getContainingChanges()
Description copied from interface: Build
Returns changes in this build. Same as getChanges(SelectPrevBuildPolicy.SINCE_LAST_BUILD, false)

Specified by:
getContainingChanges in interface Build
Returns:
changes in this build

getChanges

@NotNull
java.util.List<SVcsModification> getChanges(SelectPrevBuildPolicy policy,
                                                    boolean includeModificationsIfPreviousBuildIsAbsent)
Description copied from interface: Build
List of modifications detected in the version control since the previous build (selected according to the specified policy)

Specified by:
getChanges in interface Build
Parameters:
policy - can be one of the two kinds:
includeModificationsIfPreviousBuildIsAbsent - should the method return something if there's no previous build.
Returns:
list of modifications

getCommitters

UserSet<SUser> getCommitters(SelectPrevBuildPolicy policy)
Description copied from interface: Build
Returns all users who made modifications since the previous build selected acoording to the speciifed policy.

Specified by:
getCommitters in interface Build
Parameters:
policy - can be one of the two kinds:
Returns:
commiters in this build according to selection policy. If the build is personal, the set contains the only user who started the build

isOutOfChangesSequence

boolean isOutOfChangesSequence()
Returns true if there is a build started before but having more recent changes then this build. Such situation can occur if this build was associated with a specific change list before adding to queue at the time when more recent changes were available.

Returns:
see above

getTags

java.util.List<java.lang.String> getTags()
Returns list of tags for this build

Returns:
tags

setTags

void setTags(java.util.List<java.lang.String> tags)
Deprecated. Use setTags(User, List)

Sets tags for this build

Parameters:
tags - tags to set

setTags

void setTags(User user,
             java.util.List<java.lang.String> tags)
Sets tags for this build

Parameters:
user - user who set tags
tags - tags to set
Since:
4.0.1

getFileContent

@NotNull
byte[] getFileContent(java.lang.String filePath)
                      throws VcsException
Get binary content of the single file related to this build.

Parameters:
filePath - - relative file path regarding to the project root, "checkout root" from vcs root should not be included
Returns:
- specified file content, corresponding to the build
Throws:
VcsException - if some problem occurred while getting file content from the source control repository.

getRevisions

java.util.List<BuildRevision> getRevisions()
List of all revisions which were used for the build instance

Returns:
all revisions which were used in this build

getLabels

java.util.List<VcsLabel> getLabels()
VCS labels which were made by TeamCity for the build. If label attempt failes VcsLabel status is FAILED and failureReason contains short description of the problem.

Returns:
VCS labels which were made by TeamCity for the build

getQueuedDate

@NotNull
java.util.Date getQueuedDate()
Returns the date when the build was added to queue.

Returns:
queued time.

getServerStartDate

@NotNull
java.util.Date getServerStartDate()
Returns the timestamp when the build was removed from the queue.

Returns:
the timestamp when the build was removed from the queue.

getVcsRootEntries

java.util.List<VcsRootEntry> getVcsRootEntries()
Returns vcs roots with checkout rules for the build start moment.

Returns:
vcs roots with checkout rules for the build start moment.

getClientStartDate

@Nullable
java.util.Date getClientStartDate()
Returns the timestamp when the build was started on the build agent (in agent time)

Returns:
the timestamp when the build was started on the build agent (in agent time)

isStartedOnAgent

boolean isStartedOnAgent()
Returns true if this build was started on agent.

Returns:
see above

convertToServerTime

@NotNull
java.util.Date convertToServerTime(@NotNull
                                           java.util.Date agentTime)
Converts agent time to server time by taking into account agent and server time difference.

Parameters:
agentTime - time on agent
Returns:
server time

convertToAgentTime

@NotNull
java.util.Date convertToAgentTime(@NotNull
                                          java.util.Date serverTime)
Converts server time to agent time by taking into account agent and server time difference.

Parameters:
serverTime - server time to convert
Returns:
agent time

getBuildDescription

@Nullable
java.lang.String getBuildDescription()
Returns build description set to this build explicitly or null.

Returns:
see above

getValueResolver

@NotNull
ValueResolver getValueResolver()
Returns build-aware value resolver to be used to resolve values based on the build's properties.

Returns:
this build-aware value resolver

getBuildComment

@Nullable
Comment getBuildComment()
Returns build comment

Returns:
build comment

setBuildComment

void setBuildComment(@Nullable
                     User user,
                     @Nullable
                     java.lang.String comment)
Sets the comment for the build

Parameters:
user - user who sets the comment
comment - text of the comment

isPinned

boolean isPinned()
Returns true if this build is pinned

Returns:
true if this build is pinned

visitBuildProblems

void visitBuildProblems(@NotNull
                        BuildProblemsVisitor visitor)
Visit all problems of this build (including custom build problems defined in extensions). Problems are visited due to theirs timestamps in ascending order. Problems with null timestamps are visited last in an indeterminate order.

Parameters:
visitor - visitor

getBuildProblems

@NotNull
java.util.List<BuildProblem> getBuildProblems()
Returns all problems for this build (including custom build problems defined in extensions). Problems are sorted due to theirs timestamps in ascending order. Problems with null timestamps are added to the end of the list in an indeterminate order.

Returns:
all problems for this build