com.atlassian.bamboo.resultsummary
Class AbstractResultsSummary

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.resultsummary.AbstractResultsSummary
All Implemented Interfaces:
BambooIdProvider, BambooObject, Deletable, ImmutableDeletable, MutableBuildKeyResultsSummary, ResultsSummary, ResultStatisticsProvider, java.lang.Cloneable, java.lang.Comparable<ResultsSummary>
Direct Known Subclasses:
BuildResultsSummaryDocument, BuildResultsSummaryImpl, ChainResultsSummaryImpl

public abstract class AbstractResultsSummary
extends BaseResultSummary
implements Deletable, MutableBuildKeyResultsSummary


Field Summary
protected  BuildState buildState
           
protected  LifeCycleState lifeCycleState
           
protected  boolean markedForDeletion
           
protected static com.google.common.base.Supplier<PlanManager> planManagerRef
           
protected static com.google.common.base.Supplier<PlanManager> planManagerSupplier
           
 
Fields inherited from class com.atlassian.bamboo.resultsummary.BaseResultSummary
DATE_FORMAT
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
AbstractResultsSummary()
           
 
Method Summary
 java.util.Collection<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()
          Date when build was passed to execution.
 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.
 java.lang.String getDiscriminator()
           
 long getDuration()
          Duration of the build in milliseconds
 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()
           
 Plan 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()
          Date when build was queued.
 java.lang.String getReasonSummary()
           
 java.util.List<RepositoryChangeset> getRepositoryChangesets()
           
 int getRestartCount()
          Return the number of build restart attempts
 java.lang.Long getStageResultId()
           
 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
 java.util.List<TestClassResult> getTestClassResults()
           
 TestResultsSummary getTestResultsSummary()
           
 java.lang.Long getTimeToFix()
          A stored version of how long (milli seconds) it took for this build to fix a failure.
protected  TriggerManager getTriggerManager()
           
 TriggerReason getTriggerReason()
          Why the build was was triggered
 java.lang.String getTriggerReasonKey()
           
 java.util.List<VariableContextSnapshot> getVariableContextLogs()
           
 int incrementRestartCount()
          Increments number of build restarts and returns the new value
 void resetTestClassResults(java.util.List<TestClassResult> testClassResults)
          Overrides all current testClassResults with the new ones
 void setArtifactLinks(java.util.List<ArtifactLink> artifactLinks)
           
 void setBuildAgentId(java.lang.Long buildAgentId)
           
 void setBuildCancelledDate(java.util.Date buildCancelledDate)
           
 void setBuildCompletedDate(java.util.Date buildCompletedDate)
           
 void setBuildDate(java.util.Date buildDate)
           
 void setBuildKey(java.lang.String buildKey)
           
 void setBuildNumber(int buildNumber)
           
 void setBuildState(BuildState buildState)
           
 void setComments(java.util.List<Comment> comments)
           
 void setCustomBuildData(java.util.Map<java.lang.String,java.lang.String> customBuildData)
           
 void setDeltaState(DeltaState deltaState)
          Sets the DeltaState for the summary.
 void setDiscriminator(java.lang.String discriminator)
           
 void setDuration(long duration)
           
 void setJiraIssues(java.util.Set jiraIssues)
           
 void setLabellings(java.util.List<Labelling> labellings)
           
 void setLifeCycleState(LifeCycleState lifeCycleState)
           
 void setPlanCompletedDate(java.util.Date completionDate)
          Sets the time when build finished.
 void setPlanKey(PlanKey planKey)
           
 void setProcessingDuration(long processingDuration)
           
 void setQueueTime(java.util.Date queueTime)
           
 void setRestartCount(int restartCount)
           
 void setStageResultId(java.lang.Long stageResultId)
           
 void setSubscriptions(java.util.List<ConsumedSubscription> subscriptions)
           
 void setSubstitutedVariables(java.util.List<VariableSubstitution> substitutedVariables)
           
 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 setTriggerReasonKey(java.lang.String triggerReasonKey)
           
 void setVariableContextLogs(java.util.List<VariableContextSnapshot> variableContextLogs)
           
 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, isNotRunYet, isPending, isQueued, isSuccessful, isWaiting
 
Methods inherited from interface com.atlassian.bamboo.deletion.Deletable
setMarkedForDeletion
 
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.plan.cache.ImmutableDeletable
isMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultStatisticsProvider
getDurationInSeconds, getStatDate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

markedForDeletion

protected boolean markedForDeletion

buildState

protected BuildState buildState

lifeCycleState

protected LifeCycleState lifeCycleState

planManagerRef

protected static final com.google.common.base.Supplier<PlanManager> planManagerRef

planManagerSupplier

protected static final com.google.common.base.Supplier<PlanManager> planManagerSupplier
Constructor Detail

AbstractResultsSummary

public AbstractResultsSummary()
Method Detail

getPlan

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

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

getReasonSummary

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

setBuildKey

public void setBuildKey(java.lang.String buildKey)
Specified by:
setBuildKey in interface MutableBuildKeyResultsSummary

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

setBuildNumber

public void setBuildNumber(int buildNumber)

getBuildDate

public java.util.Date 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 interface ResultStatisticsProvider
Returns:

setBuildDate

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

getQueueTime

public java.util.Date 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 interface ResultsSummary
Returns:

setQueueTime

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

getBuildCompletedDate

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

Specified by:
getBuildCompletedDate in interface ResultsSummary
Returns:

setBuildCompletedDate

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

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:

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

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:

setJiraIssues

public void setJiraIssues(java.util.Set jiraIssues)

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:

setCustomBuildData

public void setCustomBuildData(java.util.Map<java.lang.String,java.lang.String> customBuildData)

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

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.

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:

setLabellings

public void setLabellings(java.util.List<Labelling> labellings)

setComments

public void setComments(java.util.List<Comment> comments)

getArtifactLinks

@NotNull
public java.util.Collection<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:

setArtifactLinks

public void setArtifactLinks(java.util.List<ArtifactLink> artifactLinks)

getSubscriptions

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:

setSubscriptions

public void setSubscriptions(java.util.List<ConsumedSubscription> subscriptions)

getTriggerReasonKey

public java.lang.String getTriggerReasonKey()

setTriggerReasonKey

public void setTriggerReasonKey(java.lang.String triggerReasonKey)

getTriggerReason

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

Specified by:
getTriggerReason in interface ResultsSummary
Returns:

setTriggerReason

public void setTriggerReason(TriggerReason triggerReason)
Specified by:
setTriggerReason 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

setBuildAgentId

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

getCommentsToDisplay

@NotNull
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:

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

setDuration

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

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

setProcessingDuration

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

getPlanCompletedDate

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

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

getBuildCancelledDate

@Nullable
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

setBuildCancelledDate

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

getChangesListSummary

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

getTriggerManager

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

getBuildState

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

Specified by:
getBuildState in interface ResultStatisticsProvider
Returns:
build state

setBuildState

public void setBuildState(BuildState buildState)

getLifeCycleState

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

setLifeCycleState

public void setLifeCycleState(LifeCycleState lifeCycleState)

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

getDiscriminator

public java.lang.String getDiscriminator()

setDiscriminator

public void setDiscriminator(java.lang.String discriminator)

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:

getRepositoryChangesets

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

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:

setSubstitutedVariables

public void setSubstitutedVariables(java.util.List<VariableSubstitution> substitutedVariables)

getVariableContextLogs

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

setVariableContextLogs

public void setVariableContextLogs(java.util.List<VariableContextSnapshot> variableContextLogs)

getTestResultsSummary

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

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

getTestClassResults

@NotNull
public java.util.List<TestClassResult> getTestClassResults()

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

getStageResultId

public java.lang.Long getStageResultId()

setStageResultId

public void setStageResultId(java.lang.Long stageResultId)

getRestartCount

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

Specified by:
getRestartCount in interface ResultsSummary
Returns:

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:

setRestartCount

public void setRestartCount(int restartCount)

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:

setPlanKey

public void setPlanKey(PlanKey planKey)
Specified by:
setPlanKey in interface MutableBuildKeyResultsSummary


Copyright © 2012 Atlassian. All Rights Reserved.