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>
@Entity public class DefaultJob extends AbstractPlan implements Job, Buildable
-
-
Field Summary
Fields Modifier and Type Field Description static int
NUMBER_OF_RESULTS
-
Fields inherited from class com.atlassian.bamboo.plan.AbstractPlan
resultsSummaryManager
-
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
Constructors Constructor Description DefaultJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<ArtifactDefinition>
getArtifactDefinitions()
@NotNull List<ArtifactSubscription>
getArtifactSubscriptions()
long
getAverageBuildDuration()
Returns an average duration of the recent buildsBuildResultsSummaryManager
getBuildResultsSummaryManager()
@NotNull String
getCurrentStatus()
@NotNull RequirementSet
getEffectiveRequirementSet()
Return effective value ofRequirementSet
, that is value that is considered when checking which agents, elastic images and ephemeral templates can build this Buildable.Job
getMaster()
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
getParent()
@NotNull PlanType
getPlanType()
@NotNull RequirementSet
getRequirementSet()
@Nullable Chain
getRoot()
Returns the versioned root of the object.@NotNull ChainStage
getStage()
TheChainStage
that thisJob
is a member of@NotNull List<TaskDefinition>
getTaskDefinitions()
boolean
isActive()
Is the plan queued or building?boolean
isDivergent()
Is part of divergent branch.boolean
isExecuting()
Is the build currently being executed?void
setArtifactDefinitionManager(ArtifactDefinitionManager artifactDefinitionManager)
void
setArtifactSubscriptionManager(ArtifactSubscriptionManager artifactSubscriptionManager)
void
setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
void
setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
void
setMaster(Plan master)
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, setKey, setLabellings, setLabelManager, setMarkedForDeletion, setName, setPlanExecutionManager, setPlanKey, setProject, setResultsSummaryManager, 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 Detail
-
NUMBER_OF_RESULTS
public static final int NUMBER_OF_RESULTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTaskDefinitions
@NotNull public @NotNull List<TaskDefinition> getTaskDefinitions()
- Specified by:
getTaskDefinitions
in interfaceTaskContainer
- Returns:
- an ordered list of taskDefinitions for this container.
-
getPlanType
@NotNull public @NotNull PlanType getPlanType()
- Specified by:
getPlanType
in interfacePlanIdentifier
- Returns:
- the type of this plan
-
getName
@NotNull public @NotNull String 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
@NotNull public @NotNull Chain getParent()
Description copied from interface:Job
- Specified by:
getParent
in interfaceImmutableJob
- Specified by:
getParent
in interfaceJob
- Returns:
- chain
-
getStage
@NotNull public @NotNull ChainStage 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
public void setStage(@Nullable @Nullable ChainStage chainStage)
-
getMaster
public Job 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
public void setMaster(Plan master)
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
@NotNull public @NotNull String 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
@NotNull public @NotNull List<ArtifactDefinition> getArtifactDefinitions()
- Specified by:
getArtifactDefinitions
in interfaceImmutableJob
- Specified by:
getArtifactDefinitions
in interfaceJob
- Returns:
- list of produced artifacts
-
getArtifactSubscriptions
@NotNull public @NotNull List<ArtifactSubscription> 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
@NotNull public @NotNull RequirementSet getRequirementSet()
- Specified by:
getRequirementSet
in interfaceImmutableBuildable
- Specified by:
getRequirementSet
in interfaceImmutableJob
-
setRequirementSet
public void setRequirementSet(RequirementSet requirementSet)
- Specified by:
setRequirementSet
in interfaceBuildable
-
getEffectiveRequirementSet
@NotNull public @NotNull RequirementSet 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.
-
setBuildResultsSummaryManager
public void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
-
getBuildResultsSummaryManager
public BuildResultsSummaryManager getBuildResultsSummaryManager()
-
setBuildExecutionManager
public void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
-
setArtifactDefinitionManager
public void setArtifactDefinitionManager(ArtifactDefinitionManager artifactDefinitionManager)
-
setArtifactSubscriptionManager
public void setArtifactSubscriptionManager(ArtifactSubscriptionManager artifactSubscriptionManager)
-
isDivergent
public boolean isDivergent()
Description copied from interface:ImmutableJob
Is part of divergent branch.- Specified by:
isDivergent
in interfaceImmutableJob
-
getRoot
@Nullable public @Nullable Chain 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
-
-