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
Nested Classes Modifier and Type Class Description static class
AbstractImmutableChain.VcsBambooSpecsSourceResettableLazyReference
-
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 AbstractImmutableChain(@NotNull Chain chain, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, LabelManager labelManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, @NotNull BuildDefinition buildDefinition)
AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain,EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, Map<Long,EnrichedPlanDto> jobsGroupedById, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsStage(@Nullable String stageName)
Checks whether or not a stage exists in this chain by stage name.@NotNull com.google.common.collect.ImmutableList<ImmutableJob>
getAllJobs()
Get list of jobs sorted by - stage order - job name (case insensitive)@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>
getAllStages()
Get Stages of the Chain@NotNull Date
getCreationDate()
@NotNull com.google.common.collect.ImmutableList<RepositoryDefinition>
getEffectiveRepositoryDefinitions()
Return list of repositories available to the chain.int
getJobCount()
Note: Does not include Jobs that are marked for deletion.@Nullable PlanResultKey
getLastResultKey()
Get the latest result key including active (not finished) resultsImmutableResultsSummary
getLatestResultsSummary()
Get the latest finished resultImmutableChain
getMaster()
Return the master plan if one exists.NotificationSet
getNotificationSet()
Get notifications defined for this plan.@NotNull List<PlanRepositoryDefinition>
getPlanRepositoryDefinitions()
Return list of repositories available to the chain.@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>
getStages()
Get Stages of the chain.ChainStorageTag
getStorageTag()
@NotNull List<TriggerDefinition>
getTriggerDefinitions()
@Nullable ImmutableVcsBambooSpecsSource
getVcsBambooSpecsSource()
boolean
isActive()
Is the plan queued or building?boolean
isBusy()
Is thePlan
"busy".boolean
isExecuting()
Is the build currently being executed?boolean
isSuspended()
void
resetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration)
Invalidates the latest result summary for planvoid
resetPlanRepositoryDefinitions()
Invalidate repository list.void
resetVcsBambooSpecsSource()
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 Detail
-
AbstractImmutableChain
public AbstractImmutableChain(@NotNull @NotNull Chain chain, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, LabelManager labelManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, @NotNull @NotNull BuildDefinition buildDefinition)
-
AbstractImmutableChain
public AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain,EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, Map<Long,EnrichedPlanDto> jobsGroupedById, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
-
Method Detail
-
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
@Nullable public @Nullable PlanResultKey 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
public ImmutableResultsSummary 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
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableChainStage> 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
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableJob> 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
public boolean containsStage(@Nullable @Nullable String stageName)
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
-
getEffectiveRepositoryDefinitions
@NotNull public @NotNull com.google.common.collect.ImmutableList<RepositoryDefinition> getEffectiveRepositoryDefinitions()
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:
getEffectiveRepositoryDefinitions
in interfaceImmutableChain
- Returns:
- ordered
List
of repositories available to this plan
-
getPlanRepositoryDefinitions
@NotNull public @NotNull List<PlanRepositoryDefinition> 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
public NotificationSet 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
public ImmutableChain 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
@NotNull public @NotNull List<TriggerDefinition> getTriggerDefinitions()
- Specified by:
getTriggerDefinitions
in interfaceTriggerable
- Returns:
- immutable list of all triggers defined for this object
-
getStorageTag
public ChainStorageTag getStorageTag()
- Specified by:
getStorageTag
in interfaceImmutableChain
-
getVcsBambooSpecsSource
@Nullable public @Nullable ImmutableVcsBambooSpecsSource getVcsBambooSpecsSource()
- Specified by:
getVcsBambooSpecsSource
in interfaceImmutableChain
- Returns:
- specs source used to manage this plan, or null if plan is not managed by RSS
-
getCreationDate
@NotNull public @NotNull Date getCreationDate()
- Specified by:
getCreationDate
in interfaceImmutableChain
- Returns:
- chain creation date
-
-