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 intNUMBER_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()longgetAverageBuildDuration()Returns an average duration of the recent buildsBuildResultsSummaryManagergetBuildResultsSummaryManager()@NotNull StringgetCurrentStatus()@NotNull RequirementSetgetEffectiveRequirementSet()Return effective value ofRequirementSet, that is value that is considered when checking which agents, elastic images and ephemeral templates can build this Buildable.JobgetMaster()Return the master plan if one exists.@NotNull StringgetName()Returns the full name for the build in the form of "project name - build name" e.g.@NotNull ChaingetParent()@NotNull PlanTypegetPlanType()@NotNull RequirementSetgetRequirementSet()@Nullable ChaingetRoot()Returns the versioned root of the object.@NotNull ChainStagegetStage()TheChainStagethat thisJobis a member of@NotNull List<TaskDefinition>getTaskDefinitions()booleanisActive()Is the plan queued or building?booleanisDivergent()Is part of divergent branch.booleanisExecuting()Is the build currently being executed?voidsetArtifactDefinitionManager(ArtifactDefinitionManager artifactDefinitionManager)voidsetArtifactSubscriptionManager(ArtifactSubscriptionManager artifactSubscriptionManager)voidsetBuildExecutionManager(BuildExecutionManager buildExecutionManager)voidsetBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)voidsetMaster(Plan master)Set which plan is the master of this plan.voidsetRequirementSet(RequirementSet requirementSet)voidsetStage(@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:
getTaskDefinitionsin interfaceTaskContainer- Returns:
- an ordered list of taskDefinitions for this container.
-
getPlanType
@NotNull public @NotNull PlanType getPlanType()
- Specified by:
getPlanTypein interfacePlanIdentifier- Returns:
- the type of this plan
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:PlanIdentifierReturns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"- Specified by:
getNamein interfaceDescriptionProvider- Specified by:
getNamein interfaceNameProvider- Specified by:
getNamein interfacePlanIdentifier- Overrides:
getNamein classAbstractPlan- Returns:
- String
-
getParent
@NotNull public @NotNull Chain getParent()
Description copied from interface:Job- Specified by:
getParentin interfaceImmutableJob- Specified by:
getParentin interfaceJob- Returns:
- chain
-
getStage
@NotNull public @NotNull ChainStage getStage()
Description copied from interface:JobTheChainStagethat thisJobis a member of- Specified by:
getStagein interfaceImmutableJob- Specified by:
getStagein interfaceJob- Returns:
- stage
-
setStage
public void setStage(@Nullable @Nullable ChainStage chainStage)
-
getMaster
public Job getMaster()
Description copied from interface:ImmutablePlanReturn 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:
getMasterin interfaceImmutableJob- Specified by:
getMasterin interfaceImmutablePlan- Specified by:
getMasterin interfaceJob- Returns:
- the master
Planif one exists.
-
setMaster
public void setMaster(Plan master)
Description copied from interface:PlanSet 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:ImmutablePlanIs the plan queued or building?- Specified by:
isActivein interfaceImmutablePlan
-
getCurrentStatus
@NotNull public @NotNull String getCurrentStatus()
- Specified by:
getCurrentStatusin 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:ImmutablePlanIs the build currently being executed?- Specified by:
isExecutingin interfaceImmutablePlan- Returns:
- true if build is being executed
-
getArtifactDefinitions
@NotNull public @NotNull List<ArtifactDefinition> getArtifactDefinitions()
- Specified by:
getArtifactDefinitionsin interfaceImmutableJob- Specified by:
getArtifactDefinitionsin interfaceJob- Returns:
- list of produced artifacts
-
getArtifactSubscriptions
@NotNull public @NotNull List<ArtifactSubscription> getArtifactSubscriptions()
- Specified by:
getArtifactSubscriptionsin interfaceImmutableJob- Specified by:
getArtifactSubscriptionsin interfaceJob- Returns:
- list of artifact subscriptions
-
getAverageBuildDuration
public long getAverageBuildDuration()
Description copied from interface:ImmutablePlanReturns an average duration of the recent builds- Specified by:
getAverageBuildDurationin interfaceImmutablePlan- Returns:
- The duration in milliseconds
-
getRequirementSet
@NotNull public @NotNull RequirementSet getRequirementSet()
- Specified by:
getRequirementSetin interfaceImmutableBuildable- Specified by:
getRequirementSetin interfaceImmutableJob
-
setRequirementSet
public void setRequirementSet(RequirementSet requirementSet)
- Specified by:
setRequirementSetin interfaceBuildable
-
getEffectiveRequirementSet
@NotNull public @NotNull RequirementSet getEffectiveRequirementSet()
Description copied from interface:ImmutableBuildableReturn effective value ofRequirementSet, that is value that is considered when checking which agents, elastic images and ephemeral templates can build this Buildable.- Specified by:
getEffectiveRequirementSetin interfaceImmutableBuildable- Specified by:
getEffectiveRequirementSetin 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:ImmutableJobIs part of divergent branch.- Specified by:
isDivergentin interfaceImmutableJob
-
getRoot
@Nullable public @Nullable Chain getRoot()
Description copied from interface:VersionedEntityComponentReturns the versioned root of the object.- Specified by:
getRootin interfaceVersionedEntityComponent<Chain>- Returns:
- the root of the object
-
-