Package com.atlassian.bamboo.plan.cache
Class AbstractImmutableChain
java.lang.Object
com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
com.atlassian.bamboo.plan.cache.AbstractImmutableChain
- All Implemented Interfaces:
BambooIdProvider
,ImmutableEntityWithOid
,ImmutableChain
,ImmutableDeletable
,ImmutablePlan
,PlanIdentifier
,PlanKeyProvider
,Triggerable
,DescriptionProvider
,NameProvider
,Versionable
,Comparable<ImmutablePlan>
- Direct Known Subclasses:
ImmutableChainBranchImpl
,ImmutableChainImpl
public abstract class AbstractImmutableChain
extends AbstractImmutablePlan
implements ImmutableChain
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
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
ModifierConstructorDescriptionprotected
AbstractImmutableChain
(EnrichedPlanDto dto, ImmutableChain masterChain, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) protected
AbstractImmutableChain
(EnrichedPlanDto dto, Pair<ImmutableChain, EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsStage
(@Nullable String stageName) Checks whether or not a stage exists in this chain by stage name.@NotNull com.google.common.collect.ImmutableList<ImmutableJob>
Get list of jobs sorted by - stage order - job name (case insensitive)@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>
Get Stages of the Chain@NotNull Date
int
Note: Does not include Jobs that are marked for deletion.@Nullable PlanResultKey
Get the latest result key including active (not finished) resultsGet the latest finished resultReturn the master plan if one exists.Get notifications defined for this plan.@NotNull List<PlanRepositoryDefinition>
Return list of repositories available to the chain.@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>
Get Stages of the chain.@NotNull List<TriggerDefinition>
@Nullable ImmutableVcsBambooSpecsSource
boolean
isActive()
Is the plan queued or building?boolean
isBusy()
Is thePlan
"busy".boolean
Is the build currently being executed?boolean
void
resetLatestResultsSummary
(int latestKnownBuildNumber, boolean resetAverageBuildDuration) Invalidates the latest result summary for planvoid
Invalidate repository list.void
void
resetVcsBambooSpecsSource
(@Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource) Invalidates specs source.Methods inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
compareTo, equals, exceptionOnModification, getAverageBuildDuration, getBuildDefinition, getBuildKey, getBuildLogger, getBuildName, getCurrentStatus, getDatabaseId, getDescription, getEffectiveVariables, getFirstBuildNumber, getId, getKey, getLabellings, getLabelNames, getLastBuildNumber, getMasterId, getMasterIdIfExists, getName, getOid, getPlanKey, getPlanType, getProject, getRelatedLabellings, getType, getVariables, 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.plan.cache.ImmutableChain
getEntityType
Methods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOid
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildDefinition, getBuildLogger, getCurrentStatus, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, getVariables, 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
-
AbstractImmutableChain
protected AbstractImmutableChain(EnrichedPlanDto dto, ImmutableChain masterChain, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) -
AbstractImmutableChain
protected AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain, EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
-
Method Details
-
isActive
public boolean isActive()Description copied from interface:ImmutablePlan
Is the plan queued or building?- Specified by:
isActive
in interfaceImmutablePlan
-
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
-
getLastResultKey
Description copied from interface:ImmutableChain
Get the latest result key including active (not finished) results- Specified by:
getLastResultKey
in interfaceImmutableChain
- Returns:
- The key of the last build. Returns null if there are no build results for this plan
-
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
@Internal public void resetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration) Invalidates the latest result summary for plan- Specified by:
resetLatestResultsSummary
in classAbstractImmutablePlan
-
resetVcsBambooSpecsSource
@Internal public void resetVcsBambooSpecsSource(@Nullable @Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource) Invalidates specs source. -
resetVcsBambooSpecsSource
@Internal public void resetVcsBambooSpecsSource() -
resetPlanRepositoryDefinitions
@Internal public void resetPlanRepositoryDefinitions()Invalidate repository list. -
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
-
getStages
Description copied from interface:ImmutableChain
Get Stages of the chain.Note that this excludes
ChainStage
s that have been marked for deletion- Specified by:
getStages
in interfaceImmutableChain
- Returns:
- stages
-
getAllStages
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableChainStage> getAllStages()Description copied from interface:ImmutableChain
Get Stages of the ChainNote that this includes
ChainStage
s that have been marked for deletion- Specified by:
getAllStages
in interfaceImmutableChain
- Returns:
- stages
-
getJobCount
public int getJobCount()Description copied from interface:ImmutableChain
Note: Does not include Jobs that are marked for deletion.- Specified by:
getJobCount
in interfaceImmutableChain
- Returns:
- how many Jobs are currently contained within this chain
-
getAllJobs
Get list of jobs sorted by - stage order - job name (case insensitive)- Specified by:
getAllJobs
in interfaceImmutableChain
- Returns:
- sorted list of Jobs in the Plan
-
containsStage
Description copied from interface:ImmutableChain
Checks whether or not a stage exists in this chain by stage name.- Specified by:
containsStage
in interfaceImmutableChain
- Parameters:
stageName
- to check for- Returns:
- true if a stage with the given name exists, otherwise false
-
getPlanRepositoryDefinitions
Description copied from interface:ImmutableChain
Return list of repositories available to the chain. In case of non-master object it will return list of master's repository definitions with default repository overridden by a private copy of default repository.- Specified by:
getPlanRepositoryDefinitions
in interfaceImmutableChain
- Returns:
- ordered
List
of repositories available to this plan
-
getNotificationSet
Description copied from interface:ImmutableChain
Get notifications defined for this plan.- Specified by:
getNotificationSet
in interfaceImmutableChain
- Returns:
NotificationSet
containing notifications for this plan.
-
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 interfaceImmutableChain
- Specified by:
getMaster
in interfaceImmutablePlan
- Returns:
- the master
Plan
if one exists.
-
isSuspended
public boolean isSuspended()- Specified by:
isSuspended
in interfaceTriggerable
- Returns:
- true if automatic triggering is switched off for this object
-
getTriggerDefinitions
- Specified by:
getTriggerDefinitions
in interfaceTriggerable
- Returns:
- immutable list of all triggers defined for this object
-
getStorageTag
- Specified by:
getStorageTag
in interfaceImmutableChain
-
getVcsBambooSpecsSource
- Specified by:
getVcsBambooSpecsSource
in interfaceImmutableChain
- Returns:
- specs source used to manage this plan, or null if plan is not managed by RSS
-
getCreationDate
- Specified by:
getCreationDate
in interfaceImmutableChain
- Returns:
- chain creation date
-