Class AbstractResultsSummary
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.bamboo.core.BambooEntityObject
com.atlassian.bamboo.resultsummary.BaseResultSummary
com.atlassian.bamboo.resultsummary.AbstractResultsSummary
- All Implemented Interfaces:
BambooCustomDataAware
,BambooIdProvider
,BambooObject
,Deletable
,ImmutableDeletable
,PlanResultKeyProvider
,ImmutableResultsSummary
,MutableBuildKeyResultsSummary
,ResultsSummary
,ResultStatisticsProvider
,Cloneable
,Comparable<ImmutableResultsSummary>
- Direct Known Subclasses:
BuildResultsSummaryImpl
,ChainResultsSummaryImpl
@Entity
public abstract class AbstractResultsSummary
extends BaseResultSummary
implements ImmutableDeletable, Deletable, MutableBuildKeyResultsSummary
-
Field Summary
Modifier and TypeFieldDescriptionprotected BuildState
protected static final Supplier<CachedPlanManager>
protected final io.atlassian.util.concurrent.ResettableLazyReference<List<VariableSubstitution>>
protected final io.atlassian.util.concurrent.ResettableLazyReference<List<VariableContextSnapshot>>
protected LifeCycleState
protected boolean
protected boolean
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVariableContextItem
(@NotNull VariableContextSnapshot variableContext) @NotNull List<ArtifactLink>
Returns all artifacts associated with this build.The id of the latest agent that built the result@Nullable AgentType
The type of the latest agent that built the result@Nullable Date
When the build was cancelledWhen the build finishedDate when build was passed to execution.@NotNull String
int
Get build number@NotNull String
Build state.@NotNull String
Custom data map to store random metadata about the buildThis method is not intended to be used outsideBuildResultsSummaryDao
Gets theDeltaState
of the summary.long
Duration of the build in millisecondsint
@NotNull ImmutablePlan
Gets theImmutablePlan
that this result belongs directly belongs to.@NotNull Set<LinkedJiraIssue>
Returns all the JIRA issues linked to this build resultTags / labels associated with the build@Nullable Long
Returns the size of log associated with this result.@NotNull Optional<? extends ImmutablePlan>
Gets theImmutablePlan
that this result directly belongs to.@NotNull PlanKey
Full key of the plan.@NotNull String
long
Duration of actual build processing in milisecondsDate when build was queued.@NotNull List<RepositoryChangeset>
int
Return the number of build restart attempts@NotNull Iterable<VariableContextSnapshot>
@NotNull List<ConsumedSubscription>
Returns list of consumed artifact dependenciesConsumedSubscription
@NotNull List<VariableSubstitution>
Returns immutable list of variables substituted during build execution@NotNull List<VariableSubstitution>
since 7.0 for internal use only, useResultsSummaryVariableAccessor
instead@NotNull Set<TestClassResult>
@NotNull TestResultsSummary
A stored version of how long (milli seconds) it took for this build to fix a failure.protected TriggerManager
@NotNull TriggerReason
Why the build was was triggered@Nullable VariableContextBaseline
@NotNull List<VariableContextSnapshot>
@NotNull List<VariableContextSnapshot>
since 7.0 for internal use only, useResultsSummaryVariableAccessor
insteadint
Increments number of build restarts and returns the new valueboolean
Indicates that this result was run with custom variables (some of the variables were overwritten) - used to display indicator in UIboolean
Indicates that this result was run with custom revision and should be considered as 'once-off' when calculating telemetry and other stuffboolean
Indicates that this result was rebuild via "re-run this build" action.boolean
void
resetTestClassResults
(@NotNull List<TestClassResult> testClassResults) Overrides all current testClassResults with the new onesvoid
setArtifactLinks
(List<ArtifactLink> artifactLinks) void
setBuildAgentId
(long buildAgentId) void
setBuildAgentType
(@Nullable AgentType agentType) Sets the build agent type.void
setBuildCancelledDate
(Date buildCancelledDate) void
setBuildCompletedDate
(Date buildCompletedDate) void
setBuildDate
(Date buildDate) void
setBuildKey
(String buildKey) void
setBuildNumber
(int buildNumber) void
setBuildState
(BuildState buildState) void
setComments
(List<Comment> comments) void
setCustomBuild
(boolean customBuild) void
setCustomBuildData
(Map<String, String> customBuildData) void
setDeltaState
(DeltaState deltaState) Sets theDeltaState
for the summary.void
setDiscriminator
(String discriminator) void
setDuration
(long duration) void
setFormatVersion
(int formatVersion) void
setJiraIssues
(Set<LinkedJiraIssue> jiraIssues) void
setLabellings
(List<Labelling> labellings) void
setLifeCycleState
(LifeCycleState lifeCycleState) void
setLogSize
(@Nullable Long logSize) Sets the size of the log file associated with this result, eg.void
setOnceOff
(boolean onceOff) void
setPlanKey
(PlanKey planKey) void
setPlanName
(@NotNull String planName) void
setProcessingDuration
(long processingDuration) void
setQueueTime
(Date queueTime) void
setRebuild
(boolean rebuild) void
setRestartCount
(int restartCount) Sets number of build restarts.void
setSpecsResult
(boolean specsResult) void
setStageResultId
(Long stageResultId) void
setSubscriptions
(List<ConsumedSubscription> subscriptions) void
setTestResultsSummary
(@NotNull TestResultsSummary testResultsSummary) Set the test summary information from this buildvoid
setTimeToFix
(Long timeToFix) A stored version of how long (milli seconds) it took for this build to fix a failure.void
setTriggerReason
(TriggerReason triggerReason) void
setTriggerReasonKey
(String triggerReasonKey) void
setVariableContextBaseline
(@Nullable VariableContextBaseline variableContextBaseline) protected void
setVariableContextLogsEncrypted
(List<VariableContextSnapshot> variableContextLogs) toString()
void
updateCustomDataEntry
(@NotNull String key, @NotNull String value) Add or modify key value pair to Object's custom data map.void
Sets format version to current Bamboo build number.void
updateLifeCycleState
(@NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState) Update lifeCycleState and buildState in one go.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, 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.deletion.Deletable
setMarkedForDeletion
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableDeletable
isMarkedForDeletion
Methods inherited from interface com.atlassian.bamboo.resultsummary.ImmutableResultsSummary
getArtifactLinksThatExist, getBuildTime, getCommits, getDurationDescription, getFixingJiraIssues, getFullPlanName, getImmutableChain, getJiraIssueKeys, getLabelNames, getManuallyOverriddenVariables, getPlanResultKey, getProcessingDurationDescription, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeBuildStartedDate, getRelativeBuildStartedDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getTestSummary, getUniqueAuthors, hasChanges, hasComments, isActive, isFailed, isFinished, isInProgress, isNotBuilt, isNotRunYet, isPending, isQueued, isSuccessful, isWaiting
Methods inherited from interface com.atlassian.bamboo.plan.PlanResultKeyProvider
getPlanResultKey
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultStatisticsProvider
getStatDate
-
Field Details
-
markedForDeletion
protected boolean markedForDeletion -
buildState
-
lifeCycleState
-
specsResult
protected boolean specsResult -
cachedPlanManagerRef
-
decryptedVariableContextLogsReference
protected final io.atlassian.util.concurrent.ResettableLazyReference<List<VariableContextSnapshot>> decryptedVariableContextLogsReference -
decryptedSubstitutedVariablesReference
protected final io.atlassian.util.concurrent.ResettableLazyReference<List<VariableSubstitution>> decryptedSubstitutedVariablesReference
-
-
Constructor Details
-
AbstractResultsSummary
public AbstractResultsSummary()
-
-
Method Details
-
getImmutablePlan
Description copied from interface:ResultsSummary
Gets theImmutablePlan
that this result belongs 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 when operating on job results.- Specified by:
getImmutablePlan
in interfaceImmutableResultsSummary
- Specified by:
getImmutablePlan
in interfaceResultsSummary
- Returns:
- the owning plan for the result
-
getPlanIfExists
Description copied from interface:ImmutableResultsSummary
Gets theImmutablePlan
that this result directly belongs to.- Specified by:
getPlanIfExists
in interfaceImmutableResultsSummary
- Returns:
- the owning plan for the result or empty if id doesn't exist.
-
getBuildResultKey
- Specified by:
getBuildResultKey
in interfaceResultsSummary
- Returns:
- full build result key e.g. BAM-MAIN-100
-
getBuildKey
- Specified by:
getBuildKey
in interfaceResultsSummary
- Returns:
- full key of the plan. e.g BAM-MAIN
-
getPlanName
- Specified by:
getPlanName
in interfaceImmutableResultsSummary
- Returns:
- short plan name
-
setPlanName
-
getReasonSummary
- Specified by:
getReasonSummary
in interfaceImmutableResultsSummary
-
setBuildKey
- Specified by:
setBuildKey
in interfaceMutableBuildKeyResultsSummary
-
getBuildNumber
public int getBuildNumber()Description copied from interface:ResultStatisticsProvider
Get build number- Specified by:
getBuildNumber
in interfaceResultStatisticsProvider
- Returns:
- build number of the described build
-
setBuildNumber
public void setBuildNumber(int buildNumber) -
getBuildDate
Date when build was passed to execution. For chain result this date is set when the first job is started.- Specified by:
getBuildDate
in interfaceResultStatisticsProvider
- Returns:
-
setBuildDate
- Specified by:
setBuildDate
in interfaceResultsSummary
-
getQueueTime
Date when build was queued. For chain result this date is set when the whole chain is created - as chain is created in QUEUED state.- Specified by:
getQueueTime
in interfaceImmutableResultsSummary
- Returns:
-
setQueueTime
- Specified by:
setQueueTime
in interfaceResultsSummary
-
getBuildCompletedDate
Description copied from interface:ImmutableResultsSummary
When the build finished- Specified by:
getBuildCompletedDate
in interfaceImmutableResultsSummary
- Returns:
-
setBuildCompletedDate
- Specified by:
setBuildCompletedDate
in interfaceResultsSummary
-
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:
-
setDeltaState
Description copied from interface:ResultsSummary
Sets theDeltaState
for the summary. Provides a status relative to the previous summary.- Specified by:
setDeltaState
in interfaceResultsSummary
- Parameters:
deltaState
- - the relative status for this summary
-
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:
-
setOnceOff
public void setOnceOff(boolean onceOff) - Specified by:
setOnceOff
in interfaceResultsSummary
-
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:
-
setCustomBuild
public void setCustomBuild(boolean customBuild) - Specified by:
setCustomBuild
in interfaceResultsSummary
-
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:
-
setRebuild
public void setRebuild(boolean rebuild) - Specified by:
setRebuild
in interfaceResultsSummary
-
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
-
setLogSize
Description copied from interface:ResultsSummary
Sets the size of the log file associated with this result, eg. size of the log produced by aJob
or largest log produced byChain
'sJob
s.- Specified by:
setLogSize
in interfaceResultsSummary
- Parameters:
logSize
- size of the largest log associated with the result (use null if unknown)
-
getJiraIssues
Description copied from interface:ImmutableResultsSummary
Returns all the JIRA issues linked to this build result- Specified by:
getJiraIssues
in interfaceImmutableResultsSummary
- Returns:
-
setJiraIssues
-
getCustomBuildData
Description copied from interface:ImmutableResultsSummary
Custom data map to store random metadata about the build- Specified by:
getCustomBuildData
in interfaceImmutableResultsSummary
- Returns:
-
setCustomBuildData
-
updateCustomDataEntry
Description copied from interface:BambooCustomDataAware
Add or modify key value pair to Object's custom data map.- Specified by:
updateCustomDataEntry
in interfaceBambooCustomDataAware
- Parameters:
key
- key to addvalue
- value to add
-
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
-
setTimeToFix
Description copied from interface:ResultsSummary
A stored version of how long (milli seconds) it took for this build to fix a failure.- Specified by:
setTimeToFix
in interfaceResultsSummary
- Parameters:
timeToFix
- how long (milli seconds) it took for this build to fix a failure.
-
getLabellings
Description copied from interface:ImmutableResultsSummary
Tags / labels associated with the build- Specified by:
getLabellings
in interfaceImmutableResultsSummary
- Returns:
-
setLabellings
-
setComments
-
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:
-
setArtifactLinks
-
getSubscriptions
Description copied from interface:ImmutableResultsSummary
Returns list of consumed artifact dependenciesConsumedSubscription
- Specified by:
getSubscriptions
in interfaceImmutableResultsSummary
- Returns:
-
setSubscriptions
-
getTriggerReasonKey
-
setTriggerReasonKey
-
getTriggerReason
Description copied from interface:ImmutableResultsSummary
Why the build was was triggered- Specified by:
getTriggerReason
in interfaceImmutableResultsSummary
-
setTriggerReason
- Specified by:
setTriggerReason
in interfaceResultsSummary
-
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
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
-
setBuildAgentId
public void setBuildAgentId(long buildAgentId) - Specified by:
setBuildAgentId
in interfaceResultsSummary
-
setBuildAgentType
Description copied from interface:ResultsSummary
Sets the build agent type.- Specified by:
setBuildAgentType
in interfaceResultsSummary
-
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
-
setDuration
public void setDuration(long duration) - Specified by:
setDuration
in interfaceResultsSummary
- Parameters:
duration
- duration of the build in milliseconds
-
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
-
setProcessingDuration
public void setProcessingDuration(long processingDuration) - Specified by:
setProcessingDuration
in interfaceResultsSummary
-
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
-
setBuildCancelledDate
- Specified by:
setBuildCancelledDate
in interfaceResultsSummary
-
getChangesListSummary
- Specified by:
getChangesListSummary
in interfaceImmutableResultsSummary
-
getTriggerManager
- Specified by:
getTriggerManager
in classBaseResultSummary
-
getBuildState
Description copied from interface:ResultStatisticsProvider
Build state.- Specified by:
getBuildState
in interfaceResultStatisticsProvider
- Returns:
- build state
-
setBuildState
-
getLifeCycleState
- Specified by:
getLifeCycleState
in interfaceImmutableResultsSummary
-
setLifeCycleState
-
updateLifeCycleState
public void updateLifeCycleState(@NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState) Description copied from interface:ResultsSummary
Update lifeCycleState and buildState in one go. Can throw IllegalArgumentException when values passed make no sense: - lifeCycleState == LifeCycleState.NOT_BUILT && buildState != BuildState.UNKNOWN- Specified by:
updateLifeCycleState
in interfaceResultsSummary
- Parameters:
lifeCycleState
- lifeCycleState to be setbuildState
- buildState to be set
-
getDiscriminator
-
setDiscriminator
-
getRepositoryChangesets
- Specified by:
getRepositoryChangesets
in interfaceImmutableResultsSummary
-
getSubstitutedVariables
Description copied from interface:ImmutableResultsSummary
Returns immutable list of variables substituted during build execution- Specified by:
getSubstitutedVariables
in interfaceImmutableResultsSummary
-
getSubstitutedVariablesEncrypted
Description copied from interface:ResultsSummary
since 7.0 for internal use only, useResultsSummaryVariableAccessor
instead- Specified by:
getSubstitutedVariablesEncrypted
in interfaceResultsSummary
-
getVariableContextLogs
- Specified by:
getVariableContextLogs
in interfaceImmutableResultsSummary
-
getVariableContextLogsEncrypted
Description copied from interface:ResultsSummary
since 7.0 for internal use only, useResultsSummaryVariableAccessor
instead- Specified by:
getVariableContextLogsEncrypted
in interfaceResultsSummary
-
setVariableContextLogsEncrypted
-
addVariableContextItem
- Specified by:
addVariableContextItem
in interfaceResultsSummary
-
getResultVariables
-
getVariableContextBaselineId
- Specified by:
getVariableContextBaselineId
in interfaceResultsSummary
-
setVariableContextBaseline
public void setVariableContextBaseline(@Nullable @Nullable VariableContextBaseline variableContextBaseline) -
getVariableContextBaseline
-
getTestResultsSummary
- Specified by:
getTestResultsSummary
in interfaceImmutableResultsSummary
- Returns:
- a summary of all the tests that ran in this build.
-
setTestResultsSummary
Description copied from interface:ResultsSummary
Set the test summary information from this build- Specified by:
setTestResultsSummary
in interfaceResultsSummary
- Parameters:
testResultsSummary
- the test summary information
-
getTestClassResults
-
resetTestClassResults
Description copied from interface:ResultsSummary
Overrides all current testClassResults with the new ones- Specified by:
resetTestClassResults
in interfaceResultsSummary
- Parameters:
testClassResults
- to set
-
getCustomBuildDataRows
This method is not intended to be used outsideBuildResultsSummaryDao
- Returns:
-
getStageResultId
-
setStageResultId
-
getRestartCount
public int getRestartCount()Description copied from interface:ImmutableResultsSummary
Return the number of build restart attempts- Specified by:
getRestartCount
in interfaceImmutableResultsSummary
- Returns:
-
incrementRestartCount
public int incrementRestartCount()Description copied from interface:ResultsSummary
Increments number of build restarts and returns the new value- Specified by:
incrementRestartCount
in interfaceResultsSummary
-
setRestartCount
public void setRestartCount(int restartCount) Description copied from interface:ResultsSummary
Sets number of build restarts.- Specified by:
setRestartCount
in interfaceResultsSummary
-
getPlanKey
Description copied from interface:ImmutableResultsSummary
Full key of the plan. e.g BAM-MAIN- Specified by:
getPlanKey
in interfaceImmutableResultsSummary
-
setPlanKey
- Specified by:
setPlanKey
in interfaceMutableBuildKeyResultsSummary
-
getFormatVersion
public int getFormatVersion()- Specified by:
getFormatVersion
in interfaceResultsSummary
- Returns:
- build number of Bamboo version in which this result was created
-
updateFormatVersion
public void updateFormatVersion()Description copied from interface:ResultsSummary
Sets format version to current Bamboo build number.- Specified by:
updateFormatVersion
in interfaceResultsSummary
-
setFormatVersion
public void setFormatVersion(int formatVersion) -
setSpecsResult
public void setSpecsResult(boolean specsResult) -
isSpecsResult
public boolean isSpecsResult() -
toString
-