Package com.atlassian.bamboo.plan.cache
Class ImmutableResultsSummaryImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.resultsummary.BaseResultSummary
-
- com.atlassian.bamboo.plan.cache.ImmutableResultsSummaryImpl
-
- All Implemented Interfaces:
ImmutableChainResultsSummary,BambooIdProvider,BambooObject,ImmutableResultsSummary,ResultStatisticsProvider,Cloneable,Comparable<ImmutableResultsSummary>
public class ImmutableResultsSummaryImpl extends BaseResultSummary implements ImmutableChainResultsSummary
- Since:
- v3.4
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.resultsummary.BaseResultSummary
DATE_FORMAT
-
Fields inherited from interface com.atlassian.bamboo.resultsummary.ImmutableResultsSummary
CUSTOM_DATA_BUILD_KEY
-
-
Constructor Summary
Constructors Constructor Description ImmutableResultsSummaryImpl(ChainResultsSummary summary, TriggerManager triggerManager, ImmutablePlanManager immutablePlanManager, CachedPlanManager cachedPlanManager)ImmutableResultsSummaryImpl(ChainResultsSummary summary, TriggerManager triggerManager, ImmutablePlanManager immutablePlanManager, ImmutableChain immutableChain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<ArtifactLink>getArtifactLinks()Returns all artifacts associated with this build.LonggetBuildAgentId()The id of the latest agent that built the result@Nullable AgentTypegetBuildAgentType()The type of the latest agent that built the resultDategetBuildCancelledDate()When the build was cancelledDategetBuildCompletedDate()When the build finishedDategetBuildDate()When the build was executedintgetBuildNumber()Get build numberBuildStategetBuildState()Build state.@NotNull StringgetChangesListSummary()@NotNull Map<String,String>getCustomBuildData()Custom data map to store random metadata about the buildDeltaStategetDeltaState()Gets theDeltaStateof the summary.longgetDuration()Duration of the build in milliseconds@NotNull List<BuildResultsSummary>getFailedJobResults()Get a list of all failed job Results in this chain result@Nullable IntegergetFixedInResult()Get build result that this build was fixed in.@NotNull StringgetFullPlanName()@NotNull ImmutableChaingetImmutableChain()Gets theImmutableChainthat this result belongs to (directly or not)@NotNull ImmutableChaingetImmutablePlan()Gets theImmutablePlanthat this result directly belongs to.@NotNull Set<LinkedJiraIssue>getJiraIssues()Returns all the JIRA issues linked to this build resultList<Labelling>getLabellings()Tags / labels associated with the buildLifeCycleStategetLifeCycleState()@Nullable LonggetLogSize()Returns the size of log associated with this result.MergeResultSummarygetMergeResult()Note: this API is experimental.@NotNull List<ResultsSummary>getOrderedJobResultSummaries()Returns all jobsResultsSummaryrelated to chain result summary Summaries are ordered by stages@NotNull Optional<ImmutableChain>getPlanIfExists()Gets theImmutablePlanthat this result directly belongs to.@NotNull PlanKeygetPlanKey()Full key of the plan.@NotNull StringgetPlanName()longgetProcessingDuration()Duration of actual build processing in milisecondsDategetQueueTime()When the build queuedStringgetReasonSummary()@NotNull List<RepositoryChangeset>getRepositoryChangesets()intgetRestartCount()Return the number of build restart attempts@NotNull List<ChainStageResult>getStageResults()Get all theChainStageResult's associated with thisChainResultsSummary@NotNull List<ConsumedSubscription>getSubscriptions()Returns list of consumed artifact dependenciesConsumedSubscription@NotNull List<VariableSubstitution>getSubstitutedVariables()Returns immutable list of variables substituted during build executionFilteredTestResults<TestClassResultDescriptor>getTestResults()Get the helper class to provide filtered test lists for this chain result@NotNull TestResultsSummarygetTestResultsSummary()LonggetTimeToFix()A stored version of how long (milli seconds) it took for this build to fix a failure.intgetTotalJobCount()protected TriggerManagergetTriggerManager()@NotNull TriggerReasongetTriggerReason()Why the build was was triggered@NotNull List<VariableContextSnapshot>getVariableContextLogs()booleanisContinuable()Indicates thatChainexecution has been stopped on manual stage and is waiting for user actionbooleanisCustomBuild()Indicates that this result was run with custom variables (some of the variables were overwritten) - used to display indicator in UIbooleanisMarkedForDeletion()booleanisNotRunYet()Tells whether this result belongs to a job that will run when next manual stage is kicked offbooleanisOnceOff()Indicates that this result was run with custom revision and should be considered as 'once-off' when calculating telemetry and other stuffbooleanisRebuild()Indicates that this result was rebuild via "re-run this build" action.booleanisRestartable()Indicates thatChainexecution has been failed and could be restarted from failure placebooleanisSpecsResult()-
Methods inherited from class com.atlassian.bamboo.resultsummary.BaseResultSummary
compareTo, createChangeListSummary, equals, getArtifactLinksThatExist, getBuildTime, getCommits, getDurationDescription, getFixingJiraIssues, getJiraIssueKeys, getLabelNames, getManuallyOverriddenVariables, getPlanResultKey, getProcessingDurationDescription, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeBuildStartedDate, getRelativeBuildStartedDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getStatDate, getTestSummary, getUniqueAuthors, hasChanges, hasComments, hashCode, isActive, isFailed, isFinalized, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting
-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.atlassian.bamboo.resultsummary.ImmutableResultsSummary
getArtifactLinksThatExist, getBuildTime, getCommits, getDurationDescription, getFixingJiraIssues, getJiraIssueKeys, getLabelNames, getManuallyOverriddenVariables, getPlanResultKey, getProcessingDurationDescription, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeBuildStartedDate, getRelativeBuildStartedDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getTestSummary, getUniqueAuthors, hasChanges, hasComments, isActive, isFailed, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting
-
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultStatisticsProvider
getStatDate
-
-
-
-
Constructor Detail
-
ImmutableResultsSummaryImpl
public ImmutableResultsSummaryImpl(ChainResultsSummary summary, TriggerManager triggerManager, ImmutablePlanManager immutablePlanManager, CachedPlanManager cachedPlanManager)
-
ImmutableResultsSummaryImpl
public ImmutableResultsSummaryImpl(ChainResultsSummary summary, TriggerManager triggerManager, ImmutablePlanManager immutablePlanManager, ImmutableChain immutableChain)
-
-
Method Detail
-
getStageResults
@NotNull public @NotNull List<ChainStageResult> getStageResults()
Description copied from interface:ImmutableChainResultsSummaryGet all theChainStageResult's associated with thisChainResultsSummary- Specified by:
getStageResultsin interfaceImmutableChainResultsSummary- Returns:
- results
-
getTestResults
public FilteredTestResults<TestClassResultDescriptor> getTestResults()
Description copied from interface:ImmutableChainResultsSummaryGet the helper class to provide filtered test lists for this chain result- Specified by:
getTestResultsin interfaceImmutableChainResultsSummary- Returns:
- helper class to provide filtered test lists for this chain result, null if the chain is still being built
-
getFailedJobResults
@NotNull public @NotNull List<BuildResultsSummary> getFailedJobResults()
Description copied from interface:ImmutableChainResultsSummaryGet a list of all failed job Results in this chain result- Specified by:
getFailedJobResultsin interfaceImmutableChainResultsSummary- Returns:
- a list of all failed job Results in this chain result
-
getTotalJobCount
public int getTotalJobCount()
- Specified by:
getTotalJobCountin interfaceImmutableChainResultsSummary- Returns:
- how many job results exist
-
getOrderedJobResultSummaries
@NotNull public @NotNull List<ResultsSummary> getOrderedJobResultSummaries()
Description copied from interface:ImmutableChainResultsSummaryReturns all jobsResultsSummaryrelated to chain result summary Summaries are ordered by stages- Specified by:
getOrderedJobResultSummariesin interfaceImmutableChainResultsSummary- Returns:
-
isContinuable
public boolean isContinuable()
Description copied from interface:ImmutableChainResultsSummaryIndicates thatChainexecution has been stopped on manual stage and is waiting for user action- Specified by:
isContinuablein interfaceImmutableChainResultsSummary- Returns:
-
isRestartable
public boolean isRestartable()
Description copied from interface:ImmutableChainResultsSummaryIndicates thatChainexecution has been failed and could be restarted from failure place- Specified by:
isRestartablein interfaceImmutableChainResultsSummary- Returns:
-
isOnceOff
public boolean isOnceOff()
Description copied from interface:ImmutableResultsSummaryIndicates that this result was run with custom revision and should be considered as 'once-off' when calculating telemetry and other stuff- Specified by:
isOnceOffin interfaceImmutableResultsSummary- Returns:
-
isCustomBuild
public boolean isCustomBuild()
Description copied from interface:ImmutableResultsSummaryIndicates that this result was run with custom variables (some of the variables were overwritten) - used to display indicator in UI- Specified by:
isCustomBuildin interfaceImmutableResultsSummary- Returns:
-
isRebuild
public boolean isRebuild()
Description copied from interface:ImmutableResultsSummaryIndicates that this result was rebuild via "re-run this build" action.- Specified by:
isRebuildin interfaceImmutableResultsSummary- Returns:
-
getLogSize
@Nullable public @Nullable Long getLogSize()
Description copied from interface:ImmutableResultsSummaryReturns the size of log associated with this result.For a
BuildResultsSummarythis method will return size of the log produced by theJob.For a
ChainResultsSummarythe returned value will be equal to the maximum log size produced by thisChain'sJobs.- Specified by:
getLogSizein interfaceImmutableResultsSummary- Returns:
- the log size or null, if the value is not known
-
getImmutablePlan
@NotNull public @NotNull ImmutableChain getImmutablePlan()
Description copied from interface:ImmutableResultsSummaryGets theImmutablePlanthat this result directly belongs to. Since version 6.9 it is possible thatImmutableJobno longer exists but its results do, therefore it is recommended to useImmutableResultsSummary.getPlanIfExists()instead of this method when operating on job results.- Specified by:
getImmutablePlanin interfaceImmutableChainResultsSummary- Specified by:
getImmutablePlanin interfaceImmutableResultsSummary- Returns:
- the owning plan for the result
-
getImmutableChain
@NotNull public @NotNull ImmutableChain getImmutableChain()
Description copied from interface:ImmutableResultsSummaryGets theImmutableChainthat this result belongs to (directly or not)- Specified by:
getImmutableChainin interfaceImmutableResultsSummary- Returns:
- the owning plan for the result
-
getPlanIfExists
@NotNull public @NotNull Optional<ImmutableChain> getPlanIfExists()
Description copied from interface:ImmutableResultsSummaryGets theImmutablePlanthat this result directly belongs to.- Specified by:
getPlanIfExistsin interfaceImmutableChainResultsSummary- Specified by:
getPlanIfExistsin interfaceImmutableResultsSummary- Returns:
- the owning plan for the result or empty if id doesn't exist.
-
isNotRunYet
public boolean isNotRunYet()
Description copied from interface:ImmutableResultsSummaryTells whether this result belongs to a job that will run when next manual stage is kicked off- Specified by:
isNotRunYetin interfaceImmutableResultsSummary- Returns:
-
isMarkedForDeletion
public boolean isMarkedForDeletion()
-
getArtifactLinks
@NotNull public @NotNull List<ArtifactLink> getArtifactLinks()
Description copied from interface:ImmutableResultsSummaryReturns all artifacts associated with this build. Even if the files don't exist- Specified by:
getArtifactLinksin interfaceImmutableResultsSummary- Returns:
-
getBuildCancelledDate
public Date getBuildCancelledDate()
Description copied from interface:ImmutableResultsSummaryWhen the build was cancelled- Specified by:
getBuildCancelledDatein interfaceImmutableResultsSummary- Returns:
- date of build cancellation or null if build was not cancelled
-
getBuildCompletedDate
public Date getBuildCompletedDate()
Description copied from interface:ImmutableResultsSummaryWhen the build finished- Specified by:
getBuildCompletedDatein interfaceImmutableResultsSummary- Returns:
-
getBuildDate
public Date getBuildDate()
Description copied from interface:ResultStatisticsProviderWhen the build was executed- Specified by:
getBuildDatein interfaceResultStatisticsProvider- Returns:
- date of build execution or null if build was not executed yet
-
getBuildNumber
public int getBuildNumber()
Description copied from interface:ResultStatisticsProviderGet build number- Specified by:
getBuildNumberin interfaceResultStatisticsProvider- Returns:
- build number of the described build
-
getBuildState
public BuildState getBuildState()
Description copied from interface:ResultStatisticsProviderBuild state.- Specified by:
getBuildStatein interfaceResultStatisticsProvider- Returns:
- build state
-
getChangesListSummary
@NotNull public @NotNull String getChangesListSummary()
- Specified by:
getChangesListSummaryin interfaceImmutableResultsSummary
-
getCustomBuildData
@NotNull public @NotNull Map<String,String> getCustomBuildData()
Description copied from interface:ImmutableResultsSummaryCustom data map to store random metadata about the build- Specified by:
getCustomBuildDatain interfaceImmutableResultsSummary- Returns:
-
getDeltaState
public DeltaState getDeltaState()
Description copied from interface:ImmutableResultsSummaryGets theDeltaStateof the summary. It can be a build that fixes, breaks, failing, successful. Provides a status relative to the previous summary.- Specified by:
getDeltaStatein interfaceImmutableResultsSummary- Returns:
-
getDuration
public long getDuration()
Description copied from interface:ImmutableResultsSummaryDuration of the build in milliseconds- Specified by:
getDurationin interfaceImmutableResultsSummary- Specified by:
getDurationin interfaceResultStatisticsProvider- Returns:
- duration of the build in milliseconds
-
getJiraIssues
@NotNull public @NotNull Set<LinkedJiraIssue> getJiraIssues()
Description copied from interface:ImmutableResultsSummaryReturns all the JIRA issues linked to this build result- Specified by:
getJiraIssuesin interfaceImmutableResultsSummary- Returns:
-
getLabellings
public List<Labelling> getLabellings()
Description copied from interface:ImmutableResultsSummaryTags / labels associated with the build- Specified by:
getLabellingsin interfaceImmutableResultsSummary- Returns:
-
getLifeCycleState
public LifeCycleState getLifeCycleState()
- Specified by:
getLifeCycleStatein interfaceImmutableResultsSummary
-
getPlanKey
@NotNull public @NotNull PlanKey getPlanKey()
Description copied from interface:ImmutableResultsSummaryFull key of the plan. e.g BAM-MAIN- Specified by:
getPlanKeyin interfaceImmutableResultsSummary
-
getFullPlanName
@NotNull public @NotNull String getFullPlanName()
- Specified by:
getFullPlanNamein interfaceImmutableResultsSummary- Returns:
- full plan name
-
getPlanName
@NotNull public @NotNull String getPlanName()
- Specified by:
getPlanNamein interfaceImmutableResultsSummary- Returns:
- short plan name
-
getProcessingDuration
public long getProcessingDuration()
Description copied from interface:ImmutableResultsSummaryDuration of actual build processing in miliseconds- Specified by:
getProcessingDurationin interfaceImmutableResultsSummary- Specified by:
getProcessingDurationin interfaceResultStatisticsProvider- Returns:
- processing duration of the build in milliseconds
-
getQueueTime
public Date getQueueTime()
Description copied from interface:ImmutableResultsSummaryWhen the build queued- Specified by:
getQueueTimein interfaceImmutableResultsSummary- Returns:
-
getReasonSummary
public String getReasonSummary()
- Specified by:
getReasonSummaryin interfaceImmutableResultsSummary
-
getRepositoryChangesets
@NotNull public @NotNull List<RepositoryChangeset> getRepositoryChangesets()
- Specified by:
getRepositoryChangesetsin interfaceImmutableResultsSummary
-
getRestartCount
public int getRestartCount()
Description copied from interface:ImmutableResultsSummaryReturn the number of build restart attempts- Specified by:
getRestartCountin interfaceImmutableResultsSummary- Returns:
-
getSubscriptions
@NotNull public @NotNull List<ConsumedSubscription> getSubscriptions()
Description copied from interface:ImmutableResultsSummaryReturns list of consumed artifact dependenciesConsumedSubscription- Specified by:
getSubscriptionsin interfaceImmutableResultsSummary- Returns:
-
getSubstitutedVariables
@NotNull public @NotNull List<VariableSubstitution> getSubstitutedVariables()
Description copied from interface:ImmutableResultsSummaryReturns immutable list of variables substituted during build execution- Specified by:
getSubstitutedVariablesin interfaceImmutableResultsSummary
-
getTestResultsSummary
@NotNull public @NotNull TestResultsSummary getTestResultsSummary()
- Specified by:
getTestResultsSummaryin interfaceImmutableResultsSummary- Returns:
- a summary of all the tests that ran in this build.
-
getTimeToFix
public Long getTimeToFix()
Description copied from interface:ImmutableResultsSummaryA stored version of how long (milli seconds) it took for this build to fix a failure.- Specified by:
getTimeToFixin interfaceImmutableResultsSummary- Returns:
- Null if not a fixing build
-
getTriggerReason
@NotNull public @NotNull TriggerReason getTriggerReason()
Description copied from interface:ImmutableResultsSummaryWhy the build was was triggered- Specified by:
getTriggerReasonin interfaceImmutableResultsSummary
-
getVariableContextLogs
@NotNull public @NotNull List<VariableContextSnapshot> getVariableContextLogs()
- Specified by:
getVariableContextLogsin interfaceImmutableResultsSummary
-
getTriggerManager
protected TriggerManager getTriggerManager()
- Specified by:
getTriggerManagerin classBaseResultSummary
-
getMergeResult
public MergeResultSummary getMergeResult()
Description copied from interface:ImmutableChainResultsSummaryNote: this API is experimental.- Specified by:
getMergeResultin interfaceImmutableChainResultsSummary
-
getFixedInResult
@Nullable public @Nullable Integer getFixedInResult()
Description copied from interface:ImmutableChainResultsSummaryGet build result that this build was fixed in. If the build is succussful it will be null. If there is no successful build after this it will also be null. If the fixed in build is deleted. This will still reference the deleted result.- Specified by:
getFixedInResultin interfaceImmutableChainResultsSummary- Returns:
-
getBuildAgentId
public Long getBuildAgentId()
Description copied from interface:ImmutableResultsSummaryThe id of the latest agent that built the result- Specified by:
getBuildAgentIdin interfaceImmutableResultsSummary- Returns:
- Null if no agents involved or unknown
-
getBuildAgentType
@Nullable public @Nullable AgentType getBuildAgentType()
Description copied from interface:ImmutableResultsSummaryThe type of the latest agent that built the result- Specified by:
getBuildAgentTypein interfaceImmutableResultsSummary- Returns:
- Null if no agents involved or unknown
-
isSpecsResult
public boolean isSpecsResult()
- Specified by:
isSpecsResultin interfaceImmutableChainResultsSummary
-
-