Package com.atlassian.bamboo.build
Class DefaultJob
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
Buildable
,Job
,BambooIdProvider
,BambooObject
,BambooObjectWithOid
,EntityWithOid
,ImmutableEntityWithOid
,Deletable
,Describable
,ImmutableBuildable
,ImmutableDeletable
,ImmutableJob
,ImmutablePlan
,Plan
,PlanIdentifier
,PlanKeyProvider
,TaskContainer
,DescriptionProvider
,NameProvider
,Versionable
,VersionedEntityComponent<Chain>
,Cloneable
,Comparable<Plan>
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plan.AbstractPlan
internalResultsSummaryAccessor
Fields inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
Fields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITER
Fields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull List<ArtifactDefinition>
@NotNull List<ArtifactSubscription>
long
Returns an average duration of the recent builds@NotNull String
@NotNull RequirementSet
Return effective value ofRequirementSet
, that is value that is considered when checking which agents, elastic images and ephemeral templates can build this Buildable.Return the master plan if one exists.@NotNull String
getName()
Returns the full name for the build in the form of "project name - build name" e.g.@NotNull Chain
@NotNull PlanType
@NotNull RequirementSet
@Nullable Chain
getRoot()
Returns the versioned root of the object.@NotNull ChainStage
getStage()
TheChainStage
that thisJob
is a member of@NotNull List<TaskDefinition>
boolean
isActive()
Is the plan queued or building?boolean
Is part of divergent branch.boolean
Is the build currently being executed?void
setArtifactDefinitionManager
(ArtifactDefinitionManager artifactDefinitionManager) void
setArtifactSubscriptionManager
(ArtifactSubscriptionManager artifactSubscriptionManager) void
setBuildExecutionManager
(BuildExecutionManager buildExecutionManager) void
Set which plan is the master of this plan.void
setRequirementSet
(RequirementSet requirementSet) void
setStage
(@Nullable ChainStage chainStage) Methods inherited from class com.atlassian.bamboo.plan.AbstractPlan
compareTo, equals, getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getDatabaseId, getDescription, getDiscriminator, getEffectiveVariables, getFirstBuildNumber, getKey, getLabellings, getLabelNames, getLastBuildNumber, getLatestResultsSummary, getMasterId, getMasterIdIfExists, getPlanKey, getProject, getRelatedLabellings, getType, getVariables, getVersion, hashCode, hasMaster, isBusy, isMarkedForDeletion, isSuspendedFromBuilding, setBuildDefinitionManager, setBuildDefinitionXml, setBuildKey, setBuildLoggerManager, setBuildName, setDescription, setDiscriminator, setInternalResultsSummaryAccessor, setKey, setLabellings, setLabelManager, setMarkedForDeletion, setName, setPlanExecutionManager, setPlanKey, setProject, setSuspendedFromBuilding, setVariableDefinitionManager, setVersion
Methods inherited from class com.atlassian.bamboo.hibernate.HibernateBambooEntityWithOid
getId, getOid, setId, setOid
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
Methods inherited from interface com.atlassian.bamboo.deletion.Deletable
setMarkedForDeletion
Methods inherited from interface com.atlassian.bamboo.Describable
setDescription, setName
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
Methods inherited from interface com.atlassian.bamboo.core.EntityWithOid
setOid
Methods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOid
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableJob
getEntityType
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getBuildDefinition, getBuildLogger, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, getVariables, hasMaster, isBusy, isMarkedForDeletion
Methods inherited from interface com.atlassian.bamboo.plan.Plan
getBuildDefinitionXml, getLabellings, getLatestResultsSummary, getRelatedLabellings, setBuildDefinitionXml, setBuildKey, setBuildName, setKey, setLabellings, setPlanKey, setProject, setSuspendedFromBuilding
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getDatabaseId, getId, getMasterId, getMasterIdIfExists, getPlanKey, isSuspendedFromBuilding
Methods inherited from interface com.atlassian.bamboo.versioning.Versionable
getVersion
-
Field Details
-
NUMBER_OF_RESULTS
public static final int NUMBER_OF_RESULTS- See Also:
-
-
Constructor Details
-
DefaultJob
public DefaultJob()
-
-
Method Details
-
getTaskDefinitions
- Specified by:
getTaskDefinitions
in interfaceTaskContainer
- Returns:
- an ordered list of taskDefinitions for this container.
-
getPlanType
- Specified by:
getPlanType
in interfacePlanIdentifier
- Returns:
- the type of this plan
-
getName
Description copied from interface:PlanIdentifier
Returns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"- Specified by:
getName
in interfaceDescriptionProvider
- Specified by:
getName
in interfaceNameProvider
- Specified by:
getName
in interfacePlanIdentifier
- Overrides:
getName
in classAbstractPlan
- Returns:
- String
-
getParent
Description copied from interface:Job
- Specified by:
getParent
in interfaceImmutableJob
- Specified by:
getParent
in interfaceJob
- Returns:
- chain
-
getStage
Description copied from interface:Job
TheChainStage
that thisJob
is a member of- Specified by:
getStage
in interfaceImmutableJob
- Specified by:
getStage
in interfaceJob
- Returns:
- stage
-
setStage
-
getMaster
Description copied from interface:ImmutablePlan
Return the master plan if one exists. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.- Specified by:
getMaster
in interfaceImmutableJob
- Specified by:
getMaster
in interfaceImmutablePlan
- Specified by:
getMaster
in interfaceJob
- Returns:
- the master
Plan
if one exists.
-
setMaster
Description copied from interface:Plan
Set which plan is the master of this plan. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists. -
isActive
public boolean isActive()Description copied from interface:ImmutablePlan
Is the plan queued or building?- Specified by:
isActive
in interfaceImmutablePlan
-
getCurrentStatus
- Specified by:
getCurrentStatus
in interfaceImmutablePlan
- Returns:
- a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.
-
isExecuting
public boolean isExecuting()Description copied from interface:ImmutablePlan
Is the build currently being executed?- Specified by:
isExecuting
in interfaceImmutablePlan
- Returns:
- true if build is being executed
-
getArtifactDefinitions
- Specified by:
getArtifactDefinitions
in interfaceImmutableJob
- Specified by:
getArtifactDefinitions
in interfaceJob
- Returns:
- list of produced artifacts
-
getArtifactSubscriptions
- Specified by:
getArtifactSubscriptions
in interfaceImmutableJob
- Specified by:
getArtifactSubscriptions
in interfaceJob
- Returns:
- list of artifact subscriptions
-
getAverageBuildDuration
public long getAverageBuildDuration()Description copied from interface:ImmutablePlan
Returns an average duration of the recent builds- Specified by:
getAverageBuildDuration
in interfaceImmutablePlan
- Returns:
- The duration in milliseconds
-
getRequirementSet
- Specified by:
getRequirementSet
in interfaceImmutableBuildable
- Specified by:
getRequirementSet
in interfaceImmutableJob
-
setRequirementSet
- Specified by:
setRequirementSet
in interfaceBuildable
-
getEffectiveRequirementSet
Description copied from interface:ImmutableBuildable
Return effective value ofRequirementSet
, that is value that is considered when checking which agents, elastic images and ephemeral templates can build this Buildable.- Specified by:
getEffectiveRequirementSet
in interfaceImmutableBuildable
- Specified by:
getEffectiveRequirementSet
in interfaceImmutableJob
- Returns:
- the same as
ImmutableBuildable.getRequirementSet()
ifImmutablePlan.hasMaster()
is false, getMaster().getRequirementSet() otherwise.
-
setBuildExecutionManager
-
setArtifactDefinitionManager
-
setArtifactSubscriptionManager
-
isDivergent
public boolean isDivergent()Description copied from interface:ImmutableJob
Is part of divergent branch.- Specified by:
isDivergent
in interfaceImmutableJob
-
getRoot
Description copied from interface:VersionedEntityComponent
Returns the versioned root of the object.- Specified by:
getRoot
in interfaceVersionedEntityComponent<Chain>
- Returns:
- the root of the object
-