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>
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, buildDefinition, immutableResultsSummaryAccessor
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
ConstructorDescriptionImmutableJobImpl
(ImmutableChain parent, ImmutableChainStage stage, Job job, BuildLoggerManager buildLoggerManager, LabelDao labelDao, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager) ImmutableJobImpl
(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long, EnrichedPlanDto> jobsGroupedById, boolean isLightWeight) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableJobImpl
createImmutableJobBasedOnFlatData
(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long, EnrichedPlanDto> jobsGroupedById, boolean isLightWeight) @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactDefinition>
@NotNull com.google.common.collect.ImmutableList<ImmutableArtifactSubscription>
@NotNull BuildDefinition
Returns theBuildDefinition
that backs thisPlan
@NotNull String
@NotNull RequirementSet
Return effective value ofRequirementSet
, that is value that is considered when checking which agents and elastic images can build this Buildable.@NotNull List<VariableDefinition>
Return effective list ofVariableDefinition
s bind to this Plan.Get the latest finished resultReturn the master plan if one exists.@NotNull ImmutableChain
@NotNull RequirementSet
@NotNull ImmutableChainStage
getStage()
TheChainStage
that thisJob
is a member of@NotNull List<TaskDefinition>
@NotNull List<VariableDefinition>
Return list ofVariableDefinition
s bind to this Planboolean
isActive()
Is the plan queued or building?boolean
isBusy()
Is thePlan
"busy".boolean
Is part of divergent branch.boolean
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 Details
-
ImmutableJobImpl
public ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, Job job, BuildLoggerManager buildLoggerManager, LabelDao labelDao, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager) -
ImmutableJobImpl
public ImmutableJobImpl(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long, EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
-
-
Method Details
-
createImmutableJobBasedOnFlatData
public static ImmutableJobImpl createImmutableJobBasedOnFlatData(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, Map<Long, EnrichedPlanDto> jobsGroupedById, boolean isLightWeight) -
getParent
- Specified by:
getParent
in interfaceImmutableJob
-
getStage
Description copied from interface:ImmutableJob
TheChainStage
that thisJob
is a member of- Specified by:
getStage
in interfaceImmutableJob
- Returns:
- stage
-
getRequirementSet
- Specified by:
getRequirementSet
in interfaceImmutableBuildable
- Specified by:
getRequirementSet
in interfaceImmutableJob
-
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
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
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
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
- 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
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
Description copied from interface:ImmutablePlan
Returns theBuildDefinition
that backs thisPlan
- Specified by:
getBuildDefinition
in interfaceImmutablePlan
- Overrides:
getBuildDefinition
in classAbstractImmutablePlan
- Returns:
BuildDefinition
object.
-
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
-