com.atlassian.bamboo.resultsummary
Class BaseResultSummary

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

public abstract class BaseResultSummary
extends BambooEntityObject
implements ResultsSummary

Base class for mutable and immutable result summaries.

Since:
v3.4

Field Summary
protected static org.apache.commons.lang.time.FastDateFormat DATE_FORMAT
           
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
BaseResultSummary()
           
 
Method Summary
 int compareTo(ResultsSummary resultsSummary)
           
protected  java.lang.String createChangeListSummary()
           
 boolean equals(java.lang.Object object)
           
 java.util.Collection<ArtifactLink> getArtifactLinksThatExist()
          This returns live view of the getArtifactLinks()
 java.lang.String getBuildKey()
          Full key of the plan.
 java.lang.String getBuildResultKey()
          A full build result key e.g.
 java.lang.String getBuildTime()
          When did the build start?
 com.google.common.collect.ImmutableList<Commit> getCommits()
          List of commits associated with the build represented by this summary
 java.lang.String getDurationDescription()
          Returns the duration in a "pretty" format.
 double getDurationInSeconds()
          Build duration in seconds.
 java.util.Set<LinkedJiraIssue> getFixingJiraIssues()
          Return JIRA issues that this build result summary fixes
 java.util.Set<java.lang.String> getJiraIssueKeys()
          Returns all the JIRA issue keys linked to this build result
 java.util.List<java.lang.String> getLabelNames()
          A shortcust method to get all of the label names from the labbellings
 java.lang.String getLongReasonSummary()
           
 java.util.List<VariableSubstitution> getManuallyOverriddenVariables()
          Returns list of variables manually overridden variables
 PlanResultKey getPlanResultKey()
          Gets the PlanResultKey for this BuildResultsSummary
 java.lang.String getProcessingDurationDescription()
          Returns the processing duration in a "pretty" format.
 java.util.Set<LinkedJiraIssue> getRelatedJiraIssues()
          Returns JIRA issues that are related to this build result.
 java.lang.String getRelativeBuildDate()
           
 java.lang.String getRelativeBuildDate(java.util.Date comparedTo)
          Provides a relative build date, such as 2 hours ago.
 java.lang.String getRelativeBuildStartedDate()
          Returns the relative started time (duration) compared to current date
 java.lang.String getRelativeBuildStartedDate(java.util.Date comparedTo)
          Provides a relative build started date, such as 2 hours ago.
 java.lang.String getRelativeQueueDate()
           
 java.lang.String getRelativeQueueDate(java.util.Date comparedTo)
          Provides a relative queue date, such as 2 hours ago.
 java.lang.String getShortReasonSummary()
           
 java.util.Date getStatDate()
          When the build was executed.
 java.lang.String getTestSummary()
           
protected abstract  TriggerManager getTriggerManager()
           
 java.util.Set<Author> getUniqueAuthors()
          A shortcut method to get the unique set of authors contributing to this build.
 boolean hasChanges()
          Whether a build had changes or not
 boolean hasComments()
          Checks if the result has any user comments for the build
 boolean hasCommentsToDisplay()
          Whether there are any comments aggregated from the Jobs
 int hashCode()
           
 boolean isActive()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING or LifeCycleState.QUEUED or LifeCycleState.IN_PROGRESS
 boolean isFailed()
          Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.FAILED
 boolean isFinalized()
           
 boolean isFinished()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.FINISHED
 boolean isInProgress()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.IN_PROGRESS
 boolean isNotBuilt()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.NOT_BUILT
 boolean isPending()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING
 boolean isQueued()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.QUEUED
 boolean isSuccessful()
          Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.SUCCESS
 boolean isWaiting()
          Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING or LifeCycleState.QUEUED
 
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
getArtifactLinks, getBuildAgentId, getBuildCancelledDate, getBuildCompletedDate, getChangesListSummary, getComments, getCommentsToDisplay, getCustomBuildData, getDeltaState, getDuration, getJiraIssues, getLabellings, getLifeCycleState, getPlan, getPlanCompletedDate, getPlanKey, getProcessingDuration, getQueueTime, getReasonSummary, getRepositoryChangesets, getRestartCount, getSubscriptions, getSubstitutedVariables, getTestResultsSummary, getTimeToFix, getTriggerReason, getVariableContextLogs, incrementRestartCount, isNotRunYet, resetTestClassResults, setBuildAgentId, setBuildCancelledDate, setBuildCompletedDate, setBuildDate, setDeltaState, setDuration, setPlanCompletedDate, setProcessingDuration, setQueueTime, setTestResultsSummary, setTimeToFix, setTriggerReason, updateLifeCycleState
 
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
getBuildDate, getBuildNumber, getBuildState
 

Field Detail

DATE_FORMAT

protected static final org.apache.commons.lang.time.FastDateFormat DATE_FORMAT
Constructor Detail

BaseResultSummary

public BaseResultSummary()
Method Detail

isFailed

public boolean isFailed()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.FAILED

Specified by:
isFailed in interface ResultsSummary
Returns:

isSuccessful

public boolean isSuccessful()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.SUCCESS

Specified by:
isSuccessful in interface ResultsSummary
Returns:

isPending

public boolean isPending()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING

Specified by:
isPending in interface ResultsSummary
Returns:

isQueued

public boolean isQueued()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.QUEUED

Specified by:
isQueued in interface ResultsSummary
Returns:

isInProgress

public boolean isInProgress()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.IN_PROGRESS

Specified by:
isInProgress in interface ResultsSummary
Returns:

isNotBuilt

public boolean isNotBuilt()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.NOT_BUILT

Specified by:
isNotBuilt in interface ResultsSummary
Returns:

isFinalized

public boolean isFinalized()

isFinished

public boolean isFinished()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.FINISHED

Specified by:
isFinished in interface ResultsSummary
Returns:

isWaiting

public boolean isWaiting()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING or LifeCycleState.QUEUED

Specified by:
isWaiting in interface ResultsSummary
Returns:

isActive

public boolean isActive()
Description copied from interface: ResultsSummary
Shortcut method to see if ResultsSummary.getLifeCycleState() is LifeCycleState.PENDING or LifeCycleState.QUEUED or LifeCycleState.IN_PROGRESS

Specified by:
isActive in interface ResultsSummary
Returns:

getPlanResultKey

@NotNull
public PlanResultKey getPlanResultKey()
Description copied from interface: ResultsSummary
Gets the PlanResultKey for this BuildResultsSummary

Specified by:
getPlanResultKey in interface ResultsSummary
Returns:
planResultKey

getBuildResultKey

@NotNull
public java.lang.String getBuildResultKey()
Description copied from interface: ResultsSummary
A full build result key e.g. BAM-MAIN-100

Specified by:
getBuildResultKey in interface ResultsSummary
Returns:
String

getDurationDescription

@NotNull
public java.lang.String getDurationDescription()
Description copied from interface: ResultsSummary
Returns the duration in a "pretty" format. Handles when duration is not known

Specified by:
getDurationDescription in interface ResultsSummary
Returns:
formatted duration

getRelativeBuildDate

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

getRelativeQueueDate

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

getRelativeBuildStartedDate

public java.lang.String getRelativeBuildStartedDate()
Description copied from interface: ResultsSummary
Returns the relative started time (duration) compared to current date

Specified by:
getRelativeBuildStartedDate in interface ResultsSummary
Returns:
relative duration

getRelativeBuildDate

public java.lang.String getRelativeBuildDate(java.util.Date comparedTo)
Provides a relative build date, such as 2 hours ago.

Specified by:
getRelativeBuildDate in interface ResultsSummary
Returns:
The relative date

getRelativeQueueDate

public java.lang.String getRelativeQueueDate(java.util.Date comparedTo)
Provides a relative queue date, such as 2 hours ago.

Specified by:
getRelativeQueueDate in interface ResultsSummary
Returns:
The relative date

getRelativeBuildStartedDate

public java.lang.String getRelativeBuildStartedDate(java.util.Date comparedTo)
Provides a relative build started date, such as 2 hours ago.

Specified by:
getRelativeBuildStartedDate in interface ResultsSummary
Returns:
The relative date

getShortReasonSummary

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

getLongReasonSummary

public java.lang.String getLongReasonSummary()

getTriggerManager

protected abstract TriggerManager getTriggerManager()

getFixingJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getFixingJiraIssues()
Description copied from interface: ResultsSummary
Return JIRA issues that this build result summary fixes

Specified by:
getFixingJiraIssues in interface ResultsSummary
Returns:

getRelatedJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getRelatedJiraIssues()
Description copied from interface: ResultsSummary
Returns JIRA issues that are related to this build result. Does not include fixing issues

Specified by:
getRelatedJiraIssues in interface ResultsSummary
Returns:

hasChanges

public boolean hasChanges()
Description copied from interface: ResultsSummary
Whether a build had changes or not

Specified by:
hasChanges in interface ResultsSummary
Returns:

getBuildKey

@NotNull
public java.lang.String getBuildKey()
Description copied from interface: ResultsSummary
Full key of the plan. e.g BAM-MAIN

Specified by:
getBuildKey in interface ResultsSummary
Returns:

getStatDate

public java.util.Date getStatDate()
Description copied from interface: ResultStatisticsProvider
When the build was executed. If build was not completed, queued time is provided instead.

Specified by:
getStatDate in interface ResultStatisticsProvider
Returns:
date of build execution or queued time if build was not executed or state is unknown

getJiraIssueKeys

public java.util.Set<java.lang.String> getJiraIssueKeys()
Description copied from interface: ResultsSummary
Returns all the JIRA issue keys linked to this build result

Specified by:
getJiraIssueKeys in interface ResultsSummary
Returns:

getLabelNames

@NotNull
public java.util.List<java.lang.String> getLabelNames()
Description copied from interface: ResultsSummary
A shortcust method to get all of the label names from the labbellings

Specified by:
getLabelNames in interface ResultsSummary
Returns:

getUniqueAuthors

public java.util.Set<Author> getUniqueAuthors()
Description copied from interface: ResultsSummary
A shortcut method to get the unique set of authors contributing to this build.

Specified by:
getUniqueAuthors in interface ResultsSummary
Returns:
Set of Authors

getDurationInSeconds

public double getDurationInSeconds()
Description copied from interface: ResultStatisticsProvider
Build duration in seconds.

Specified by:
getDurationInSeconds in interface ResultStatisticsProvider
Returns:
build duration

getArtifactLinksThatExist

public java.util.Collection<ArtifactLink> getArtifactLinksThatExist()
This returns live view of the getArtifactLinks()

Specified by:
getArtifactLinksThatExist in interface ResultsSummary
Returns:

getProcessingDurationDescription

public java.lang.String getProcessingDurationDescription()
Description copied from interface: ResultsSummary
Returns the processing duration in a "pretty" format. Handles unknown processing duration.

Specified by:
getProcessingDurationDescription in interface ResultsSummary
Returns:
formatted processing duration

getBuildTime

public java.lang.String getBuildTime()
When did the build start?

Specified by:
getBuildTime in interface ResultsSummary
Returns:
The date and time of the build.

createChangeListSummary

protected java.lang.String createChangeListSummary()

getCommits

public com.google.common.collect.ImmutableList<Commit> getCommits()
Description copied from interface: ResultsSummary
List of commits associated with the build represented by this summary

Specified by:
getCommits in interface ResultsSummary
Returns:
list of commits

getTestSummary

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

compareTo

public int compareTo(ResultsSummary resultsSummary)
Specified by:
compareTo in interface java.lang.Comparable<ResultsSummary>

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class com.atlassian.core.bean.EntityObject

hashCode

public int hashCode()
Overrides:
hashCode in class com.atlassian.core.bean.EntityObject

getManuallyOverriddenVariables

public java.util.List<VariableSubstitution> getManuallyOverriddenVariables()
Description copied from interface: ResultsSummary
Returns list of variables manually overridden variables

Specified by:
getManuallyOverriddenVariables in interface ResultsSummary
Returns:

hasComments

public boolean hasComments()
Description copied from interface: ResultsSummary
Checks if the result has any user comments for the build

Specified by:
hasComments in interface ResultsSummary
Returns:

hasCommentsToDisplay

public boolean hasCommentsToDisplay()
Description copied from interface: ResultsSummary
Whether there are any comments aggregated from the Jobs

Specified by:
hasCommentsToDisplay in interface ResultsSummary
Returns:


Copyright © 2012 Atlassian. All Rights Reserved.