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.Long
getBuildAgentId()
The id of the latest agent that built the result@Nullable AgentType
getBuildAgentType()
The type of the latest agent that built the resultDate
getBuildCancelledDate()
When the build was cancelledDate
getBuildCompletedDate()
When the build finishedDate
getBuildDate()
When the build was executedint
getBuildNumber()
Get build numberBuildState
getBuildState()
Build state.@NotNull String
getChangesListSummary()
@NotNull Map<String,String>
getCustomBuildData()
Custom data map to store random metadata about the buildDeltaState
getDeltaState()
Gets theDeltaState
of the summary.long
getDuration()
Duration of the build in milliseconds@NotNull List<BuildResultsSummary>
getFailedJobResults()
Get a list of all failed job Results in this chain result@Nullable Integer
getFixedInResult()
Get build result that this build was fixed in.@NotNull String
getFullPlanName()
@NotNull ImmutableChain
getImmutableChain()
Gets theImmutableChain
that this result belongs to (directly or not)@NotNull ImmutableChain
getImmutablePlan()
Gets theImmutablePlan
that 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 buildLifeCycleState
getLifeCycleState()
@Nullable Long
getLogSize()
Returns the size of log associated with this result.MergeResultSummary
getMergeResult()
Note: this API is experimental.@NotNull List<ResultsSummary>
getOrderedJobResultSummaries()
Returns all jobsResultsSummary
related to chain result summary Summaries are ordered by stages@NotNull Optional<ImmutableChain>
getPlanIfExists()
Gets theImmutablePlan
that this result directly belongs to.@NotNull PlanKey
getPlanKey()
Full key of the plan.@NotNull String
getPlanName()
long
getProcessingDuration()
Duration of actual build processing in milisecondsDate
getQueueTime()
When the build queuedString
getReasonSummary()
@NotNull List<RepositoryChangeset>
getRepositoryChangesets()
int
getRestartCount()
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 TestResultsSummary
getTestResultsSummary()
Long
getTimeToFix()
A stored version of how long (milli seconds) it took for this build to fix a failure.int
getTotalJobCount()
protected TriggerManager
getTriggerManager()
@NotNull TriggerReason
getTriggerReason()
Why the build was was triggered@NotNull List<VariableContextSnapshot>
getVariableContextLogs()
boolean
isContinuable()
Indicates thatChain
execution has been stopped on manual stage and is waiting for user actionboolean
isCustomBuild()
Indicates that this result was run with custom variables (some of the variables were overwritten) - used to display indicator in UIboolean
isMarkedForDeletion()
boolean
isNotRunYet()
Tells whether this result belongs to a job that will run when next manual stage is kicked offboolean
isOnceOff()
Indicates that this result was run with custom revision and should be considered as 'once-off' when calculating telemetry and other stuffboolean
isRebuild()
Indicates that this result was rebuild via "re-run this build" action.boolean
isRestartable()
Indicates thatChain
execution has been failed and could be restarted from failure placeboolean
isSpecsResult()
-
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:ImmutableChainResultsSummary
Get all theChainStageResult
's associated with thisChainResultsSummary
- Specified by:
getStageResults
in interfaceImmutableChainResultsSummary
- Returns:
- results
-
getTestResults
public FilteredTestResults<TestClassResultDescriptor> getTestResults()
Description copied from interface:ImmutableChainResultsSummary
Get the helper class to provide filtered test lists for this chain result- Specified by:
getTestResults
in 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:ImmutableChainResultsSummary
Get a list of all failed job Results in this chain result- Specified by:
getFailedJobResults
in interfaceImmutableChainResultsSummary
- Returns:
- a list of all failed job Results in this chain result
-
getTotalJobCount
public int getTotalJobCount()
- Specified by:
getTotalJobCount
in interfaceImmutableChainResultsSummary
- Returns:
- how many job results exist
-
getOrderedJobResultSummaries
@NotNull public @NotNull List<ResultsSummary> getOrderedJobResultSummaries()
Description copied from interface:ImmutableChainResultsSummary
Returns all jobsResultsSummary
related to chain result summary Summaries are ordered by stages- Specified by:
getOrderedJobResultSummaries
in interfaceImmutableChainResultsSummary
- Returns:
-
isContinuable
public boolean isContinuable()
Description copied from interface:ImmutableChainResultsSummary
Indicates thatChain
execution has been stopped on manual stage and is waiting for user action- Specified by:
isContinuable
in interfaceImmutableChainResultsSummary
- Returns:
-
isRestartable
public boolean isRestartable()
Description copied from interface:ImmutableChainResultsSummary
Indicates thatChain
execution has been failed and could be restarted from failure place- Specified by:
isRestartable
in interfaceImmutableChainResultsSummary
- Returns:
-
isOnceOff
public boolean isOnceOff()
Description copied from interface:ImmutableResultsSummary
Indicates that this result was run with custom revision and should be considered as 'once-off' when calculating telemetry and other stuff- Specified by:
isOnceOff
in interfaceImmutableResultsSummary
- Returns:
-
isCustomBuild
public boolean isCustomBuild()
Description copied from interface:ImmutableResultsSummary
Indicates that this result was run with custom variables (some of the variables were overwritten) - used to display indicator in UI- Specified by:
isCustomBuild
in interfaceImmutableResultsSummary
- Returns:
-
isRebuild
public boolean isRebuild()
Description copied from interface:ImmutableResultsSummary
Indicates that this result was rebuild via "re-run this build" action.- Specified by:
isRebuild
in interfaceImmutableResultsSummary
- Returns:
-
getLogSize
@Nullable public @Nullable Long getLogSize()
Description copied from interface:ImmutableResultsSummary
Returns the size of log associated with this result.For a
BuildResultsSummary
this method will return size of the log produced by theJob
.For a
ChainResultsSummary
the returned value will be equal to the maximum log size produced by thisChain
'sJob
s.- Specified by:
getLogSize
in interfaceImmutableResultsSummary
- Returns:
- the log size or null, if the value is not known
-
getImmutablePlan
@NotNull public @NotNull ImmutableChain getImmutablePlan()
Description copied from interface:ImmutableResultsSummary
Gets theImmutablePlan
that this result directly belongs to. Since version 6.9 it is possible thatImmutableJob
no longer exists but its results do, therefore it is recommended to useImmutableResultsSummary.getPlanIfExists()
instead of this method when operating on job results.- Specified by:
getImmutablePlan
in interfaceImmutableChainResultsSummary
- Specified by:
getImmutablePlan
in interfaceImmutableResultsSummary
- Returns:
- the owning plan for the result
-
getImmutableChain
@NotNull public @NotNull ImmutableChain getImmutableChain()
Description copied from interface:ImmutableResultsSummary
Gets theImmutableChain
that this result belongs to (directly or not)- Specified by:
getImmutableChain
in interfaceImmutableResultsSummary
- Returns:
- the owning plan for the result
-
getPlanIfExists
@NotNull public @NotNull Optional<ImmutableChain> getPlanIfExists()
Description copied from interface:ImmutableResultsSummary
Gets theImmutablePlan
that this result directly belongs to.- Specified by:
getPlanIfExists
in interfaceImmutableChainResultsSummary
- Specified by:
getPlanIfExists
in interfaceImmutableResultsSummary
- Returns:
- the owning plan for the result or empty if id doesn't exist.
-
isNotRunYet
public boolean isNotRunYet()
Description copied from interface:ImmutableResultsSummary
Tells whether this result belongs to a job that will run when next manual stage is kicked off- Specified by:
isNotRunYet
in interfaceImmutableResultsSummary
- Returns:
-
isMarkedForDeletion
public boolean isMarkedForDeletion()
-
getArtifactLinks
@NotNull public @NotNull List<ArtifactLink> getArtifactLinks()
Description copied from interface:ImmutableResultsSummary
Returns all artifacts associated with this build. Even if the files don't exist- Specified by:
getArtifactLinks
in interfaceImmutableResultsSummary
- Returns:
-
getBuildCancelledDate
public Date getBuildCancelledDate()
Description copied from interface:ImmutableResultsSummary
When the build was cancelled- Specified by:
getBuildCancelledDate
in interfaceImmutableResultsSummary
- Returns:
- date of build cancellation or null if build was not cancelled
-
getBuildCompletedDate
public Date getBuildCompletedDate()
Description copied from interface:ImmutableResultsSummary
When the build finished- Specified by:
getBuildCompletedDate
in interfaceImmutableResultsSummary
- Returns:
-
getBuildDate
public Date getBuildDate()
Description copied from interface:ResultStatisticsProvider
When the build was executed- Specified by:
getBuildDate
in interfaceResultStatisticsProvider
- Returns:
- date of build execution or null if build was not executed yet
-
getBuildNumber
public int getBuildNumber()
Description copied from interface:ResultStatisticsProvider
Get build number- Specified by:
getBuildNumber
in interfaceResultStatisticsProvider
- Returns:
- build number of the described build
-
getBuildState
public BuildState getBuildState()
Description copied from interface:ResultStatisticsProvider
Build state.- Specified by:
getBuildState
in interfaceResultStatisticsProvider
- Returns:
- build state
-
getChangesListSummary
@NotNull public @NotNull String getChangesListSummary()
- Specified by:
getChangesListSummary
in interfaceImmutableResultsSummary
-
getCustomBuildData
@NotNull public @NotNull Map<String,String> getCustomBuildData()
Description copied from interface:ImmutableResultsSummary
Custom data map to store random metadata about the build- Specified by:
getCustomBuildData
in interfaceImmutableResultsSummary
- Returns:
-
getDeltaState
public DeltaState getDeltaState()
Description copied from interface:ImmutableResultsSummary
Gets theDeltaState
of the summary. It can be a build that fixes, breaks, failing, successful. Provides a status relative to the previous summary.- Specified by:
getDeltaState
in interfaceImmutableResultsSummary
- Returns:
-
getDuration
public long getDuration()
Description copied from interface:ImmutableResultsSummary
Duration of the build in milliseconds- Specified by:
getDuration
in interfaceImmutableResultsSummary
- Specified by:
getDuration
in interfaceResultStatisticsProvider
- Returns:
- duration of the build in milliseconds
-
getJiraIssues
@NotNull public @NotNull Set<LinkedJiraIssue> getJiraIssues()
Description copied from interface:ImmutableResultsSummary
Returns all the JIRA issues linked to this build result- Specified by:
getJiraIssues
in interfaceImmutableResultsSummary
- Returns:
-
getLabellings
public List<Labelling> getLabellings()
Description copied from interface:ImmutableResultsSummary
Tags / labels associated with the build- Specified by:
getLabellings
in interfaceImmutableResultsSummary
- Returns:
-
getLifeCycleState
public LifeCycleState getLifeCycleState()
- Specified by:
getLifeCycleState
in interfaceImmutableResultsSummary
-
getPlanKey
@NotNull public @NotNull PlanKey getPlanKey()
Description copied from interface:ImmutableResultsSummary
Full key of the plan. e.g BAM-MAIN- Specified by:
getPlanKey
in interfaceImmutableResultsSummary
-
getFullPlanName
@NotNull public @NotNull String getFullPlanName()
- Specified by:
getFullPlanName
in interfaceImmutableResultsSummary
- Returns:
- full plan name
-
getPlanName
@NotNull public @NotNull String getPlanName()
- Specified by:
getPlanName
in interfaceImmutableResultsSummary
- Returns:
- short plan name
-
getProcessingDuration
public long getProcessingDuration()
Description copied from interface:ImmutableResultsSummary
Duration of actual build processing in miliseconds- Specified by:
getProcessingDuration
in interfaceImmutableResultsSummary
- Specified by:
getProcessingDuration
in interfaceResultStatisticsProvider
- Returns:
- processing duration of the build in milliseconds
-
getQueueTime
public Date getQueueTime()
Description copied from interface:ImmutableResultsSummary
When the build queued- Specified by:
getQueueTime
in interfaceImmutableResultsSummary
- Returns:
-
getReasonSummary
public String getReasonSummary()
- Specified by:
getReasonSummary
in interfaceImmutableResultsSummary
-
getRepositoryChangesets
@NotNull public @NotNull List<RepositoryChangeset> getRepositoryChangesets()
- Specified by:
getRepositoryChangesets
in interfaceImmutableResultsSummary
-
getRestartCount
public int getRestartCount()
Description copied from interface:ImmutableResultsSummary
Return the number of build restart attempts- Specified by:
getRestartCount
in interfaceImmutableResultsSummary
- Returns:
-
getSubscriptions
@NotNull public @NotNull List<ConsumedSubscription> getSubscriptions()
Description copied from interface:ImmutableResultsSummary
Returns list of consumed artifact dependenciesConsumedSubscription
- Specified by:
getSubscriptions
in interfaceImmutableResultsSummary
- Returns:
-
getSubstitutedVariables
@NotNull public @NotNull List<VariableSubstitution> getSubstitutedVariables()
Description copied from interface:ImmutableResultsSummary
Returns immutable list of variables substituted during build execution- Specified by:
getSubstitutedVariables
in interfaceImmutableResultsSummary
-
getTestResultsSummary
@NotNull public @NotNull TestResultsSummary getTestResultsSummary()
- Specified by:
getTestResultsSummary
in interfaceImmutableResultsSummary
- Returns:
- a summary of all the tests that ran in this build.
-
getTimeToFix
public Long getTimeToFix()
Description copied from interface:ImmutableResultsSummary
A stored version of how long (milli seconds) it took for this build to fix a failure.- Specified by:
getTimeToFix
in interfaceImmutableResultsSummary
- Returns:
- Null if not a fixing build
-
getTriggerReason
@NotNull public @NotNull TriggerReason getTriggerReason()
Description copied from interface:ImmutableResultsSummary
Why the build was was triggered- Specified by:
getTriggerReason
in interfaceImmutableResultsSummary
-
getVariableContextLogs
@NotNull public @NotNull List<VariableContextSnapshot> getVariableContextLogs()
- Specified by:
getVariableContextLogs
in interfaceImmutableResultsSummary
-
getTriggerManager
protected TriggerManager getTriggerManager()
- Specified by:
getTriggerManager
in classBaseResultSummary
-
getMergeResult
public MergeResultSummary getMergeResult()
Description copied from interface:ImmutableChainResultsSummary
Note: this API is experimental.- Specified by:
getMergeResult
in interfaceImmutableChainResultsSummary
-
getFixedInResult
@Nullable public @Nullable Integer getFixedInResult()
Description copied from interface:ImmutableChainResultsSummary
Get 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:
getFixedInResult
in interfaceImmutableChainResultsSummary
- Returns:
-
getBuildAgentId
public Long getBuildAgentId()
Description copied from interface:ImmutableResultsSummary
The id of the latest agent that built the result- Specified by:
getBuildAgentId
in interfaceImmutableResultsSummary
- Returns:
- Null if no agents involved or unknown
-
getBuildAgentType
@Nullable public @Nullable AgentType getBuildAgentType()
Description copied from interface:ImmutableResultsSummary
The type of the latest agent that built the result- Specified by:
getBuildAgentType
in interfaceImmutableResultsSummary
- Returns:
- Null if no agents involved or unknown
-
isSpecsResult
public boolean isSpecsResult()
- Specified by:
isSpecsResult
in interfaceImmutableChainResultsSummary
-
-