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, immutableResultsSummaryAccessorFields 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_SUCCESSFields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITERFields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableJobImplcreateImmutableJobBasedOnFlatData(ImmutableChain parent, ImmutableChainStage stage, EnrichedPlanDto dto, BuildLoggerManager buildLoggerManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, ImmutableArtifactManager immutableArtifactManager, RequirementManager requirementManager, BuildDefinitionManager buildDefinitionManager, boolean isLightWeight) static ImmutableJobImplcreateLightweightImmutableJob(ImmutableChain parent, ImmutableChainStage stage, ImmutableJob job, BuildLoggerManager buildLoggerManager, LabelDao labelDao, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager) @NotNull com.google.common.collect.ImmutableList<ImmutableArtifactDefinition>@NotNull com.google.common.collect.ImmutableList<ImmutableArtifactSubscription>@NotNull BuildDefinitionReturns theBuildDefinitionthat backs thisPlan@NotNull String@NotNull RequirementSetReturn 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 ofVariableDefinitions bind to this Plan.Get the latest finished resultReturn the master plan if one exists.@NotNull ImmutableChain@NotNull RequirementSet@NotNull ImmutableChainStagegetStage()TheChainStagethat thisJobis a member of@NotNull List<TaskDefinition>@NotNull List<VariableDefinition>Return list ofVariableDefinitions bind to this PlanbooleanisActive()Is the plan queued or building?booleanisBusy()Is thePlan"busy".booleanIs part of divergent branch.booleanIs 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, resetLatestResultsSummaryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescriptionMethods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOidMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableJob
getEntityTypeMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildLogger, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, hasMaster, isMarkedForDeletionMethods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getDatabaseId, getId, getMasterId, getMasterIdIfExists, getName, getPlanKey, getPlanType, isSuspendedFromBuildingMethods inherited from interface com.atlassian.bamboo.versioning.Versionable
getVersion
-
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, boolean isLightWeight) -
createLightweightImmutableJob
public static ImmutableJobImpl createLightweightImmutableJob(ImmutableChain parent, ImmutableChainStage stage, ImmutableJob job, BuildLoggerManager buildLoggerManager, LabelDao labelDao, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, BuildDefinition buildDefinition, CachedPlanManager cachedPlanManager, ImmutableArtifactManager immutableArtifactManager) -
getParent
- Specified by:
getParentin interfaceImmutableJob
-
getStage
Description copied from interface:ImmutableJobTheChainStagethat thisJobis a member of- Specified by:
getStagein interfaceImmutableJob- Returns:
- stage
-
getRequirementSet
- Specified by:
getRequirementSetin interfaceImmutableBuildable- Specified by:
getRequirementSetin interfaceImmutableJob
-
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
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
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
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
- 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
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
Description copied from interface:ImmutablePlanReturns theBuildDefinitionthat backs thisPlan- Specified by:
getBuildDefinitionin interfaceImmutablePlan- Overrides:
getBuildDefinitionin classAbstractImmutablePlan- Returns:
BuildDefinitionobject.
-
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
-