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 ImmutableJobImplcreateImmutableJobBasedOnFlatData(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 BuildDefinitiongetBuildDefinition()Returns theBuildDefinitionthat backs thisPlan@NotNull StringgetCurrentStatus()@NotNull RequirementSetgetEffectiveRequirementSet()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 ofVariableDefinitions bind to this Plan.ResultsSummarygetLatestResultsSummary()Get the latest finished resultImmutableJobgetMaster()Return the master plan if one exists.@NotNull ImmutableChaingetParent()@NotNull RequirementSetgetRequirementSet()@NotNull ImmutableChainStagegetStage()TheChainStagethat thisJobis a member of@NotNull List<TaskDefinition>getTaskDefinitions()@NotNull List<VariableDefinition>getVariables()Return list ofVariableDefinitions bind to this PlanbooleanisActive()Is the plan queued or building?booleanisBusy()Is thePlan"busy".booleanisDivergent()Is part of divergent branch.booleanisExecuting()Is the build currently being executed?voidresetLatestResultsSummary(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:
getParentin interfaceImmutableJob
-
getStage
@NotNull public @NotNull ImmutableChainStage getStage()
Description copied from interface:ImmutableJobTheChainStagethat thisJobis a member of- Specified by:
getStagein interfaceImmutableJob- Returns:
- stage
-
getRequirementSet
@NotNull public @NotNull RequirementSet getRequirementSet()
- Specified by:
getRequirementSetin interfaceImmutableBuildable- Specified by:
getRequirementSetin interfaceImmutableJob
-
getEffectiveRequirementSet
@NotNull public @NotNull RequirementSet getEffectiveRequirementSet()
Description copied from interface:ImmutableJobReturn effective value ofRequirementSet, that is value that is considered when checking which agents and elastic images can build this Buildable.- Specified by:
getEffectiveRequirementSetin interfaceImmutableBuildable- Specified by:
getEffectiveRequirementSetin 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:ImmutablePlanReturn list ofVariableDefinitions bind to this Plan- Specified by:
getVariablesin interfaceImmutablePlan- Overrides:
getVariablesin classAbstractImmutablePlan- Returns:
- non-null list of
VariableDefinition
-
getEffectiveVariables
@NotNull public @NotNull List<VariableDefinition> getEffectiveVariables()
Description copied from interface:ImmutablePlanReturn effective list ofVariableDefinitions 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:
getEffectiveVariablesin interfaceImmutablePlan- Overrides:
getEffectiveVariablesin classAbstractImmutablePlan- Returns:
- non-null list of
VariableDefinition
-
getMaster
public ImmutableJob 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- Returns:
- the master
Planif one exists.
-
isBusy
public boolean isBusy()
Description copied from interface:ImmutablePlanIs 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:
isBusyin interfaceImmutablePlan- Returns:
- busy
-
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- Overrides:
getCurrentStatusin 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:ImmutablePlanIs the build currently being executed?- Specified by:
isExecutingin interfaceImmutablePlan- Returns:
- true if build is being executed
-
getLatestResultsSummary
public ResultsSummary getLatestResultsSummary()
Description copied from interface:ImmutablePlanGet the latest finished result- Specified by:
getLatestResultsSummaryin 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:
resetLatestResultsSummaryin classAbstractImmutablePlan
-
getArtifactDefinitions
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactDefinition> getArtifactDefinitions()
- Specified by:
getArtifactDefinitionsin interfaceImmutableJob- Returns:
- list of produced artifacts
-
getArtifactSubscriptions
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactSubscription> getArtifactSubscriptions()
- Specified by:
getArtifactSubscriptionsin interfaceImmutableJob- Returns:
- list of artifact subscriptions
-
getBuildDefinition
@NotNull public @NotNull BuildDefinition getBuildDefinition()
Description copied from interface:ImmutablePlanReturns theBuildDefinitionthat backs thisPlan- Specified by:
getBuildDefinitionin interfaceImmutablePlan- Overrides:
getBuildDefinitionin classAbstractImmutablePlan- Returns:
BuildDefinitionobject.
-
getTaskDefinitions
@NotNull public @NotNull List<TaskDefinition> getTaskDefinitions()
- Specified by:
getTaskDefinitionsin interfaceTaskContainer- Returns:
- an ordered list of taskDefinitions for this container.
-
isDivergent
public boolean isDivergent()
Description copied from interface:ImmutableJobIs part of divergent branch.- Specified by:
isDivergentin interfaceImmutableJob
-
-