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, ImmutableResultsSummary, ResultStatisticsProvider, java.lang.Cloneable, java.lang.Comparable<ImmutableResultsSummary>
Direct Known Subclasses:
AbstractResultsSummary, ImmutableResultsSummaryImpl

public abstract class BaseResultSummary
extends BambooEntityObject
implements ImmutableResultsSummary

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
 
Fields inherited from interface com.atlassian.bamboo.resultsummary.ImmutableResultsSummary
CUSTOM_DATA_BUILD_KEY
 
Constructor Summary
BaseResultSummary()
           
 
Method Summary
 int compareTo(ImmutableResultsSummary resultsSummary)
           
protected  java.lang.String createChangeListSummary()
           
 boolean equals(java.lang.Object object)
          This method needs to be here in order to use proper id
 java.util.Collection<ArtifactLink> getArtifactLinksThatExist()
          Deprecated. 
 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 shortcut method to get all of the label names from the labellings
 java.util.List<VariableSubstitution> getManuallyOverriddenVariables()
          Returns list of variables manually overridden variables
 PlanResultKey getPlanResultKey()
          Gets the PlanResultKey for this ImmutableResultsSummary
 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()
          Deprecated. 
 int hashCode()
          This method needs to be here in order to use proper id
 boolean isActive()
          Shortcut method to see if ImmutableResultsSummary.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 ImmutableResultsSummary.getLifeCycleState() is LifeCycleState.FINISHED
 boolean isInProgress()
          Shortcut method to see if ImmutableResultsSummary.getLifeCycleState() is LifeCycleState.IN_PROGRESS
 boolean isNotBuilt()
          Shortcut method to see if ImmutableResultsSummary.getLifeCycleState() is LifeCycleState.NOT_BUILT
 boolean isPending()
          Shortcut method to see if ImmutableResultsSummary.getLifeCycleState() is LifeCycleState.PENDING
 boolean isQueued()
          Shortcut method to see if ImmutableResultsSummary.getLifeCycleState() is LifeCycleState.QUEUED
 boolean isSuccessful()
          Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState#SUCCESS
 boolean isWaiting()
          Shortcut method to see if ImmutableResultsSummary.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.ImmutableResultsSummary
getArtifactLinks, getBuildAgentId, getBuildCancelledDate, getBuildCompletedDate, getChangesListSummary, getComments, getCommentsToDisplay, getCustomBuildData, getDeltaState, getDuration, getImmutablePlan, getJiraIssues, getLabellings, getLifeCycleState, getPlan, getPlanKey, getProcessingDuration, getQueueTime, getReasonSummary, getRepositoryChangesets, getRestartCount, getSubscriptions, getSubstitutedVariables, getTestResultsSummary, getTimeToFix, getTriggerReason, getVariableContext, getVariableContextLogs, isCustomBuild, isNotRunYet, isOnceOff, isRebuild
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 
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: ImmutableResultsSummary
Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState#FAILED

Specified by:
isFailed in interface ImmutableResultsSummary
Returns:

isSuccessful

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

Specified by:
isSuccessful in interface ImmutableResultsSummary
Returns:

isPending

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

Specified by:
isPending in interface ImmutableResultsSummary
Returns:

isQueued

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

Specified by:
isQueued in interface ImmutableResultsSummary
Returns:

isInProgress

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

Specified by:
isInProgress in interface ImmutableResultsSummary
Returns:

isNotBuilt

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

Specified by:
isNotBuilt in interface ImmutableResultsSummary
Returns:

isFinalized

public boolean isFinalized()

isFinished

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

Specified by:
isFinished in interface ImmutableResultsSummary
Returns:

isWaiting

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

Specified by:
isWaiting in interface ImmutableResultsSummary
Returns:

isActive

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

Specified by:
isActive in interface ImmutableResultsSummary
Returns:

getPlanResultKey

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

Specified by:
getPlanResultKey in interface ImmutableResultsSummary
Returns:
planResultKey

getDurationDescription

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

Specified by:
getDurationDescription in interface ImmutableResultsSummary
Returns:
formatted duration

getRelativeBuildDate

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

getRelativeQueueDate

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

getRelativeBuildStartedDate

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

Specified by:
getRelativeBuildStartedDate in interface ImmutableResultsSummary
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 ImmutableResultsSummary
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 ImmutableResultsSummary
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 ImmutableResultsSummary
Returns:
The relative date

getShortReasonSummary

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

getTriggerManager

protected abstract TriggerManager getTriggerManager()

getFixingJiraIssues

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

Specified by:
getFixingJiraIssues in interface ImmutableResultsSummary
Returns:

getRelatedJiraIssues

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

Specified by:
getRelatedJiraIssues in interface ImmutableResultsSummary
Returns:

hasChanges

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

Specified by:
hasChanges in interface ImmutableResultsSummary
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: ImmutableResultsSummary
Returns all the JIRA issue keys linked to this build result

Specified by:
getJiraIssueKeys in interface ImmutableResultsSummary
Returns:

getLabelNames

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

Specified by:
getLabelNames in interface ImmutableResultsSummary
Returns:

getUniqueAuthors

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

Specified by:
getUniqueAuthors in interface ImmutableResultsSummary
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

@Deprecated
public java.util.Collection<ArtifactLink> getArtifactLinksThatExist()
Deprecated. 

This returns live view of the getArtifactLinks()

Specified by:
getArtifactLinksThatExist in interface ImmutableResultsSummary
Returns:

getProcessingDurationDescription

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

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

getBuildTime

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

Specified by:
getBuildTime in interface ImmutableResultsSummary
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: ImmutableResultsSummary
List of commits associated with the build represented by this summary

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

getTestSummary

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

compareTo

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

equals

public boolean equals(java.lang.Object object)
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
equals in class BambooEntityObject

hashCode

public int hashCode()
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
hashCode in class BambooEntityObject

getManuallyOverriddenVariables

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

Specified by:
getManuallyOverriddenVariables in interface ImmutableResultsSummary
Returns:

hasComments

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

Specified by:
hasComments in interface ImmutableResultsSummary
Returns:

hasCommentsToDisplay

@Deprecated
public boolean hasCommentsToDisplay()
Deprecated. 

Description copied from interface: ImmutableResultsSummary
Whether there are any comments aggregated from the Jobs

Specified by:
hasCommentsToDisplay in interface ImmutableResultsSummary
Returns:


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.