com.atlassian.bamboo.plan.cache
Class ImmutableResultsSummary

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.resultsummary.BaseResultSummary
              extended by com.atlassian.bamboo.plan.cache.ImmutableResultsSummary
All Implemented Interfaces:
ChainResultsSummary, BambooIdProvider, BambooObject, Deletable, ImmutableDeletable, ResultsSummary, ResultStatisticsProvider, java.lang.Cloneable, java.lang.Comparable<ResultsSummary>

public class ImmutableResultsSummary
extends BaseResultSummary
implements ChainResultsSummary

Since:
v3.4

Field Summary
 
Fields inherited from class com.atlassian.bamboo.resultsummary.BaseResultSummary
DATE_FORMAT
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
ImmutableResultsSummary(ChainResultsSummary summary, TriggerManager triggerManager, ImmutablePlanManager immutablePlanManager, CommentManager commentManager, ResultsSummaryManager resultsSummaryManager)
           
 
Method Summary
 boolean addStageResult(ChainStageResult chainStageResult)
          Add a stage result
 ChainStageResult createStageResult(ImmutableChainStage chainStage)
          Create a new ChainStageResult and associates it with the ChainResultsSummary
 java.util.List<ArtifactLink> getArtifactLinks()
          Returns all artifacts associated with this build.
 java.lang.Long getBuildAgentId()
          The id of the agent that built the result
 java.util.Date getBuildCancelledDate()
          When the build was cancelled
 java.util.Date getBuildCompletedDate()
          When the build finished
 java.util.Date getBuildDate()
          When the build was executed
 int getBuildNumber()
          Get build number
 BuildState getBuildState()
          Build state.
 java.lang.String getChangesListSummary()
           
 java.util.List<Comment> getComments()
          Gets the associated user comments for the build
 java.util.List<Comment> getCommentsToDisplay()
          Gets the aggregated comments from the Jobs as well as the parent plan
 java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
          Custom data map to store random metadata about the build
 DeltaState getDeltaState()
          Gets the DeltaState of the summary.
 long getDuration()
          Duration of the build in milliseconds
 java.util.List<BuildResultsSummary> getFailedJobResults()
          Get a list of all failed job Results in this chain result
 java.util.Set<LinkedJiraIssue> getJiraIssues()
          Returns all the JIRA issues linked to this build result
 java.util.List<Labelling> getLabellings()
          Tags / labels assocaited with the build
 LifeCycleState getLifeCycleState()
           
 MergeResultSummary getMergeResult()
          Note: this API is experimental.
 java.util.List<ResultsSummary> getOrderedJobResultSummaries()
          Returns all jobs ResultsSummary related to chain result summary Summaries are ordered by stages
 Chain getPlan()
          Gets the Plan that this result belongs directly belongs to
 java.util.Date getPlanCompletedDate()
           
 PlanKey getPlanKey()
          Full key of the plan.
 long getProcessingDuration()
          Duration of actual build processing in miliseconds
 java.util.Date getQueueTime()
          When the build queued
 java.lang.String getReasonSummary()
           
 java.util.List<RepositoryChangeset> getRepositoryChangesets()
           
 int getRestartCount()
          Return the number of build restart attempts
 java.util.List<ChainStageResult> getStageResults()
          Get all the ChainStageResult's associated with this ChainResultsSummary
 java.util.List<ConsumedSubscription> getSubscriptions()
          Returns list of consumed artifact dependencies ConsumedSubscription
 java.util.List<VariableSubstitution> getSubstitutedVariables()
          Returns list of variables substituted during build execution
 FilteredTestResults<TestClassResultDescriptor> getTestResults()
          Get the helper class to provide filtered test lists for this chain result
 TestResultsSummary getTestResultsSummary()
           
 java.lang.Long getTimeToFix()
          A stored version of how long (milli seconds) it took for this build to fix a failure.
 int getTotalJobCount()
           
protected  TriggerManager getTriggerManager()
           
 TriggerReason getTriggerReason()
          Why the build was was triggered
 java.util.List<VariableContextSnapshot> getVariableContextLogs()
           
 int incrementRestartCount()
          Increments number of build restarts and returns the new value
 boolean isContinuable()
          Indicates that Chain execution has been stopped on manual stage and is waiting for user action
 boolean isMarkedForDeletion()
           
 boolean isNotRunYet()
          Tells whether this result belongs to a job that will run when next manual stage is kicked off
 boolean isRestartable()
          Indicates that Chain execution has been failed and could be restarted from failure place
 boolean removeStageResult(ChainStageResult chainStageResult)
          Remove a stage result
 void resetTestClassResults(java.util.List<TestClassResult> testClassResults)
          Overrides all current testClassResults with the new ones
 void setBuildAgentId(java.lang.Long buildAgentId)
           
 void setBuildCancelledDate(java.util.Date buildCancelledDate)
           
 void setBuildCompletedDate(java.util.Date completionDate)
           
 void setBuildDate(java.util.Date buildDate)
           
 void setContinuable(boolean continuable)
           
 void setDeltaState(DeltaState deltaState)
          Sets the DeltaState for the summary.
 void setDuration(long duration)
           
 void setMarkedForDeletion(boolean markedForDeletion)
           
 void setMergeResult(MergeResultSummary mergeResult)
          Note: this API is experimental.
 void setPlanCompletedDate(java.util.Date completionDate)
          Sets the time when build finished.
 void setProcessingDuration(long processingDuration)
           
 void setQueueTime(java.util.Date queueDate)
           
 void setTestResultsSummary(TestResultsSummary testResultsSummary)
          Set the test summary information from this build
 void setTimeToFix(java.lang.Long timeToFix)
          A stored version of how long (milli seconds) it took for this build to fix a failure.
 void setTriggerReason(TriggerReason triggerReason)
           
 void updateLifeCycleState(LifeCycleState lifeCycleState, BuildState buildState)
          Update lifeCycleState and buildState in one go.
 
Methods inherited from class com.atlassian.bamboo.resultsummary.BaseResultSummary
compareTo, createChangeListSummary, equals, getArtifactLinksThatExist, getBuildKey, getBuildResultKey, getBuildTime, getCommits, getDurationDescription, getDurationInSeconds, getFixingJiraIssues, getJiraIssueKeys, getLabelNames, getLongReasonSummary, getManuallyOverriddenVariables, getPlanResultKey, getProcessingDurationDescription, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeBuildStartedDate, getRelativeBuildStartedDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getStatDate, getTestSummary, getUniqueAuthors, hasChanges, hasComments, hasCommentsToDisplay, hashCode, isActive, isFailed, isFinalized, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
getId, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultsSummary
getArtifactLinksThatExist, getBuildKey, getBuildResultKey, getBuildTime, getCommits, getDurationDescription, getFixingJiraIssues, getJiraIssueKeys, getLabelNames, getManuallyOverriddenVariables, getPlanResultKey, getProcessingDurationDescription, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeBuildStartedDate, getRelativeBuildStartedDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getTestSummary, getUniqueAuthors, hasChanges, hasComments, hasCommentsToDisplay, isActive, isFailed, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultStatisticsProvider
getDurationInSeconds, getStatDate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ImmutableResultsSummary

public ImmutableResultsSummary(ChainResultsSummary summary,
                               TriggerManager triggerManager,
                               ImmutablePlanManager immutablePlanManager,
                               CommentManager commentManager,
                               ResultsSummaryManager resultsSummaryManager)
Method Detail

getStageResults

@NotNull
public java.util.List<ChainStageResult> getStageResults()
Description copied from interface: ChainResultsSummary
Get all the ChainStageResult's associated with this ChainResultsSummary

Specified by:
getStageResults in interface ChainResultsSummary
Returns:
results

getTestResults

public FilteredTestResults<TestClassResultDescriptor> getTestResults()
Description copied from interface: ChainResultsSummary
Get the helper class to provide filtered test lists for this chain result

Specified by:
getTestResults in interface ChainResultsSummary
Returns:
helper class to provide filtered test lists for this chain result, null if the chain is still being built

getFailedJobResults

@NotNull
public java.util.List<BuildResultsSummary> getFailedJobResults()
Description copied from interface: ChainResultsSummary
Get a list of all failed job Results in this chain result

Specified by:
getFailedJobResults in interface ChainResultsSummary
Returns:
a list of all failed job Results in this chain result

getTotalJobCount

public int getTotalJobCount()
Specified by:
getTotalJobCount in interface ChainResultsSummary
Returns:
how many job results exist

getOrderedJobResultSummaries

@NotNull
public java.util.List<ResultsSummary> getOrderedJobResultSummaries()
Description copied from interface: ChainResultsSummary
Returns all jobs ResultsSummary related to chain result summary Summaries are ordered by stages

Specified by:
getOrderedJobResultSummaries in interface ChainResultsSummary
Returns:

isContinuable

public boolean isContinuable()
Description copied from interface: ChainResultsSummary
Indicates that Chain execution has been stopped on manual stage and is waiting for user action

Specified by:
isContinuable in interface ChainResultsSummary
Returns:

isRestartable

public boolean isRestartable()
Description copied from interface: ChainResultsSummary
Indicates that Chain execution has been failed and could be restarted from failure place

Specified by:
isRestartable in interface ChainResultsSummary
Returns:

setContinuable

public void setContinuable(boolean continuable)
Specified by:
setContinuable in interface ChainResultsSummary

createStageResult

@NotNull
public ChainStageResult createStageResult(@NotNull
                                                  ImmutableChainStage chainStage)
Description copied from interface: ChainResultsSummary
Create a new ChainStageResult and associates it with the ChainResultsSummary

Specified by:
createStageResult in interface ChainResultsSummary
Parameters:
chainStage - the Stage related to result
Returns:
chainStageResult

addStageResult

public boolean addStageResult(@NotNull
                              ChainStageResult chainStageResult)
Description copied from interface: ChainResultsSummary
Add a stage result

Specified by:
addStageResult in interface ChainResultsSummary
Returns:
success

removeStageResult

public boolean removeStageResult(@NotNull
                                 ChainStageResult chainStageResult)
Description copied from interface: ChainResultsSummary
Remove a stage result

Specified by:
removeStageResult in interface ChainResultsSummary
Returns:
success

getPlan

@NotNull
public Chain getPlan()
Description copied from interface: ResultsSummary
Gets the Plan that this result belongs directly belongs to

Specified by:
getPlan in interface ChainResultsSummary
Specified by:
getPlan in interface ResultsSummary
Returns:
the owning plan for the result

isNotRunYet

public boolean isNotRunYet()
Description copied from interface: ResultsSummary
Tells whether this result belongs to a job that will run when next manual stage is kicked off

Specified by:
isNotRunYet in interface ResultsSummary
Returns:

isMarkedForDeletion

public boolean isMarkedForDeletion()
Specified by:
isMarkedForDeletion in interface ImmutableDeletable
Returns:
Whether or not the Object has been marked for deletion

getArtifactLinks

@NotNull
public java.util.List<ArtifactLink> getArtifactLinks()
Description copied from interface: ResultsSummary
Returns all artifacts associated with this build. Even if the files don't exist

Specified by:
getArtifactLinks in interface ResultsSummary
Returns:

getBuildCancelledDate

public java.util.Date getBuildCancelledDate()
Description copied from interface: ResultsSummary
When the build was cancelled

Specified by:
getBuildCancelledDate in interface ResultsSummary
Returns:
date of build cancellation or null if build was not cancelled

getBuildCompletedDate

public java.util.Date getBuildCompletedDate()
Description copied from interface: ResultsSummary
When the build finished

Specified by:
getBuildCompletedDate in interface ResultsSummary
Returns:

getBuildDate

public java.util.Date getBuildDate()
Description copied from interface: ResultStatisticsProvider
When the build was executed

Specified by:
getBuildDate in interface ResultStatisticsProvider
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 interface ResultStatisticsProvider
Returns:
build number of the described build

getBuildState

public BuildState getBuildState()
Description copied from interface: ResultStatisticsProvider
Build state.

Specified by:
getBuildState in interface ResultStatisticsProvider
Returns:
build state

getChangesListSummary

@NotNull
public java.lang.String getChangesListSummary()
Specified by:
getChangesListSummary in interface ResultsSummary

getComments

@NotNull
public java.util.List<Comment> getComments()
Description copied from interface: ResultsSummary
Gets the associated user comments for the build

Specified by:
getComments in interface ResultsSummary
Returns:

getCommentsToDisplay

public java.util.List<Comment> getCommentsToDisplay()
Description copied from interface: ResultsSummary
Gets the aggregated comments from the Jobs as well as the parent plan

Specified by:
getCommentsToDisplay in interface ResultsSummary
Returns:

getCustomBuildData

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
Description copied from interface: ResultsSummary
Custom data map to store random metadata about the build

Specified by:
getCustomBuildData in interface ResultsSummary
Returns:

getDeltaState

public DeltaState getDeltaState()
Description copied from interface: ResultsSummary
Gets the DeltaState 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 interface ResultsSummary
Returns:

getDuration

public long getDuration()
Description copied from interface: ResultsSummary
Duration of the build in milliseconds

Specified by:
getDuration in interface ResultsSummary
Specified by:
getDuration in interface ResultStatisticsProvider
Returns:
duration of the build in milliseconds

getJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getJiraIssues()
Description copied from interface: ResultsSummary
Returns all the JIRA issues linked to this build result

Specified by:
getJiraIssues in interface ResultsSummary
Returns:

getLabellings

public java.util.List<Labelling> getLabellings()
Description copied from interface: ResultsSummary
Tags / labels assocaited with the build

Specified by:
getLabellings in interface ResultsSummary
Returns:

getLifeCycleState

public LifeCycleState getLifeCycleState()
Specified by:
getLifeCycleState in interface ResultsSummary

getPlanKey

@NotNull
public PlanKey getPlanKey()
Description copied from interface: ResultsSummary
Full key of the plan. e.g BAM-MAIN

Specified by:
getPlanKey in interface ResultsSummary
Returns:

getProcessingDuration

public long getProcessingDuration()
Description copied from interface: ResultsSummary
Duration of actual build processing in miliseconds

Specified by:
getProcessingDuration in interface ResultsSummary
Specified by:
getProcessingDuration in interface ResultStatisticsProvider
Returns:
processing duration of the build in milliseconds

getQueueTime

public java.util.Date getQueueTime()
Description copied from interface: ResultsSummary
When the build queued

Specified by:
getQueueTime in interface ResultsSummary
Returns:

getReasonSummary

public java.lang.String getReasonSummary()
Specified by:
getReasonSummary in interface ResultsSummary

getRepositoryChangesets

@NotNull
public java.util.List<RepositoryChangeset> getRepositoryChangesets()
Specified by:
getRepositoryChangesets in interface ResultsSummary

getRestartCount

public int getRestartCount()
Description copied from interface: ResultsSummary
Return the number of build restart attempts

Specified by:
getRestartCount in interface ResultsSummary
Returns:

getSubscriptions

@NotNull
public java.util.List<ConsumedSubscription> getSubscriptions()
Description copied from interface: ResultsSummary
Returns list of consumed artifact dependencies ConsumedSubscription

Specified by:
getSubscriptions in interface ResultsSummary
Returns:

getSubstitutedVariables

@NotNull
public java.util.List<VariableSubstitution> getSubstitutedVariables()
Description copied from interface: ResultsSummary
Returns list of variables substituted during build execution

Specified by:
getSubstitutedVariables in interface ResultsSummary
Returns:

getTestResultsSummary

@NotNull
public TestResultsSummary getTestResultsSummary()
Specified by:
getTestResultsSummary in interface ResultsSummary
Returns:
a summary of all the tests that ran in this build.

getTimeToFix

public java.lang.Long getTimeToFix()
Description copied from interface: ResultsSummary
A stored version of how long (milli seconds) it took for this build to fix a failure.

Specified by:
getTimeToFix in interface ResultsSummary
Returns:
Null if not a fixing build

getTriggerReason

@NotNull
public TriggerReason getTriggerReason()
Description copied from interface: ResultsSummary
Why the build was was triggered

Specified by:
getTriggerReason in interface ResultsSummary
Returns:

getVariableContextLogs

@NotNull
public java.util.List<VariableContextSnapshot> getVariableContextLogs()
Specified by:
getVariableContextLogs in interface ResultsSummary

getPlanCompletedDate

public java.util.Date getPlanCompletedDate()
Specified by:
getPlanCompletedDate in interface ResultsSummary
Returns:
time when build finished

getTriggerManager

protected TriggerManager getTriggerManager()
Specified by:
getTriggerManager in class BaseResultSummary

getMergeResult

public MergeResultSummary getMergeResult()
Description copied from interface: ChainResultsSummary
Note: this API is experimental.

Specified by:
getMergeResult in interface ChainResultsSummary

setBuildAgentId

public void setBuildAgentId(java.lang.Long buildAgentId)
Specified by:
setBuildAgentId in interface ResultsSummary

getBuildAgentId

public java.lang.Long getBuildAgentId()
Description copied from interface: ResultsSummary
The id of the agent that built the result

Specified by:
getBuildAgentId in interface ResultsSummary
Returns:
Null if no agents involved or unknown

incrementRestartCount

public int incrementRestartCount()
Description copied from interface: ResultsSummary
Increments number of build restarts and returns the new value

Specified by:
incrementRestartCount in interface ResultsSummary
Returns:

setBuildCompletedDate

public void setBuildCompletedDate(java.util.Date completionDate)
Specified by:
setBuildCompletedDate in interface ResultsSummary

resetTestClassResults

public void resetTestClassResults(@NotNull
                                  java.util.List<TestClassResult> testClassResults)
Description copied from interface: ResultsSummary
Overrides all current testClassResults with the new ones

Specified by:
resetTestClassResults in interface ResultsSummary
Parameters:
testClassResults - to set

setBuildCancelledDate

public void setBuildCancelledDate(java.util.Date buildCancelledDate)
Specified by:
setBuildCancelledDate in interface ResultsSummary

setBuildDate

public void setBuildDate(java.util.Date buildDate)
Specified by:
setBuildDate in interface ResultsSummary

setDeltaState

public void setDeltaState(DeltaState deltaState)
Description copied from interface: ResultsSummary
Sets the DeltaState for the summary. Provides a status relative to the previous summary.

Specified by:
setDeltaState in interface ResultsSummary
Parameters:
deltaState - - the relative status for this summary

setDuration

public void setDuration(long duration)
Specified by:
setDuration in interface ResultsSummary
Parameters:
duration - duration of the build in milliseconds

setMarkedForDeletion

public void setMarkedForDeletion(boolean markedForDeletion)
Specified by:
setMarkedForDeletion in interface Deletable

setPlanCompletedDate

public void setPlanCompletedDate(@NotNull
                                 java.util.Date completionDate)
Description copied from interface: ResultsSummary
Sets the time when build finished.

Specified by:
setPlanCompletedDate in interface ResultsSummary

setProcessingDuration

public void setProcessingDuration(long processingDuration)
Specified by:
setProcessingDuration in interface ResultsSummary

setQueueTime

public void setQueueTime(java.util.Date queueDate)
Specified by:
setQueueTime in interface ResultsSummary

setTestResultsSummary

public void setTestResultsSummary(@NotNull
                                  TestResultsSummary testResultsSummary)
Description copied from interface: ResultsSummary
Set the test summary information from this build

Specified by:
setTestResultsSummary in interface ResultsSummary
Parameters:
testResultsSummary - the test summary information

setTimeToFix

public void setTimeToFix(java.lang.Long timeToFix)
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 interface ResultsSummary
Parameters:
timeToFix - how long (milli seconds) it took for this build to fix a failure.

setTriggerReason

public void setTriggerReason(TriggerReason triggerReason)
Specified by:
setTriggerReason in interface ResultsSummary

updateLifeCycleState

public void updateLifeCycleState(@NotNull
                                 LifeCycleState lifeCycleState,
                                 @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 interface ResultsSummary
Parameters:
lifeCycleState - lifeCycleState to be set
buildState - buildState to be set

setMergeResult

public void setMergeResult(@Nullable
                           MergeResultSummary mergeResult)
Description copied from interface: ChainResultsSummary
Note: this API is experimental.

Specified by:
setMergeResult in interface ChainResultsSummary


Copyright © 2012 Atlassian. All Rights Reserved.