com.atlassian.bamboo.index
Class BuildResultsSummaryDocument

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.resultsummary.AbstractResultsSummary
              extended by com.atlassian.bamboo.index.BuildResultsSummaryDocument
All Implemented Interfaces:
ChainResultsSummary, BambooObject, BuildResultsSummary, ExtendedBuildResultsSummary, MutableBuildKeyResultsSummary, ResultsSummary, ResultStatisticsProvider, java.lang.Cloneable, java.lang.Comparable<ResultsSummary>

public class BuildResultsSummaryDocument
extends AbstractResultsSummary
implements BuildResultsSummary, ChainResultsSummary

A lucene implementation of an AbstractResultsSummary which mirrors the BuildResultsSummary object closely.


Field Summary
static java.util.List<java.lang.String> CUSTOM_DATA_MAP_KEYS_TO_INDEX
           
static java.lang.String DOCTYPE_BUILD_RESULT
           
static java.lang.String FIELD_ARTIFACTS
           
static java.lang.String FIELD_AUTHORS
           
static java.lang.String FIELD_AUTHORS_LINKED_USER_SUFFIX
           
static java.lang.String FIELD_BUILD_AGENT_ID
           
static java.lang.String FIELD_BUILD_ID
           
static java.lang.String FIELD_BUILD_KEY
           
static java.lang.String FIELD_BUILD_NUMBER
           
static java.lang.String FIELD_BUILD_RESULT_ID
          ID term that gets added to both test and build result documents
static java.lang.String FIELD_COMMENT_CONTENT
           
static java.lang.String FIELD_COMMENT_DATE
           
static java.lang.String FIELD_COMMENT_USERNAME
           
static java.lang.String FIELD_COMPLETED_TIMESTAMP
           
static java.lang.String FIELD_CUSTOM_DATA_PREFIX
           
static java.lang.String FIELD_DELTA_STATE
           
static java.lang.String FIELD_DOC_TYPE
           
static java.lang.String FIELD_DURATION
           
static java.lang.String FIELD_ID
          IF term that only gets addded build results documents
static java.lang.String FIELD_JIRA_ISSUE_KEY
           
static java.lang.String FIELD_JIRA_ISSUE_KEY_FIXES
           
static java.lang.String FIELD_JIRA_PROJECT_KEY
           
static java.lang.String FIELD_LABELS
           
static java.lang.String FIELD_LIFE_CYCLE_STATE
           
static java.lang.String FIELD_QUEUE_TIME
           
static java.lang.String FIELD_STATE
           
static java.lang.String FIELD_TESTS_BROKEN_COUNT
           
static java.lang.String FIELD_TESTS_EXISTING_COUNT
           
static java.lang.String FIELD_TESTS_FAILED_COUNT
           
static java.lang.String FIELD_TESTS_FIXED_COUNT
           
static java.lang.String FIELD_TESTS_SUCCESS_COUNT
           
static java.lang.String FIELD_TESTS_TOTAL_COUNT
           
static java.lang.String FIELD_TIME_TO_FIX
           
static java.lang.String FIELD_TIMESTAMP
           
static java.lang.String FIELD_TIMESTAMP_DAY
           
static java.lang.String FIELD_TRIGGER_REASON_KEY
           
static java.lang.String FIELD_TYPE
           
static java.lang.String FIELD_VCS_REVISION_KEY
           
static java.lang.String FIELD_VCS_UPDATE_TIME
           
 
Fields inherited from class com.atlassian.bamboo.resultsummary.AbstractResultsSummary
buildState, lifeCycleState
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
BuildResultsSummaryDocument(org.apache.lucene.document.Document doc, BuildResultsSummaryManager buildResultsSummaryManager)
           
 
Method Summary
 boolean addStageResult(ChainStageResult chainStageResult)
          Add a stage result
 int compareTo(ResultsSummary obj)
           
 ChainStageResult createStageResult(ChainStage chainStage)
          Create a new ChainStageResult and associates it with the ChainResultsSummary
 boolean equals(java.lang.Object object)
           
 java.util.Collection<ArtifactLink> getArtifactLinks()
          Returns all artifacts associated with this build.
 ChainResultsSummary getChainResultsSummary()
          Not available from Lucene
 java.util.List<Comment> getComments()
          Gets the associated user comments for the build
 java.util.Set<Commit> getCommits()
          Any Commits related to this BuildResultsSummary Note that if you fetched this result from Lucene that accessing this property will cause a database hit
 ExtraBuildResultsData getExtraBuildResultsData()
          Allow access to ExtraBuildResultsData
 java.util.List<BuildResultsSummary> getFailedJobResults()
          Get a list of all failed job Results in this chain result
 FilteredTestResults getFilteredTestResults()
          Return a filtered view of all the tests that ran in this build.
 java.util.Set<java.lang.String> getJiraIssueKeys()
          Returns all the JIRA issue keys linked to this build 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
 java.util.List<java.lang.String> getLabelNames()
          A shortcust method to get all of the label names from the labbellings
 java.util.List<ResultsSummary> getOrderedJobResultSummaries()
          Returns all jobs ResultsSummary related to chain result summary Summaries are ordered by stages
 java.util.Collection<ArtifactLink> getProducedArtifactLinks()
          Returns all artifacts produced by this build.
 long getQueueDuration()
          How long build was in the queue (in miliseconds)
 java.util.Date getQueueTime()
          Date when build was queued.
 java.util.List<ChainStageResult> getStageResults()
          Get all the ChainStageResult's associated with this ChainResultsSummary
 FilteredTestResults getTestResults()
          Get the helper class to provide filtered test lists for this chain result
 int getTotalJobCount()
           
 java.util.Set<Author> getUniqueAuthors()
          A shortcut method to get the unique set of authors contributing to this build.
 long getVcsUpdateDuration()
          How long checkout take (in miliseconds)
 java.util.Date getVcsUpdateTime()
          When the source syncronisation was kicked off
 int hashCode()
           
 boolean removeStageResult(ChainStageResult chainStageResult)
          Remove a stage result
 void resetTestClassResults(java.util.List<TestClassResult> testClassResults)
          Overrides all current testClassResults with the new ones
 void setChainResultsSummary(ChainResultsSummary chainResultSummary)
           
 void setQueueTime(java.util.Date queueTime)
           
 void setVcsUpdateTime(java.util.Date vcsUpdateTime)
           
 
Methods inherited from class com.atlassian.bamboo.resultsummary.AbstractResultsSummary
getArtifactLinksThatExist, getBuildAgentId, getBuildCancelledDate, getBuildCompletedDate, getBuildDate, getBuildKey, getBuildNumber, getBuildResultKey, getBuildState, getBuildTime, getChangesListSummary, getCommentsToDisplay, getCustomBuildData, getDeltaState, getDiscriminator, getDuration, getDurationDescription, getDurationInSeconds, getFailedTestCount, getFixingJiraIssues, getLifeCycleState, getLongReasonSummary, getManuallyOverriddenVariables, getPlan, getPlanCompletedDate, getPlanResultKey, getReasonSummary, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getSkippedCommitsCount, getStatDate, getSubscriptions, getSubstitutedVariables, getSuccessfulTestCount, getTestClassResults, getTestResultsSummary, getTestSummary, getTextProvider, getTimeToFix, getTriggerReason, getTriggerReasonKey, getTriggerReasonManager, getVcsRevisionKey, hasChanges, hasComments, hasCommentsToDisplay, isActive, isFailed, isFinalized, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting, setArtifactLinks, setBuildAgentId, setBuildCancelledDate, setBuildCompletedDate, setBuildDate, setBuildKey, setBuildNumber, setBuildState, setComments, setCommits, setCustomBuildData, setDeltaState, setDiscriminator, setDuration, setJiraIssues, setLabellings, setLifeCycleState, setPlanCompletedDate, setSkippedCommitsCount, setSubscriptions, setSubstitutedVariables, setTestResultsSummary, setTimeToFix, setTriggerReason, setTriggerReasonKey, setVcsRevisionKey, updateLifeCycleState
 
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.BuildResultsSummary
getBuildAgentId
 
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultsSummary
getArtifactLinksThatExist, getBuildCancelledDate, getBuildCompletedDate, getBuildKey, getBuildResultKey, getBuildTime, getChangesListSummary, getCustomBuildData, getDeltaState, getDuration, getDurationDescription, getFailedTestCount, getFixingJiraIssues, getLifeCycleState, getManuallyOverriddenVariables, getPlan, getPlanCompletedDate, getPlanResultKey, getReasonSummary, getRelatedJiraIssues, getRelativeBuildDate, getRelativeBuildDate, getRelativeQueueDate, getRelativeQueueDate, getShortReasonSummary, getSkippedCommitsCount, getSubscriptions, getSubstitutedVariables, getSuccessfulTestCount, getTestResultsSummary, getTestSummary, getTimeToFix, getTriggerReason, getVcsRevisionKey, hasChanges, hasComments, isActive, isFailed, isFinished, isInProgress, isNotBuilt, isPending, isQueued, isSuccessful, isWaiting, setBuildCancelledDate, setBuildDate, setDeltaState, setDuration, setPlanCompletedDate, setTestResultsSummary, setTimeToFix, setTriggerReason, setVcsRevisionKey, updateLifeCycleState
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 
Methods inherited from interface com.atlassian.bamboo.resultsummary.ResultStatisticsProvider
getBuildDate, getBuildNumber, getBuildState, getDurationInSeconds, getStatDate
 

Field Detail

FIELD_ID

public static final java.lang.String FIELD_ID
IF term that only gets addded build results documents

See Also:
Constant Field Values

FIELD_BUILD_RESULT_ID

public static final java.lang.String FIELD_BUILD_RESULT_ID
ID term that gets added to both test and build result documents

See Also:
Constant Field Values

FIELD_BUILD_NUMBER

public static final java.lang.String FIELD_BUILD_NUMBER
See Also:
Constant Field Values

FIELD_BUILD_KEY

public static final java.lang.String FIELD_BUILD_KEY
See Also:
Constant Field Values

FIELD_BUILD_ID

public static final java.lang.String FIELD_BUILD_ID
See Also:
Constant Field Values

FIELD_STATE

public static final java.lang.String FIELD_STATE
See Also:
Constant Field Values

FIELD_LIFE_CYCLE_STATE

public static final java.lang.String FIELD_LIFE_CYCLE_STATE
See Also:
Constant Field Values

FIELD_TIMESTAMP

public static final java.lang.String FIELD_TIMESTAMP
See Also:
Constant Field Values

FIELD_COMPLETED_TIMESTAMP

public static final java.lang.String FIELD_COMPLETED_TIMESTAMP
See Also:
Constant Field Values

FIELD_TIMESTAMP_DAY

public static final java.lang.String FIELD_TIMESTAMP_DAY
See Also:
Constant Field Values

FIELD_DOC_TYPE

public static final java.lang.String FIELD_DOC_TYPE
See Also:
Constant Field Values

DOCTYPE_BUILD_RESULT

public static final java.lang.String DOCTYPE_BUILD_RESULT
See Also:
Constant Field Values

FIELD_DURATION

public static final java.lang.String FIELD_DURATION
See Also:
Constant Field Values

FIELD_JIRA_ISSUE_KEY

public static final java.lang.String FIELD_JIRA_ISSUE_KEY
See Also:
Constant Field Values

FIELD_JIRA_ISSUE_KEY_FIXES

public static final java.lang.String FIELD_JIRA_ISSUE_KEY_FIXES
See Also:
Constant Field Values

FIELD_JIRA_PROJECT_KEY

public static final java.lang.String FIELD_JIRA_PROJECT_KEY
See Also:
Constant Field Values

FIELD_AUTHORS

public static final java.lang.String FIELD_AUTHORS
See Also:
Constant Field Values

FIELD_AUTHORS_LINKED_USER_SUFFIX

public static final java.lang.String FIELD_AUTHORS_LINKED_USER_SUFFIX
See Also:
Constant Field Values

FIELD_TRIGGER_REASON_KEY

public static final java.lang.String FIELD_TRIGGER_REASON_KEY
See Also:
Constant Field Values

FIELD_DELTA_STATE

public static final java.lang.String FIELD_DELTA_STATE
See Also:
Constant Field Values

FIELD_LABELS

public static final java.lang.String FIELD_LABELS
See Also:
Constant Field Values

FIELD_TIME_TO_FIX

public static final java.lang.String FIELD_TIME_TO_FIX
See Also:
Constant Field Values

FIELD_VCS_REVISION_KEY

public static final java.lang.String FIELD_VCS_REVISION_KEY
See Also:
Constant Field Values

FIELD_BUILD_AGENT_ID

public static final java.lang.String FIELD_BUILD_AGENT_ID
See Also:
Constant Field Values

FIELD_ARTIFACTS

public static final java.lang.String FIELD_ARTIFACTS
See Also:
Constant Field Values

FIELD_CUSTOM_DATA_PREFIX

public static final java.lang.String FIELD_CUSTOM_DATA_PREFIX
See Also:
Constant Field Values

FIELD_COMMENT_CONTENT

public static final java.lang.String FIELD_COMMENT_CONTENT
See Also:
Constant Field Values

FIELD_COMMENT_USERNAME

public static final java.lang.String FIELD_COMMENT_USERNAME
See Also:
Constant Field Values

FIELD_COMMENT_DATE

public static final java.lang.String FIELD_COMMENT_DATE
See Also:
Constant Field Values

FIELD_TESTS_SUCCESS_COUNT

public static final java.lang.String FIELD_TESTS_SUCCESS_COUNT
See Also:
Constant Field Values

FIELD_TESTS_FAILED_COUNT

public static final java.lang.String FIELD_TESTS_FAILED_COUNT
See Also:
Constant Field Values

FIELD_TESTS_FIXED_COUNT

public static final java.lang.String FIELD_TESTS_FIXED_COUNT
See Also:
Constant Field Values

FIELD_TESTS_BROKEN_COUNT

public static final java.lang.String FIELD_TESTS_BROKEN_COUNT
See Also:
Constant Field Values

FIELD_TESTS_EXISTING_COUNT

public static final java.lang.String FIELD_TESTS_EXISTING_COUNT
See Also:
Constant Field Values

FIELD_TESTS_TOTAL_COUNT

public static final java.lang.String FIELD_TESTS_TOTAL_COUNT
See Also:
Constant Field Values

FIELD_QUEUE_TIME

public static final java.lang.String FIELD_QUEUE_TIME
See Also:
Constant Field Values

FIELD_VCS_UPDATE_TIME

public static final java.lang.String FIELD_VCS_UPDATE_TIME
See Also:
Constant Field Values

FIELD_TYPE

public static final java.lang.String FIELD_TYPE
See Also:
Constant Field Values

CUSTOM_DATA_MAP_KEYS_TO_INDEX

public static final java.util.List<java.lang.String> CUSTOM_DATA_MAP_KEYS_TO_INDEX
Constructor Detail

BuildResultsSummaryDocument

public BuildResultsSummaryDocument(org.apache.lucene.document.Document doc,
                                   @NotNull
                                   BuildResultsSummaryManager buildResultsSummaryManager)
Method Detail

getQueueTime

public java.util.Date getQueueTime()
Description copied from class: AbstractResultsSummary
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
Overrides:
getQueueTime in class AbstractResultsSummary
Returns:

getQueueDuration

public long getQueueDuration()
Description copied from interface: BuildResultsSummary
How long build was in the queue (in miliseconds)

Specified by:
getQueueDuration in interface BuildResultsSummary
Returns:

setQueueTime

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

getVcsUpdateTime

public java.util.Date getVcsUpdateTime()
Description copied from interface: BuildResultsSummary
When the source syncronisation was kicked off

Specified by:
getVcsUpdateTime in interface BuildResultsSummary
Returns:

getVcsUpdateDuration

public long getVcsUpdateDuration()
Description copied from interface: BuildResultsSummary
How long checkout take (in miliseconds)

Specified by:
getVcsUpdateDuration in interface BuildResultsSummary
Returns:

setVcsUpdateTime

public void setVcsUpdateTime(java.util.Date vcsUpdateTime)

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
Overrides:
getJiraIssues in class AbstractResultsSummary
Returns:

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
Overrides:
getJiraIssueKeys in class AbstractResultsSummary
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
Overrides:
getUniqueAuthors in class AbstractResultsSummary
Returns:
Set of Authors

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
Overrides:
getArtifactLinks in class AbstractResultsSummary
Returns:

getProducedArtifactLinks

@NotNull
public java.util.Collection<ArtifactLink> getProducedArtifactLinks()
Description copied from interface: BuildResultsSummary
Returns all artifacts produced by this build. Even if the files don't exist

Specified by:
getProducedArtifactLinks in interface BuildResultsSummary
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
Overrides:
getLabellings in class AbstractResultsSummary
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
Overrides:
getLabelNames in class AbstractResultsSummary
Returns:

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
Overrides:
getComments in class AbstractResultsSummary
Returns:

getCommits

@NotNull
public java.util.Set<Commit> getCommits()
Description copied from interface: ResultsSummary
Any Commits related to this BuildResultsSummary Note that if you fetched this result from Lucene that accessing this property will cause a database hit

Specified by:
getCommits in interface ResultsSummary
Overrides:
getCommits in class AbstractResultsSummary
Returns:
commits

getChainResultsSummary

public ChainResultsSummary getChainResultsSummary()
Not available from Lucene

Specified by:
getChainResultsSummary in interface BuildResultsSummary
Returns:
chainResultsSummary

setChainResultsSummary

public void setChainResultsSummary(@NotNull
                                   ChainResultsSummary chainResultSummary)
Specified by:
setChainResultsSummary in interface BuildResultsSummary

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

createStageResult

@NotNull
public ChainStageResult createStageResult(@NotNull
                                                  ChainStage 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

compareTo

public int compareTo(ResultsSummary obj)
Specified by:
compareTo in interface java.lang.Comparable<ResultsSummary>
Overrides:
compareTo in class AbstractResultsSummary

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class AbstractResultsSummary

getFilteredTestResults

@NotNull
public FilteredTestResults getFilteredTestResults()
Description copied from interface: BuildResultsSummary
Return a filtered view of all the tests that ran in this build. Provides some degree of caching but is still relatively intensive.

Specified by:
getFilteredTestResults in interface BuildResultsSummary
Returns:
a filtered view of all the tests ran in this build. Null if the builds hasn't finished yet.

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
Overrides:
resetTestClassResults in class AbstractResultsSummary
Parameters:
testClassResults - to set

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:

getTestResults

public FilteredTestResults 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

getExtraBuildResultsData

@Nullable
public ExtraBuildResultsData getExtraBuildResultsData()
Description copied from interface: BuildResultsSummary
Allow access to ExtraBuildResultsData

Specified by:
getExtraBuildResultsData in interface BuildResultsSummary
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractResultsSummary


Copyright © 2011 Atlassian. All Rights Reserved.