Package com.atlassian.bamboo.plan.cache
Class ImmutableJobImpl
- java.lang.Object
-
- com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
-
- com.atlassian.bamboo.plan.cache.ImmutableJobImpl
-
- All Implemented Interfaces:
BambooIdProvider
,ImmutableEntityWithOid
,ImmutableBuildable
,ImmutableDeletable
,ImmutableJob
,ImmutablePlan
,PlanIdentifier
,PlanKeyProvider
,TaskContainer
,DescriptionProvider
,NameProvider
,Versionable
,Comparable<ImmutablePlan>
public class ImmutableJobImpl extends AbstractImmutablePlan implements ImmutableJob
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, buildDefinition, 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 ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, Job job, BuildLoggerManager buildLoggerManager, LabelManager labelManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager)
ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableJobImpl
createImmutableJobBasedOnFlatData(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
@NotNull com.google.common.collect.ImmutableList<ImmutableArtifactDefinition>
getArtifactDefinitions()
@NotNull com.google.common.collect.ImmutableList<ImmutableArtifactSubscription>
getArtifactSubscriptions()
@NotNull BuildDefinition
getBuildDefinition()
Returns theBuildDefinition
that backs thisPlan
@NotNull String
getCurrentStatus()
@NotNull RequirementSet
getEffectiveRequirementSet()
Return effective value ofRequirementSet
, that is value that is considered when checking which agents and elastic images can build this Buildable.@NotNull List<VariableDefinition>
getEffectiveVariables()
Return effective list ofVariableDefinition
s bind to this Plan.ResultsSummary
getLatestResultsSummary()
Get the latest finished resultImmutableJob
getMaster()
Return the master plan if one exists.@NotNull ImmutableChain
getParent()
@NotNull RequirementSet
getRequirementSet()
@NotNull ImmutableChainStage
getStage()
TheChainStage
that thisJob
is a member of@NotNull List<TaskDefinition>
getTaskDefinitions()
@NotNull List<VariableDefinition>
getVariables()
Return list ofVariableDefinition
s bind to this Planboolean
isActive()
Is the plan queued or building?boolean
isBusy()
Is thePlan
"busy".boolean
isDivergent()
Is part of divergent branch.boolean
isExecuting()
Is the build currently being executed?void
resetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration)
-
Methods inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
compareTo, equals, exceptionOnModification, getAverageBuildDuration, getBuildKey, getBuildLogger, getBuildName, getDatabaseId, getDescription, getFirstBuildNumber, getId, getKey, getLabellings, getLabelNames, getLastBuildNumber, getMasterId, getMasterIdIfExists, getName, getOid, getPlanKey, getPlanType, getProject, getRelatedLabellings, getType, getVersion, hashCode, hasMaster, isMarkedForDeletion, isSuspendedFromBuilding, resetLatestResultsSummary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
-
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
getAverageBuildDuration, getBuildLogger, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, hasMaster, isMarkedForDeletion
-
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getDatabaseId, getId, getMasterId, getMasterIdIfExists, getName, getPlanKey, getPlanType, isSuspendedFromBuilding
-
Methods inherited from interface com.atlassian.bamboo.versioning.Versionable
getVersion
-
-
-
-
Constructor Detail
-
ImmutableJobImpl
public ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, Job job, BuildLoggerManager buildLoggerManager, LabelManager labelManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager)
-
ImmutableJobImpl
public ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
-
-
Method Detail
-
createImmutableJobBasedOnFlatData
public static ImmutableJobImpl createImmutableJobBasedOnFlatData(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, ResultsSummaryManager resultsSummaryManager, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
-
getParent
@NotNull public @NotNull ImmutableChain getParent()
- Specified by:
getParent
in interfaceImmutableJob
-
getStage
@NotNull public @NotNull ImmutableChainStage getStage()
Description copied from interface:ImmutableJob
TheChainStage
that thisJob
is a member of- Specified by:
getStage
in interfaceImmutableJob
- Returns:
- stage
-
getRequirementSet
@NotNull public @NotNull RequirementSet getRequirementSet()
- Specified by:
getRequirementSet
in interfaceImmutableBuildable
- Specified by:
getRequirementSet
in interfaceImmutableJob
-
getEffectiveRequirementSet
@NotNull public @NotNull RequirementSet getEffectiveRequirementSet()
Description copied from interface:ImmutableJob
Return effective value ofRequirementSet
, that is value that is considered when checking which agents and elastic images can build this Buildable.- Specified by:
getEffectiveRequirementSet
in interfaceImmutableBuildable
- Specified by:
getEffectiveRequirementSet
in interfaceImmutableJob
- Returns:
- the same as
ImmutableJob.getRequirementSet()
ifImmutablePlan.hasMaster()
is false, getMaster().getRequirementSet() otherwise.
-
getVariables
@NotNull public @NotNull List<VariableDefinition> getVariables()
Description copied from interface:ImmutablePlan
Return list ofVariableDefinition
s bind to this Plan- Specified by:
getVariables
in interfaceImmutablePlan
- Overrides:
getVariables
in classAbstractImmutablePlan
- Returns:
- non-null list of
VariableDefinition
-
getEffectiveVariables
@NotNull public @NotNull List<VariableDefinition> getEffectiveVariables()
Description copied from interface:ImmutablePlan
Return effective list ofVariableDefinition
s bind to this Plan. For master Plans this will return the same result asImmutablePlan.getVariables()
. Non-master plans will produce the sum of: - all master's variables which keys do not appear in result ofImmutablePlan.getVariables()
- result ofImmutablePlan.getVariables()
- Specified by:
getEffectiveVariables
in interfaceImmutablePlan
- Overrides:
getEffectiveVariables
in classAbstractImmutablePlan
- Returns:
- non-null list of
VariableDefinition
-
getMaster
public ImmutableJob 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
- Returns:
- the master
Plan
if one exists.
-
isBusy
public boolean isBusy()
Description copied from interface:ImmutablePlan
Is thePlan
"busy". Busy is defined by the plan having a lock held on it. This is done during change detection, dependency listner and the like- Specified by:
isBusy
in interfaceImmutablePlan
- Returns:
- busy
-
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
- Overrides:
getCurrentStatus
in classAbstractImmutablePlan
- 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
-
getLatestResultsSummary
public ResultsSummary getLatestResultsSummary()
Description copied from interface:ImmutablePlan
Get the latest finished result- Specified by:
getLatestResultsSummary
in interfaceImmutablePlan
- Returns:
- The summary info for the last completed build. Returns null if there are no build results for this plan
-
resetLatestResultsSummary
public void resetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration)
- Specified by:
resetLatestResultsSummary
in classAbstractImmutablePlan
-
getArtifactDefinitions
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactDefinition> getArtifactDefinitions()
- Specified by:
getArtifactDefinitions
in interfaceImmutableJob
- Returns:
- list of produced artifacts
-
getArtifactSubscriptions
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactSubscription> getArtifactSubscriptions()
- Specified by:
getArtifactSubscriptions
in interfaceImmutableJob
- Returns:
- list of artifact subscriptions
-
getBuildDefinition
@NotNull public @NotNull BuildDefinition getBuildDefinition()
Description copied from interface:ImmutablePlan
Returns theBuildDefinition
that backs thisPlan
- Specified by:
getBuildDefinition
in interfaceImmutablePlan
- Overrides:
getBuildDefinition
in classAbstractImmutablePlan
- Returns:
BuildDefinition
object.
-
getTaskDefinitions
@NotNull public @NotNull List<TaskDefinition> getTaskDefinitions()
- Specified by:
getTaskDefinitions
in interfaceTaskContainer
- Returns:
- an ordered list of taskDefinitions for this container.
-
isDivergent
public boolean isDivergent()
Description copied from interface:ImmutableJob
Is part of divergent branch.- Specified by:
isDivergent
in interfaceImmutableJob
-
-