org.jfrog.build.api
Class Build

java.lang.Object
  extended by org.jfrog.build.api.BaseBuildBean
      extended by org.jfrog.build.api.Build
All Implemented Interfaces:
java.io.Serializable, BuildBean

public class Build
extends BaseBuildBean

Contains the general build information

See Also:
Serialized Form

Field Summary
static java.lang.String STARTED_FORMAT
           
 
Fields inherited from interface org.jfrog.build.api.BuildBean
ARTIFACT, ARTIFACTS, DEPENDENCIES, DEPENDENCY, EXCLUDED_ARTIFACTS, MODULE, MODULES, ROOT
 
Constructor Summary
Build()
           
 
Method Summary
 void addBuildDependency(BuildDependency buildDependency)
          Adds one #BuildDependency to build dependencies list
 void addStatus(PromotionStatus promotionStatus)
           
static java.lang.String formatBuildStarted(long timestamp)
          Formats the timestamp to the ISO date time string format expected by the build info API.
 Agent getAgent()
          Returns the agent that triggered the build (e.g.
 java.lang.String getArtifactoryPrincipal()
          Returns the Artifactory principal of the build
 BuildAgent getBuildAgent()
          Returns the agent that executed the build (e.g.
 java.util.List<BuildDependency> getBuildDependencies()
          Returns the build dependencies of this build
 BuildRetention getBuildRetention()
           
 long getDurationMillis()
          Returns the duration milliseconds of the build
 Governance getGovernance()
           
 Issues getIssues()
           
 LicenseControl getLicenseControl()
           
 Module getModule(java.lang.String moduleId)
          Returns the module object by the given ID
 java.util.List<Module> getModules()
          Returns the modules of the build
 java.lang.String getName()
          Returns the name of the build
 java.lang.String getNumber()
          Returns the number of the build
 java.lang.String getParentBuildId()
          Deprecated. Use getParentName() and getParentNumber() instead.
 java.lang.String getParentName()
          Returns the name of the parent build
 java.lang.String getParentNumber()
          Returns the number of the parent build
 java.lang.String getPrincipal()
          Returns the principal of the build
 java.lang.String getStarted()
          Returns the started time of the build
 java.util.List<PromotionStatus> getStatuses()
           
 BuildType getType()
          Deprecated. Use getBuildAgent() instead.
 java.lang.String getUrl()
          Returns the URL of the build
 java.lang.String getVcsRevision()
          Returns the vcs revision (format is vcs specific)
 java.lang.String getVersion()
          Returns the version of the build
 void setAgent(Agent agent)
          Sets the agent that triggered the build
 void setArtifactoryPrincipal(java.lang.String artifactoryPrincipal)
          Sets the Artifactory principal of the build
 void setBuildAgent(BuildAgent buildAgent)
          Sets the agent that executed the build
 void setBuildDependencies(java.util.List<BuildDependency> buildDependencies)
          Sets build dependencies for this build
 void setBuildRetention(BuildRetention buildRetention)
           
 void setDurationMillis(long durationMillis)
          Sets the duration milliseconds of the build
 void setGovernance(Governance governance)
           
 void setIssues(Issues issues)
           
 void setLicenseControl(LicenseControl licenseControl)
           
 void setModules(java.util.List<Module> modules)
          Sets the modules of the build
 void setName(java.lang.String name)
          Sets the name of the build
 void setNumber(java.lang.String number)
          Sets the number of the build
 void setParentBuildId(java.lang.String parentBuildId)
          Deprecated. Use setParentName(String) and setParentNumber(String) instead.
 void setParentName(java.lang.String parentName)
          Sets the name of the parent build
 void setParentNumber(java.lang.String parentNumber)
          Sets the number of the parent build
 void setPrincipal(java.lang.String principal)
          Sets the principal of the build
 void setStarted(java.lang.String started)
          Sets the started time of the build
 void setStartedDate(java.util.Date startedDate)
          Sets the build start time
 void setStatuses(java.util.List<PromotionStatus> statuses)
           
 void setType(BuildType type)
          Deprecated. Use setBuildAgent(BuildAgent) instead.
 void setUrl(java.lang.String url)
          Sets the URL of the build
 void setVcsRevision(java.lang.String vcsRevision)
          Sets the vcs revision (format is vcs specific)
 void setVersion(java.lang.String version)
          Sets the version of the build
 
Methods inherited from class org.jfrog.build.api.BaseBuildBean
getProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTED_FORMAT

public static final java.lang.String STARTED_FORMAT
See Also:
Constant Field Values
Constructor Detail

Build

public Build()
Method Detail

getVersion

public java.lang.String getVersion()
Returns the version of the build

Returns:
Build version

setVersion

public void setVersion(java.lang.String version)
Sets the version of the build

Parameters:
version - Build version

getName

public java.lang.String getName()
Returns the name of the build

Returns:
Build name

setName

public void setName(java.lang.String name)
Sets the name of the build

Parameters:
name - Build name

getNumber

public java.lang.String getNumber()
Returns the number of the build

Returns:
Build number

setNumber

public void setNumber(java.lang.String number)
Sets the number of the build

Parameters:
number - Build number

getParentName

public java.lang.String getParentName()
Returns the name of the parent build

Returns:
Parent build name

setParentName

public void setParentName(java.lang.String parentName)
Sets the name of the parent build

Parameters:
parentName - Parent build number

getParentNumber

public java.lang.String getParentNumber()
Returns the number of the parent build

Returns:
Parent build number

setParentNumber

public void setParentNumber(java.lang.String parentNumber)
Sets the number of the parent build

Parameters:
parentNumber - Parent build number

getVcsRevision

public java.lang.String getVcsRevision()
Returns the vcs revision (format is vcs specific)

Returns:
The vcs revision

setVcsRevision

public void setVcsRevision(java.lang.String vcsRevision)
Sets the vcs revision (format is vcs specific)

Parameters:
vcsRevision - The vcs revision

getType

@Deprecated
public BuildType getType()
Deprecated. Use getBuildAgent() instead.

Returns the type of the build

Returns:
Build type

setType

@Deprecated
public void setType(BuildType type)
Deprecated. Use setBuildAgent(BuildAgent) instead.

Sets the type of the build

Parameters:
type - Build type

getAgent

public Agent getAgent()
Returns the agent that triggered the build (e.g. Hudson, TeamCity etc.). In case that the build was triggered by the build agent itself, this value would be equal to the getBuildAgent()

Returns:
Triggering agent

setAgent

public void setAgent(Agent agent)
Sets the agent that triggered the build

Parameters:
agent - Triggering agent

getBuildAgent

public BuildAgent getBuildAgent()
Returns the agent that executed the build (e.g. Maven, Ant/Ivy, Gradle etc.)

Returns:
Build agent

setBuildAgent

public void setBuildAgent(BuildAgent buildAgent)
Sets the agent that executed the build

Parameters:
buildAgent - Executing agent

getStarted

public java.lang.String getStarted()
Returns the started time of the build

Returns:
Build started time

setStarted

public void setStarted(java.lang.String started)
Sets the started time of the build

Parameters:
started - Build started time

setStartedDate

public void setStartedDate(java.util.Date startedDate)
Sets the build start time

Parameters:
startedDate - Build start date to set

getDurationMillis

public long getDurationMillis()
Returns the duration milliseconds of the build

Returns:
Build duration milliseconds

setDurationMillis

public void setDurationMillis(long durationMillis)
Sets the duration milliseconds of the build

Parameters:
durationMillis - Build duration milliseconds

getPrincipal

public java.lang.String getPrincipal()
Returns the principal of the build

Returns:
Build principal

setPrincipal

public void setPrincipal(java.lang.String principal)
Sets the principal of the build

Parameters:
principal - Build principal

getArtifactoryPrincipal

public java.lang.String getArtifactoryPrincipal()
Returns the Artifactory principal of the build

Returns:
Build Artifactory principal

setArtifactoryPrincipal

public void setArtifactoryPrincipal(java.lang.String artifactoryPrincipal)
Sets the Artifactory principal of the build

Parameters:
artifactoryPrincipal - Build Artifactory principal

getUrl

public java.lang.String getUrl()
Returns the URL of the build

Returns:
Build URL

setUrl

public void setUrl(java.lang.String url)
Sets the URL of the build

Parameters:
url - Build URL

getParentBuildId

@Deprecated
public java.lang.String getParentBuildId()
Deprecated. Use getParentName() and getParentNumber() instead.

Returns the parent build ID of the build

Returns:
Build parent build ID

setParentBuildId

@Deprecated
public void setParentBuildId(java.lang.String parentBuildId)
Deprecated. Use setParentName(String) and setParentNumber(String) instead.

Sets the parent build ID of the build

Parameters:
parentBuildId - Build parent build ID

getModules

public java.util.List<Module> getModules()
Returns the modules of the build

Returns:
Build modules

setModules

public void setModules(java.util.List<Module> modules)
Sets the modules of the build

Parameters:
modules - Build modules

getModule

public Module getModule(java.lang.String moduleId)
Returns the module object by the given ID

Parameters:
moduleId - ID of module to locate
Returns:
Module object if found. Null if not

getLicenseControl

public LicenseControl getLicenseControl()

setLicenseControl

public void setLicenseControl(LicenseControl licenseControl)

setBuildRetention

public void setBuildRetention(BuildRetention buildRetention)

getBuildRetention

public BuildRetention getBuildRetention()

getStatuses

public java.util.List<PromotionStatus> getStatuses()

addStatus

public void addStatus(PromotionStatus promotionStatus)

setStatuses

public void setStatuses(java.util.List<PromotionStatus> statuses)

formatBuildStarted

public static java.lang.String formatBuildStarted(long timestamp)
Formats the timestamp to the ISO date time string format expected by the build info API.

Parameters:
timestamp - The build start time timestamp
Returns:
ISO date time formatted string

getBuildDependencies

public java.util.List<BuildDependency> getBuildDependencies()
Returns the build dependencies of this build

Returns:
list of #BuildDependency objects

addBuildDependency

public void addBuildDependency(BuildDependency buildDependency)
Adds one #BuildDependency to build dependencies list

Parameters:
buildDependency - the #BuildDependency to add

setBuildDependencies

public void setBuildDependencies(java.util.List<BuildDependency> buildDependencies)
Sets build dependencies for this build

Parameters:
buildDependencies - List of #BuildDependency objects

getIssues

public Issues getIssues()

setIssues

public void setIssues(Issues issues)

getGovernance

public Governance getGovernance()

setGovernance

public void setGovernance(Governance governance)