com.atlassian.bamboo.resultsummary
Class BuildResultsSummaryManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.resultsummary.BuildResultsSummaryManagerImpl
All Implemented Interfaces:
BuildResultsSummaryManager, ResultsSummaryManager

public class BuildResultsSummaryManagerImpl
extends java.lang.Object
implements BuildResultsSummaryManager


Constructor Summary
BuildResultsSummaryManagerImpl()
           
 
Method Summary
 void calculateAndSetDeltaState(ResultsSummary resultsSummary)
          Figures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix.
 int countBuildResultsSummaries()
          Returns the number of results saved
 int countBuildResultsSummaries(java.lang.String planKey)
          Returns the number of results saved for the given Build
 int countBuildResultsSummariesForAgent(BuildAgent buildAgent)
           
 int countFailedBuildResultsSummariesForAgent(BuildAgent buildAgent)
           
 int countResultsWithState(PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, BuildState buildState)
          Counts results with a given state in a given build number range for plan.
<T extends ResultsSummary>
T
createResultsSummary(BuildContext buildContext, java.lang.Class<T> aClass)
          Creates a ResultsSummary of the given Class
 java.util.List<BuildResultsSummary> findBuildResultsSummaries(BuildResultsSummaryCriteria criteria)
          Searches for BuildResultsSummary objects given a BuildResultsSummaryCriteria
 java.util.List<BuildResultsSummary> findBuildResultsSummariesForBuild(Build build, BuildResultsSummaryCriteria criteria)
           
 java.util.List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, java.util.List<Label> labels)
          Searches through all chains to find any that have jobs which match the given labels.
 ResultsSummary findFirstFailedBuildResultAfter(java.lang.String buildKey, int buildNumber)
          Finds the first failed ResultsSummary after buildNumber
 ResultsSummary findFirstFailedBuildResultBetween(Plan build, int lowerBuildNumber, int upperBuildNumber)
          Finds the first failed build between the upper and lower build numbers inclusively.
<T extends ResultsSummary>
T
findFirstResultAfter(PlanResultKey planResultKey, java.lang.Class<T> aClass)
          Finds the first ResultsSummary after a specified build which is either FINISHED or can be FINISHED, i.e.
 ResultsSummary findFirstSuccessfulBuildResultAfter(java.lang.String buildKey, int buildNumber)
          Finds the last successful BuildResultsSummary after buildNumber
 java.util.List<LinkedJiraIssue> findJiraIssuesForPlan(Plan plan)
          Retrieves a list of LinkedJiraIssue linked to the given Plan
 java.util.List<LinkedJiraIssue> findJiraIssuesForResults(java.util.List<ResultsSummary> buildResults)
          Retrieves a list of LinkedJiraIssue linked to the given build result summaries
 ResultsSummary findLastBuildResultBefore(java.lang.String buildKey, int buildNumber)
          Finds the last successful or failing BuildResultsSummary before buildNumber
<T extends ResultsSummary>
T
findLastBuildResultBeforeWithTests(PlanResultKey planResultKey, java.lang.Class<T> aClass)
          Finds the last successful or failing BuildResultsSummary before buildNumber
 ResultsSummary findLastFailingBuildResultBefore(Plan build, int buildNumber)
          Finds the last failing BuildResultsSummary before buildNumber
<T extends ResultsSummary>
T
findLastResultBefore(PlanResultKey planResultKey, java.lang.Class<T> aClass)
          Finds the last successful or failing ResultsSummary before planResultKey.getBuildNumber
<T extends ResultsSummary>
T
findLastResultSummaryWithState(PlanKey planKey, BuildState buildState, java.lang.Class<T> aClass)
           
 ResultsSummary findLastSuccessfulBuildResultBefore(Plan build, int buildNumber)
          Finds the last successful BuildResultsSummary before buildNumber
 java.util.List<? extends ResultsSummary> findResultsSummariesByJiraIssues(java.util.List<java.lang.String> issueKeys)
          Finds a list of results which are linked to the given issue keys
 java.util.List<? extends ResultsSummary> findResultsSummariesByProjectKey(java.lang.String projectKey)
          Provide a list of results which are linked to any issues under the given jira project key
<T extends ResultsSummary>
java.util.Collection<T>
getAllActiveResultSummariesForPlan(PlanKey planKey, java.lang.Class<T> aClass)
          Returns all the ResultsSummary in a LifeCycleState.IN_PROGRESS state
 java.util.List<BuildResultsSummary> getAllBuildResultsSummaries(Plan plan)
          Returns all BuildResultsSummary for the passed Plan.
 java.util.List<BuildResultsSummary> getAllBuildResultsSummariesForAgent(java.lang.Long agentId)
          Returns all BuildResultsSummary for the passed BuildAgent's id.
<T extends ResultsSummary>
java.util.Collection<T>
getAllBuildResultSummariesInUnknownState(java.lang.Class<T> aClass)
          Returns all the BuildResultsSummary in a BuildState.UNKNOWN state
 java.util.List<BuildResultsSummary> getAllFailedResultsSummaries(Build build)
          Returns all Failed BuildResultsSummary for the passed Build.
<T extends ResultsSummary>
java.util.Collection<T>
getAllInProgressResultSummaries(java.lang.Class<T> aClass)
          Returns all the ResultsSummary in a LifeCycleState.IN_PROGRESS state
<T extends ResultsSummary>
java.util.Collection<T>
getAllPendingResultSummaries(java.lang.Class<T> aClass)
          Returns all the ResultsSummary in a LifeCycleState.PENDING state
<T extends ResultsSummary>
java.util.Collection<T>
getAllQueuedResultSummaries(java.lang.Class<T> aClass)
          Returns all the ResultsSummary in a LifeCycleState.QUEUED state
<T extends ResultsSummary>
java.util.List<T>
getAllResultSummariesForPlan(Plan plan)
          Get all the ResultsSummarys for the given Plan.
 long getAverageBuildTime(Buildable plan, int numberOfResults)
          Returns average build duration for given number of builds
 long getAveragePlanExecutionDuration(Plan plan, int numberOfResults)
          Get average duration from n last results summaries in finished state for a plan.
 ResultsSummary getBreakingBuild(ResultsSummary buildResultsSummary)
          Returns the first failing build after the last successful build.
 BuildResultsSummary getBuildResultsSummary(Build build, int buildNumber)
           
 BuildResultsSummary getBuildResultsSummary(PlanResultKey planResultKey)
          Gets the BuildResultsSummary represented by the provided PlanResultKey
 BuildResultsSummary getBuildResultsSummary(java.lang.String buildKey, int buildNumber)
          Gets the BuildResultsSummary represented by the provided buildKey and buildNumber
 BuildResultsSummary getBuildResultsSummaryById(long id)
           
 ChainStageResult getChainStageResultById(java.lang.Long id)
          Returns a ChainStageResult by its id
 java.util.List<Commit> getCommitsForResult(ResultsSummary resultsSummary)
           
<T extends ResultsSummary>
java.util.List<T>
getFinalizedResultSummariesForPlan(PlanKey planKey, java.lang.Class<T> aClass, int firstResult, int maxResults)
          Returns all the ResultsSummary in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state with the given Class.
 BuildResultsSummary getFirstBuildSummary(Plan plan)
          Retreives the first result
 ResultsSummary getFixingBuild(ResultsSummary buildResultsSummary)
          Returns the first successful ResultsSummary for given ResultsSummary.
 BuildResultsSummary getLastBuildForAgent(java.lang.String planKey, java.lang.Long agentId)
           
 BuildResultsSummary getLastBuildForImageConfiguration(java.lang.String planKey, ElasticImageConfiguration configuration)
           
 BuildResultsSummary getLastBuildSummary(Plan plan)
          Retrieves the last completed build result for a plan
 BuildResultsSummary getLastBuildSummary(java.lang.String planKey)
          Retrieves the last completed build result for a plan identified by a planKey
 java.util.List<BuildResultsSummary> getLastNBuildResultsSummaries(Buildable buildable, int numberOfResults)
          Deprecated. 
 java.util.List<ResultsSummary> getLastNFailedResultsSummaries(Plan plan, int numberOfResults)
          Returns the most recent n failed build results.
 java.util.List<ResultsSummary> getLastNResultsSummaries(Plan plan, int numberOfResults)
          Provides a list of the latest N results summaries for the given plan, newest first.
 BuildResultsSummary getLastOrNBuildResultsSummary(Build build, java.lang.String buildNumber)
          Deprecated. 
<T extends ResultsSummary>
T
getLastResultsSummary(java.lang.String planKey, java.lang.Class<T> aClass)
          Get the last ResultsSummary for planKey and Class
 BuildResultsSummary getLastSuccessfulBuildForAgent(java.lang.String planKey, java.lang.Long agentId)
           
 BuildResultsSummary getLastSuccessfulBuildForImageConfiguration(java.lang.String planKey, ElasticImageConfiguration configuration)
           
 BuildResultsSummary getLastSuccessfulBuildSummary(java.lang.String planKey)
           
 ResultsSummary getLastSuccessfulResultSummary(PlanKey planKey)
          Get the last successful ResultsSummary for planKey
 java.util.List<BuildResultsSummary> getLatestbuildResultSummaries()
          Deprecated. 
 java.util.List<BuildResultsSummary> getLatestFailedBuildResultSummaries()
          Deprecated. 
 java.util.List<ResultsSummary> getLatestFailedResultSummaries()
          Retrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see
 java.util.List<ResultsSummary> getLatestResultSummaries()
          Retrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see
 java.util.List<BuildResultsSummary> getLatestSummariesForAgent(java.lang.Long agentId, java.util.Date fromDate)
          Retrieves build summaries for agent id not older than certain date.
 java.util.List<BuildResultsSummary> getLatestSummariesForAgent(java.lang.Long agentId, int maxCount)
          Retrieves n last build summaries for agent.
 BuildResultsSummary getLatestSummaryForAgent(long agentId)
           
 java.util.List<ResultsSummary> getNeighbouringSummaries(Plan plan, int buildNumber)
          Returns all the ResultsSummary objects that matches the passed build numbers
 int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
          Gets the number of concurrently running builds
 long getNumberOfFinalizedResults(Plan plan)
          Get number of the ResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan
 long getNumberOfFinishedResults(Plan plan)
          Get number of the ResultsSummarys in LifeCycleState.FINISHED state for the given Plan
 ChainResultsSummary getParentResultSummary(ResultsSummary resultsSummary)
          Get (@link ChainResultsSummary} containing given ResultsSummary
 ResultsSummary getResultsSummary(PlanResultKey planResultKey)
          Lookup the ResultsSummary by PlanResultKey
<T extends ResultsSummary>
T
getResultsSummary(PlanResultKey planResultKey, java.lang.Class<T> aClass)
          Lookup ResultsSummary by PlanResultKey and expected type
<T extends ResultsSummary>
T
getResultsSummary(PlanResultKey planResultKey, java.lang.Class<T> aClass, ResultDataRead dataRead)
          Lookup ResultsSummary by PlanResultKey and expected type.
 ResultsSummary getResultsSummary(PlanResultKey planResultKey, ResultDataRead dataRead)
          Lookup the ResultsSummary by PlanResultKey.
<T extends ResultsSummary>
java.util.List<T>
getResultSummaries(ResultsSummaryCriteria resultsSummaryCriteria)
          Generic search to find any result summaries bases on the criteria provided.
<T extends ResultsSummary>
java.util.List<T>
getResultSummariesForPlan(Plan plan, int firstResult, int maxResults)
          Get the ResultsSummarys for the given Plan in any LifeCycleState.
<T extends ResultsSummary>
java.util.List<T>
getResultSummariesForPlanByLifeCycleState(Plan plan, LifeCycleState lifeCycleState, int firstResult, int maxResults)
          Get the ResultsSummarys for the given Plan in give LifeCycleState that are Results are sorted by build number (descending).
 ChainStageResult getStageForResult(ResultsSummary resultsSummary)
          Get (@link ChainStageResult} containing given ResultsSummary
 void logSubstitutedVariables(BuildContext buildContext, ResultsSummary resultsSummary)
          Adds variable substitution result to ResultsSummary This method logs substitution after it was performed and will use only REALLY substituted values
 void logVariablesForSubstitution(BuildContext buildContext, ResultsSummary resultsSummary)
          Adds expected variable substitution to ResultsSummary This method logs substitution before build was performed and is used basically to log substitution against plan result as there will be no possibility to track it afterwards
 void moveResultSummaries(PlanKey oldPlanKey, PlanKey newPlanKey)
          Reassigns plan key ResultsSummaries associated with selected plan key.
 void moveResultSummaries(Plan newParentPlan, PlanKey oldPlanKey, PlanKey newPlanKey)
          Reassigns plan key ResultsSummaries associated with selected plan key.
 int removeAllOrphanedResultSummaries()
          Removes all the ResultsSummary objects in the database that do not have a matching Plan
 void removeArtifacts(Plan plan, int buildNumber)
          Remove any artifacts stored for this plan result
 void removeBuildLogs(Plan plan, int buildNumber)
          Remove any build logs stored for this plan result
 void removeBuildResult(Buildable buildable, int buildNumber)
          Removes a build result for a particular build.
 void removeBuildResultsSummariesForBuild(Build build)
          Deprecated. 
 void removeMatchingArtifacts(ResultsSummary resultsSummary, com.google.common.base.Predicate<ArtifactLink> predicate)
          Remove artifacts from results summary that match a predicate.
 int removeResultsSummariesForPlan(Plan plan)
          Remove all resultSummary objects for the given plan.
 void removeResultSummary(Plan plan, int buildNumber)
          Remove plan result summary and all associated objects.
 void saveBuildResultsSummary(BuildResultsSummary buildResultsSummary)
          Saves the specified BuildResultsSummary
 void saveResultSummary(ResultsSummary resultsSummary)
          Saves the ResultsSummary
 long scrollResultSummaries(java.lang.String buildKey, com.google.common.base.Function<ResultsSummary,java.lang.Void> function)
          Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized.
 long scrollResultSummaries(java.lang.String buildKey, ResultDataRead resultDataRead, com.google.common.base.Function<ResultsSummary,java.lang.Void> function)
          Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized.
 void setArtifactLinkManager(ArtifactLinkManager artifactLinkManager)
           
 void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
           
 void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)
           
 void setBuildResultsSummaryDao(BuildResultsSummaryDao buildResultsSummaryDao)
           
 void setCommitDao(CommitDao commitDao)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)
           
 void setJiraIssueUtils(JiraIssueUtils jiraIssueUtils)
           
 BuildResultsSummary updateBuildState(BuildResultsSummary buildResultsSummary, BuildState buildState)
          Update the BuildState of the BuildResultsSummary
 BuildResultsSummary updateBuildSummaryFromBuildResults(BuildContext buildContext, CurrentlyBuilding currentlyBuilding, BuildResults buildResults)
          Updates BuildResultsSummary after build is completed.
 void updateCancelledDetails(ResultsSummary resultsSummary)
          Marks ResultSummary as cancelled
 void updateLifeCycleState(BuildContext buildContext, LifeCycleState lifeCycleState, BuildState buildState)
          Update LifeCycleState and saves the ResultsSummary for given BuildContext Updates also timing information
 void updateLifeCycleState(ResultsSummary resultsSummary, LifeCycleState lifeCycleState, BuildState buildState)
          Update LifeCycleState and saves the given ResultsSummary
 void updatePlanCompletedDate(ChainResultsSummary resultSummary, java.util.Date completionDate)
          Update completed date and duration of ChainResultsSummary
 void updateProcessingDuration(ChainResultsSummary resultSummary)
          Updates ResultsSummary.getProcessingDuration() and ChainStageResult.getProcessingDuration() based on chain execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildResultsSummaryManagerImpl

public BuildResultsSummaryManagerImpl()
Method Detail

getAllResultSummariesForPlan

@NotNull
public <T extends ResultsSummary> java.util.List<T> getAllResultSummariesForPlan(@NotNull
                                                                                         Plan plan)
Description copied from interface: ResultsSummaryManager
Get all the ResultsSummarys for the given Plan. This can be thousands of objects or just a few. Avoid using this method at all costs.

Specified by:
getAllResultSummariesForPlan in interface ResultsSummaryManager
Returns:
summaries

getResultSummariesForPlanByLifeCycleState

@NotNull
public <T extends ResultsSummary> java.util.List<T> getResultSummariesForPlanByLifeCycleState(@NotNull
                                                                                                      Plan plan,
                                                                                                      @NotNull
                                                                                                      LifeCycleState lifeCycleState,
                                                                                                      int firstResult,
                                                                                                      int maxResults)
Description copied from interface: ResultsSummaryManager
Get the ResultsSummarys for the given Plan in give LifeCycleState that are Results are sorted by build number (descending). User can skip first n result and request maximum number of results.

Specified by:
getResultSummariesForPlanByLifeCycleState in interface ResultsSummaryManager
firstResult - specifies the first item to be return (0 base index). Negative values treated as 0.
maxResults - specifies amount of the results to be returned. Value <= 0 returns everything.
Returns:
summaries

getResultSummariesForPlan

@NotNull
public <T extends ResultsSummary> java.util.List<T> getResultSummariesForPlan(@NotNull
                                                                                      Plan plan,
                                                                                      int firstResult,
                                                                                      int maxResults)
Description copied from interface: ResultsSummaryManager
Get the ResultsSummarys for the given Plan in any LifeCycleState. Results are sorted by build number (descending). User can skip first n result and request maximum number of results.

Specified by:
getResultSummariesForPlan in interface ResultsSummaryManager
firstResult - specifies the first item to be return (0 base index). Negative values treated as 0.
maxResults - specifies amount of the results to be returned. Value <= 0 returns everything.
Returns:
summaries

getChainStageResultById

@Nullable
public ChainStageResult getChainStageResultById(@NotNull
                                                         java.lang.Long id)
Description copied from interface: ResultsSummaryManager
Returns a ChainStageResult by its id

Specified by:
getChainStageResultById in interface ResultsSummaryManager
Returns:
chainStageResult

getResultsSummary

@Nullable
public ResultsSummary getResultsSummary(@NotNull
                                                 PlanResultKey planResultKey)
Description copied from interface: ResultsSummaryManager
Lookup the ResultsSummary by PlanResultKey

Specified by:
getResultsSummary in interface ResultsSummaryManager
Returns:
resultsSummary

getResultsSummary

@Nullable
public ResultsSummary getResultsSummary(@NotNull
                                                 PlanResultKey planResultKey,
                                                 ResultDataRead dataRead)
Description copied from interface: ResultsSummaryManager
Lookup the ResultsSummary by PlanResultKey. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call

Specified by:
getResultsSummary in interface ResultsSummaryManager
Returns:
resultsSummary

getResultsSummary

@Nullable
public <T extends ResultsSummary> T getResultsSummary(@NotNull
                                                               PlanResultKey planResultKey,
                                                               @NotNull
                                                               java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Lookup ResultsSummary by PlanResultKey and expected type

Specified by:
getResultsSummary in interface ResultsSummaryManager
Returns:
resultSummary

getResultsSummary

@Nullable
public <T extends ResultsSummary> T getResultsSummary(@NotNull
                                                               PlanResultKey planResultKey,
                                                               @NotNull
                                                               java.lang.Class<T> aClass,
                                                               ResultDataRead dataRead)
Description copied from interface: ResultsSummaryManager
Lookup ResultsSummary by PlanResultKey and expected type. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call

Specified by:
getResultsSummary in interface ResultsSummaryManager
Returns:
resultSummary

getAllPendingResultSummaries

@NotNull
public <T extends ResultsSummary> java.util.Collection<T> getAllPendingResultSummaries(java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Returns all the ResultsSummary in a LifeCycleState.PENDING state

Specified by:
getAllPendingResultSummaries in interface ResultsSummaryManager
Returns:
pendingSummaries

getAllQueuedResultSummaries

@NotNull
public <T extends ResultsSummary> java.util.Collection<T> getAllQueuedResultSummaries(java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Returns all the ResultsSummary in a LifeCycleState.QUEUED state

Specified by:
getAllQueuedResultSummaries in interface ResultsSummaryManager
Returns:
summaries

getAllInProgressResultSummaries

@NotNull
public <T extends ResultsSummary> java.util.Collection<T> getAllInProgressResultSummaries(java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Returns all the ResultsSummary in a LifeCycleState.IN_PROGRESS state

Specified by:
getAllInProgressResultSummaries in interface ResultsSummaryManager
Returns:
summaries

getAllActiveResultSummariesForPlan

@NotNull
public <T extends ResultsSummary> java.util.Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey,
                                                                                                     java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Returns all the ResultsSummary in a LifeCycleState.IN_PROGRESS state

Specified by:
getAllActiveResultSummariesForPlan in interface ResultsSummaryManager
Returns:
summaries

getFinalizedResultSummariesForPlan

@NotNull
public <T extends ResultsSummary> java.util.List<T> getFinalizedResultSummariesForPlan(PlanKey planKey,
                                                                                               java.lang.Class<T> aClass,
                                                                                               int firstResult,
                                                                                               int maxResults)
Description copied from interface: ResultsSummaryManager
Returns all the ResultsSummary in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state with the given Class. Results are sorted descending by build number.

Specified by:
getFinalizedResultSummariesForPlan in interface ResultsSummaryManager
firstResult - - specifies the first result to be included in the list.
maxResults - - specifies the length of the result; 0 for all results;
Returns:

getNumberOfConcurrentlyRunningBuilds

public int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Description copied from interface: ResultsSummaryManager
Gets the number of concurrently running builds

Specified by:
getNumberOfConcurrentlyRunningBuilds in interface ResultsSummaryManager
Returns:

getAllBuildResultSummariesInUnknownState

@NotNull
public <T extends ResultsSummary> java.util.Collection<T> getAllBuildResultSummariesInUnknownState(java.lang.Class<T> aClass)
Description copied from interface: ResultsSummaryManager
Returns all the BuildResultsSummary in a BuildState.UNKNOWN state

Specified by:
getAllBuildResultSummariesInUnknownState in interface ResultsSummaryManager
Returns:
summaries

createResultsSummary

public <T extends ResultsSummary> T createResultsSummary(@NotNull
                                                         BuildContext buildContext,
                                                         @NotNull
                                                         java.lang.Class<T> aClass)
                                              throws ResultsSummaryCreationException
Description copied from interface: ResultsSummaryManager
Creates a ResultsSummary of the given Class

Specified by:
createResultsSummary in interface ResultsSummaryManager
Returns:
resultsSummary
Throws:
ResultsSummaryCreationException

updateBuildSummaryFromBuildResults

@NotNull
public BuildResultsSummary updateBuildSummaryFromBuildResults(BuildContext buildContext,
                                                                      CurrentlyBuilding currentlyBuilding,
                                                                      BuildResults buildResults)
Description copied from interface: BuildResultsSummaryManager
Updates BuildResultsSummary after build is completed. All fiedls are initialized at this moment.

Specified by:
updateBuildSummaryFromBuildResults in interface BuildResultsSummaryManager
Returns:
updated build result summary

calculateAndSetDeltaState

public void calculateAndSetDeltaState(ResultsSummary resultsSummary)
Description copied from interface: ResultsSummaryManager
Figures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix. This method only updates the values on the provided results summary object, it does not save it to the database. Assumes buildState has already been set on resultsSummary.

Specified by:
calculateAndSetDeltaState in interface ResultsSummaryManager
Parameters:
resultsSummary - to update

updateBuildState

@NotNull
public BuildResultsSummary updateBuildState(@NotNull
                                                    BuildResultsSummary buildResultsSummary,
                                                    @NotNull
                                                    BuildState buildState)
Description copied from interface: BuildResultsSummaryManager
Update the BuildState of the BuildResultsSummary

Specified by:
updateBuildState in interface BuildResultsSummaryManager
Returns:
updated

updateLifeCycleState

public void updateLifeCycleState(@NotNull
                                 ResultsSummary resultsSummary,
                                 @NotNull
                                 LifeCycleState lifeCycleState,
                                 @NotNull
                                 BuildState buildState)
Description copied from interface: ResultsSummaryManager
Update LifeCycleState and saves the given ResultsSummary

Specified by:
updateLifeCycleState in interface ResultsSummaryManager
Parameters:
resultsSummary - ResultsSummary to be updated and saved
lifeCycleState - LifeCycleState to be set
buildState - BuildState to be set

updateLifeCycleState

public void updateLifeCycleState(@NotNull
                                 BuildContext buildContext,
                                 @NotNull
                                 LifeCycleState lifeCycleState,
                                 @NotNull
                                 BuildState buildState)
Description copied from interface: ResultsSummaryManager
Update LifeCycleState and saves the ResultsSummary for given BuildContext Updates also timing information

Specified by:
updateLifeCycleState in interface ResultsSummaryManager
Parameters:
buildContext - BuildContext used to get information on ResultsSummary
lifeCycleState - LifeCycleState to be set
buildState - BuildState to be set

updatePlanCompletedDate

public void updatePlanCompletedDate(@NotNull
                                    ChainResultsSummary resultSummary,
                                    @NotNull
                                    java.util.Date completionDate)
Description copied from interface: ResultsSummaryManager
Update completed date and duration of ChainResultsSummary

Specified by:
updatePlanCompletedDate in interface ResultsSummaryManager

updateProcessingDuration

public void updateProcessingDuration(ChainResultsSummary resultSummary)
Description copied from interface: ResultsSummaryManager
Updates ResultsSummary.getProcessingDuration() and ChainStageResult.getProcessingDuration() based on chain execution.

Specified by:
updateProcessingDuration in interface ResultsSummaryManager

getBreakingBuild

@Nullable
public ResultsSummary getBreakingBuild(ResultsSummary buildResultsSummary)
Description copied from interface: ResultsSummaryManager
Returns the first failing build after the last successful build. ie the latest build before this one with the delta state "broken"

Specified by:
getBreakingBuild in interface ResultsSummaryManager
Parameters:
buildResultsSummary - of the current build
Returns:
null if there is no breaking build.

getFixingBuild

@Nullable
public ResultsSummary getFixingBuild(ResultsSummary buildResultsSummary)
Description copied from interface: ResultsSummaryManager
Returns the first successful ResultsSummary for given ResultsSummary. The input build is returned if it is successful.

Specified by:
getFixingBuild in interface ResultsSummaryManager
Returns:
null if there is no fixing build.

getAllBuildResultsSummaries

@NotNull
public java.util.List<BuildResultsSummary> getAllBuildResultsSummaries(@NotNull
                                                                               Plan plan)
Description copied from interface: BuildResultsSummaryManager
Returns all BuildResultsSummary for the passed Plan. Sorted by oldest first.

Specified by:
getAllBuildResultsSummaries in interface BuildResultsSummaryManager
Returns:

getAllFailedResultsSummaries

@NotNull
public java.util.List<BuildResultsSummary> getAllFailedResultsSummaries(@NotNull
                                                                                Build build)
Description copied from interface: BuildResultsSummaryManager
Returns all Failed BuildResultsSummary for the passed Build. Sorted by oldest first.

Specified by:
getAllFailedResultsSummaries in interface BuildResultsSummaryManager
Returns:

getLastNBuildResultsSummaries

@Deprecated
@NotNull
public java.util.List<BuildResultsSummary> getLastNBuildResultsSummaries(@NotNull
                                                                                            Buildable buildable,
                                                                                            int numberOfResults)
Deprecated. 

Description copied from interface: ResultsSummaryManager
Returns the most recent n build results. Sorted by newest first.

Specified by:
getLastNBuildResultsSummaries in interface ResultsSummaryManager
numberOfResults - must be > 0 @return
Returns:
the most recent n build results. Sorted by newest first.

getResultSummaries

@NotNull
public <T extends ResultsSummary> java.util.List<T> getResultSummaries(@NotNull
                                                                               ResultsSummaryCriteria resultsSummaryCriteria)
Description copied from interface: ResultsSummaryManager
Generic search to find any result summaries bases on the criteria provided.

Specified by:
getResultSummaries in interface ResultsSummaryManager
Parameters:
resultsSummaryCriteria - containing all the search constraints
Returns:
list of resultsSummaries matching the criteria.

getLastNResultsSummaries

@NotNull
public java.util.List<ResultsSummary> getLastNResultsSummaries(@NotNull
                                                                       Plan plan,
                                                                       int numberOfResults)
Description copied from interface: ResultsSummaryManager
Provides a list of the latest N results summaries for the given plan, newest first.

Specified by:
getLastNResultsSummaries in interface ResultsSummaryManager
Parameters:
plan - - to get the results for
numberOfResults - - number of summaries you would like
Returns:
list.

getLastOrNBuildResultsSummary

@Deprecated
@Nullable
public BuildResultsSummary getLastOrNBuildResultsSummary(@NotNull
                                                                             Build build,
                                                                             @Nullable
                                                                             java.lang.String buildNumber)
Deprecated. 

Specified by:
getLastOrNBuildResultsSummary in interface BuildResultsSummaryManager

getLastNFailedResultsSummaries

@NotNull
public java.util.List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull
                                                                             Plan plan,
                                                                             int numberOfResults)
Description copied from interface: ResultsSummaryManager
Returns the most recent n failed build results. Sorted by newest first.

Specified by:
getLastNFailedResultsSummaries in interface ResultsSummaryManager
numberOfResults - must be > 0
Returns:

findBuildResultsSummaries

@NotNull
public java.util.List<BuildResultsSummary> findBuildResultsSummaries(@NotNull
                                                                             BuildResultsSummaryCriteria criteria)
Description copied from interface: BuildResultsSummaryManager
Searches for BuildResultsSummary objects given a BuildResultsSummaryCriteria

Specified by:
findBuildResultsSummaries in interface BuildResultsSummaryManager
Parameters:
criteria - @NotNull
Returns:
List of BuildResultsSummary

findBuildResultsSummariesForBuild

public java.util.List<BuildResultsSummary> findBuildResultsSummariesForBuild(@NotNull
                                                                             Build build,
                                                                             @NotNull
                                                                             BuildResultsSummaryCriteria criteria)
Specified by:
findBuildResultsSummariesForBuild in interface BuildResultsSummaryManager

countBuildResultsSummaries

public int countBuildResultsSummaries()
Description copied from interface: BuildResultsSummaryManager
Returns the number of results saved

Specified by:
countBuildResultsSummaries in interface BuildResultsSummaryManager
Returns:
results

countBuildResultsSummaries

public int countBuildResultsSummaries(@Nullable
                                      java.lang.String planKey)
Description copied from interface: BuildResultsSummaryManager
Returns the number of results saved for the given Build

Specified by:
countBuildResultsSummaries in interface BuildResultsSummaryManager
Returns:
results

findResultsSummariesByJiraIssues

@NotNull
public java.util.List<? extends ResultsSummary> findResultsSummariesByJiraIssues(@Nullable
                                                                                         java.util.List<java.lang.String> issueKeys)
Description copied from interface: ResultsSummaryManager
Finds a list of results which are linked to the given issue keys

Specified by:
findResultsSummariesByJiraIssues in interface ResultsSummaryManager
Parameters:
issueKeys - to search for
Returns:
al list of ResultsSummary associated with any of the given list of issue keys

findResultsSummariesByProjectKey

@NotNull
public java.util.List<? extends ResultsSummary> findResultsSummariesByProjectKey(@Nullable
                                                                                         java.lang.String projectKey)
Description copied from interface: ResultsSummaryManager
Provide a list of results which are linked to any issues under the given jira project key

Specified by:
findResultsSummariesByProjectKey in interface ResultsSummaryManager
Parameters:
projectKey - - jira project key
Returns:
a list of results which are linked to any issues under the given jira project key

findJiraIssuesForResults

@NotNull
public java.util.List<LinkedJiraIssue> findJiraIssuesForResults(@NotNull
                                                                        java.util.List<ResultsSummary> buildResults)
Description copied from interface: ResultsSummaryManager
Retrieves a list of LinkedJiraIssue linked to the given build result summaries

Specified by:
findJiraIssuesForResults in interface ResultsSummaryManager
Parameters:
buildResults - to look for issues attached to
Returns:
a list of LinkedJiraIssue linked to the given build result summaries

findJiraIssuesForPlan

@NotNull
public java.util.List<LinkedJiraIssue> findJiraIssuesForPlan(@NotNull
                                                                     Plan plan)
Description copied from interface: ResultsSummaryManager
Retrieves a list of LinkedJiraIssue linked to the given Plan

Specified by:
findJiraIssuesForPlan in interface ResultsSummaryManager
Parameters:
plan - to look for issues associated with
Returns:
a list of LinkedJiraIssue linked to the given Plan

removeResultSummary

public void removeResultSummary(@NotNull
                                Plan plan,
                                int buildNumber)
Description copied from interface: ResultsSummaryManager
Remove plan result summary and all associated objects.

Specified by:
removeResultSummary in interface ResultsSummaryManager

removeBuildResult

public void removeBuildResult(Buildable buildable,
                              int buildNumber)
Description copied from interface: BuildResultsSummaryManager
Removes a build result for a particular build. This fully removes everything about this particular build result and triggers off all appropriate events.

Specified by:
removeBuildResult in interface BuildResultsSummaryManager
buildNumber - The build numner.

removeBuildLogs

public void removeBuildLogs(Plan plan,
                            int buildNumber)
Description copied from interface: ResultsSummaryManager
Remove any build logs stored for this plan result

Specified by:
removeBuildLogs in interface ResultsSummaryManager

removeMatchingArtifacts

public void removeMatchingArtifacts(@NotNull
                                    ResultsSummary resultsSummary,
                                    @NotNull
                                    com.google.common.base.Predicate<ArtifactLink> predicate)
Description copied from interface: ResultsSummaryManager
Remove artifacts from results summary that match a predicate.

Specified by:
removeMatchingArtifacts in interface ResultsSummaryManager

removeArtifacts

public void removeArtifacts(Plan plan,
                            int buildNumber)
Description copied from interface: ResultsSummaryManager
Remove any artifacts stored for this plan result

Specified by:
removeArtifacts in interface ResultsSummaryManager

findChainResultsWithJobLabelled

public java.util.List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria,
                                                                           java.util.List<Label> labels)
Description copied from interface: ResultsSummaryManager
Searches through all chains to find any that have jobs which match the given labels. The list of chains is then filtered if required, using other criteria elements. Currently the only used criteria are:
  • buildKey
  • toBuildDate
  • toBuildNumber
  • This is to ensure performance is consistant and reduce the possibility of conflicts.

    Specified by:
    findChainResultsWithJobLabelled in interface ResultsSummaryManager
    Parameters:
    criteria - containing the restrictions for the chains to be returned
    labels - that the jobs can be associated with
    Returns:
    list of ChainResultSummary that match the criteria and have jobs with any of the given labels

    getBuildResultsSummaryById

    @Nullable
    public BuildResultsSummary getBuildResultsSummaryById(long id)
    Specified by:
    getBuildResultsSummaryById in interface BuildResultsSummaryManager

    getBuildResultsSummary

    @Nullable
    public BuildResultsSummary getBuildResultsSummary(Build build,
                                                               int buildNumber)
    Specified by:
    getBuildResultsSummary in interface BuildResultsSummaryManager

    getNeighbouringSummaries

    @NotNull
    public java.util.List<ResultsSummary> getNeighbouringSummaries(Plan plan,
                                                                           int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Returns all the ResultsSummary objects that matches the passed build numbers

    Specified by:
    getNeighbouringSummaries in interface ResultsSummaryManager
    buildNumber - @return List of BuildResultsSummary

    removeBuildResultsSummariesForBuild

    @Deprecated
    public void removeBuildResultsSummariesForBuild(@NotNull
                                                               Build build)
    Deprecated. 

    Description copied from interface: BuildResultsSummaryManager
    Remove the BuildResultsSummary objects from the database. No events are triggered

    Specified by:
    removeBuildResultsSummariesForBuild in interface BuildResultsSummaryManager
    Parameters:
    build - @NotNull

    removeResultsSummariesForPlan

    public int removeResultsSummariesForPlan(@NotNull
                                             Plan plan)
    Description copied from interface: ResultsSummaryManager
    Remove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands of ResultsSummary objects to be deleted in such case #scheduleResultsSummariesForDelayedDeletion(Plan) should be considered.

    Specified by:
    removeResultsSummariesForPlan in interface ResultsSummaryManager
    Parameters:
    plan - to remove results for.
    Returns:
    number of ResultsSummarys removed

    removeAllOrphanedResultSummaries

    public int removeAllOrphanedResultSummaries()
    Description copied from interface: ResultsSummaryManager
    Removes all the ResultsSummary objects in the database that do not have a matching Plan

    Specified by:
    removeAllOrphanedResultSummaries in interface ResultsSummaryManager
    Returns:
    number of ResultsSummarys removed

    getBuildResultsSummary

    @Nullable
    public BuildResultsSummary getBuildResultsSummary(@NotNull
                                                               PlanResultKey planResultKey)
    Description copied from interface: BuildResultsSummaryManager
    Gets the BuildResultsSummary represented by the provided PlanResultKey

    Specified by:
    getBuildResultsSummary in interface BuildResultsSummaryManager
    Returns:
    buildResultsSummary

    getBuildResultsSummary

    @Nullable
    public BuildResultsSummary getBuildResultsSummary(java.lang.String buildKey,
                                                               int buildNumber)
    Description copied from interface: BuildResultsSummaryManager
    Gets the BuildResultsSummary represented by the provided buildKey and buildNumber

    Specified by:
    getBuildResultsSummary in interface BuildResultsSummaryManager
    Returns:
    buildResultsSummary

    saveBuildResultsSummary

    public void saveBuildResultsSummary(@NotNull
                                        BuildResultsSummary buildResultsSummary)
    Description copied from interface: BuildResultsSummaryManager
    Saves the specified BuildResultsSummary

    Specified by:
    saveBuildResultsSummary in interface BuildResultsSummaryManager

    saveResultSummary

    public void saveResultSummary(@NotNull
                                  ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Saves the ResultsSummary

    Specified by:
    saveResultSummary in interface ResultsSummaryManager

    getFirstBuildSummary

    @Nullable
    public BuildResultsSummary getFirstBuildSummary(Plan plan)
    Description copied from interface: BuildResultsSummaryManager
    Retreives the first result

    Specified by:
    getFirstBuildSummary in interface BuildResultsSummaryManager
    Returns:
    result

    getLastBuildSummary

    @Nullable
    public BuildResultsSummary getLastBuildSummary(@NotNull
                                                            Plan plan)
    Description copied from interface: BuildResultsSummaryManager
    Retrieves the last completed build result for a plan

    Specified by:
    getLastBuildSummary in interface BuildResultsSummaryManager
    Parameters:
    plan - plan of which build result will be searched
    Returns:
    result

    getLastBuildSummary

    @Nullable
    public BuildResultsSummary getLastBuildSummary(java.lang.String planKey)
    Description copied from interface: BuildResultsSummaryManager
    Retrieves the last completed build result for a plan identified by a planKey

    Specified by:
    getLastBuildSummary in interface BuildResultsSummaryManager
    Parameters:
    planKey - identifier of a plan
    Returns:
    result

    getLastSuccessfulBuildSummary

    public BuildResultsSummary getLastSuccessfulBuildSummary(@NotNull
                                                             java.lang.String planKey)
    Specified by:
    getLastSuccessfulBuildSummary in interface BuildResultsSummaryManager
    Returns:

    getLastSuccessfulResultSummary

    public ResultsSummary getLastSuccessfulResultSummary(@NotNull
                                                         PlanKey planKey)
    Description copied from interface: ResultsSummaryManager
    Get the last successful ResultsSummary for planKey

    Specified by:
    getLastSuccessfulResultSummary in interface ResultsSummaryManager
    Returns:

    getLastBuildForAgent

    @Nullable
    public BuildResultsSummary getLastBuildForAgent(@NotNull
                                                             java.lang.String planKey,
                                                             @NotNull
                                                             java.lang.Long agentId)
    Specified by:
    getLastBuildForAgent in interface BuildResultsSummaryManager

    getLastBuildForImageConfiguration

    @Nullable
    public BuildResultsSummary getLastBuildForImageConfiguration(@NotNull
                                                                          java.lang.String planKey,
                                                                          @NotNull
                                                                          ElasticImageConfiguration configuration)
    Specified by:
    getLastBuildForImageConfiguration in interface BuildResultsSummaryManager

    getLastSuccessfulBuildForAgent

    @Nullable
    public BuildResultsSummary getLastSuccessfulBuildForAgent(@NotNull
                                                                       java.lang.String planKey,
                                                                       @NotNull
                                                                       java.lang.Long agentId)
    Specified by:
    getLastSuccessfulBuildForAgent in interface BuildResultsSummaryManager

    getLastSuccessfulBuildForImageConfiguration

    @Nullable
    public BuildResultsSummary getLastSuccessfulBuildForImageConfiguration(@NotNull
                                                                                    java.lang.String planKey,
                                                                                    @NotNull
                                                                                    ElasticImageConfiguration configuration)
    Specified by:
    getLastSuccessfulBuildForImageConfiguration in interface BuildResultsSummaryManager

    countBuildResultsSummariesForAgent

    public int countBuildResultsSummariesForAgent(@NotNull
                                                  BuildAgent buildAgent)
    Specified by:
    countBuildResultsSummariesForAgent in interface BuildResultsSummaryManager

    countFailedBuildResultsSummariesForAgent

    public int countFailedBuildResultsSummariesForAgent(@NotNull
                                                        BuildAgent buildAgent)
    Specified by:
    countFailedBuildResultsSummariesForAgent in interface BuildResultsSummaryManager

    getCommitsForResult

    @NotNull
    public java.util.List<Commit> getCommitsForResult(@NotNull
                                                              ResultsSummary resultsSummary)
    Specified by:
    getCommitsForResult in interface BuildResultsSummaryManager

    findLastSuccessfulBuildResultBefore

    @Nullable
    public ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull
                                                                       Plan build,
                                                                       int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful BuildResultsSummary before buildNumber

    Specified by:
    findLastSuccessfulBuildResultBefore in interface ResultsSummaryManager
    Returns:
    buildResult

    findFirstResultAfter

    @Nullable
    public <T extends ResultsSummary> T findFirstResultAfter(@NotNull
                                                                      PlanResultKey planResultKey,
                                                                      java.lang.Class<T> aClass)
    Description copied from interface: ResultsSummaryManager
    Finds the first ResultsSummary after a specified build which is either FINISHED or can be FINISHED, i.e. is not in NOT_BUILT state.

    Specified by:
    findFirstResultAfter in interface ResultsSummaryManager
    Returns:

    findLastResultBefore

    @Nullable
    public <T extends ResultsSummary> T findLastResultBefore(@NotNull
                                                                      PlanResultKey planResultKey,
                                                                      java.lang.Class<T> aClass)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful or failing ResultsSummary before planResultKey.getBuildNumber

    Specified by:
    findLastResultBefore in interface ResultsSummaryManager
    Returns:

    findLastResultSummaryWithState

    public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull
                                                                       PlanKey planKey,
                                                                       @NotNull
                                                                       BuildState buildState,
                                                                       @NotNull
                                                                       java.lang.Class<T> aClass)
    Specified by:
    findLastResultSummaryWithState in interface ResultsSummaryManager
    Returns:
    the last ResultsSummary with the provided BuildState

    findLastBuildResultBefore

    @Nullable
    public ResultsSummary findLastBuildResultBefore(@NotNull
                                                             java.lang.String buildKey,
                                                             int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful or failing BuildResultsSummary before buildNumber

    Specified by:
    findLastBuildResultBefore in interface ResultsSummaryManager
    Returns:

    findLastBuildResultBeforeWithTests

    public <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull
                                                                           PlanResultKey planResultKey,
                                                                           @NotNull
                                                                           java.lang.Class<T> aClass)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful or failing BuildResultsSummary before buildNumber

    Specified by:
    findLastBuildResultBeforeWithTests in interface ResultsSummaryManager
    Returns:
    resultsSummary

    findFirstFailedBuildResultAfter

    @Nullable
    public ResultsSummary findFirstFailedBuildResultAfter(@NotNull
                                                                   java.lang.String buildKey,
                                                                   int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the first failed ResultsSummary after buildNumber

    Specified by:
    findFirstFailedBuildResultAfter in interface ResultsSummaryManager
    Returns:
    buildResult

    findFirstSuccessfulBuildResultAfter

    @Nullable
    public ResultsSummary findFirstSuccessfulBuildResultAfter(@NotNull
                                                                       java.lang.String buildKey,
                                                                       int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful BuildResultsSummary after buildNumber

    Specified by:
    findFirstSuccessfulBuildResultAfter in interface ResultsSummaryManager
    Returns:
    buildResult

    findLastFailingBuildResultBefore

    @Nullable
    public ResultsSummary findLastFailingBuildResultBefore(@NotNull
                                                                    Plan build,
                                                                    int buildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the last failing BuildResultsSummary before buildNumber

    Specified by:
    findLastFailingBuildResultBefore in interface ResultsSummaryManager
    Returns:
    buildResult

    findFirstFailedBuildResultBetween

    @Nullable
    public ResultsSummary findFirstFailedBuildResultBetween(@NotNull
                                                                     Plan build,
                                                                     int lowerBuildNumber,
                                                                     int upperBuildNumber)
    Description copied from interface: ResultsSummaryManager
    Finds the first failed build between the upper and lower build numbers inclusively.

    Specified by:
    findFirstFailedBuildResultBetween in interface ResultsSummaryManager
    Returns:
    buildResults

    getAllBuildResultsSummariesForAgent

    @NotNull
    public java.util.List<BuildResultsSummary> getAllBuildResultsSummariesForAgent(@NotNull
                                                                                           java.lang.Long agentId)
    Description copied from interface: ResultsSummaryManager
    Returns all BuildResultsSummary for the passed BuildAgent's id.

    Specified by:
    getAllBuildResultsSummariesForAgent in interface ResultsSummaryManager
    Parameters:
    agentId - id of the agent to get the result summaries for
    Returns:
    all BuildResultsSummary for the passed BuildAgent's id.

    getLatestSummariesForAgent

    @NotNull
    public java.util.List<BuildResultsSummary> getLatestSummariesForAgent(@NotNull
                                                                                  java.lang.Long agentId,
                                                                                  @NotNull
                                                                                  java.util.Date fromDate)
    Description copied from interface: ResultsSummaryManager
    Retrieves build summaries for agent id not older than certain date.

    Specified by:
    getLatestSummariesForAgent in interface ResultsSummaryManager
    Parameters:
    agentId - id of an agent
    fromDate - beginning of the search period
    Returns:
    List of BuildResultsSummary

    getLatestSummariesForAgent

    @NotNull
    public java.util.List<BuildResultsSummary> getLatestSummariesForAgent(@NotNull
                                                                                  java.lang.Long agentId,
                                                                                  int maxCount)
    Description copied from interface: ResultsSummaryManager
    Retrieves n last build summaries for agent.

    Specified by:
    getLatestSummariesForAgent in interface ResultsSummaryManager
    Parameters:
    agentId - id of an agent
    maxCount - maximum number of elements to retrieve
    Returns:
    List of BuildResultsSummary

    getLatestSummaryForAgent

    @Nullable
    public BuildResultsSummary getLatestSummaryForAgent(long agentId)
    Specified by:
    getLatestSummaryForAgent in interface ResultsSummaryManager

    getParentResultSummary

    @Nullable
    public ChainResultsSummary getParentResultSummary(ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Get (@link ChainResultsSummary} containing given ResultsSummary

    Specified by:
    getParentResultSummary in interface ResultsSummaryManager
    Returns:

    getStageForResult

    @Nullable
    public ChainStageResult getStageForResult(ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Get (@link ChainStageResult} containing given ResultsSummary

    Specified by:
    getStageForResult in interface ResultsSummaryManager
    Returns:

    getNumberOfFinishedResults

    public long getNumberOfFinishedResults(Plan plan)
    Description copied from interface: ResultsSummaryManager
    Get number of the ResultsSummarys in LifeCycleState.FINISHED state for the given Plan

    Specified by:
    getNumberOfFinishedResults in interface BuildResultsSummaryManager
    Specified by:
    getNumberOfFinishedResults in interface ResultsSummaryManager
    Returns:
    number of summaries

    getNumberOfFinalizedResults

    public long getNumberOfFinalizedResults(@NotNull
                                            Plan plan)
    Description copied from interface: ResultsSummaryManager
    Get number of the ResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan

    Specified by:
    getNumberOfFinalizedResults in interface ResultsSummaryManager
    Returns:
    number of summaries

    getLatestbuildResultSummaries

    @Deprecated
    public java.util.List<BuildResultsSummary> getLatestbuildResultSummaries()
    Deprecated. 

    Description copied from interface: BuildResultsSummaryManager
    Retrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see

    Specified by:
    getLatestbuildResultSummaries in interface BuildResultsSummaryManager
    Returns:
    List of BuildResultsSummary

    getLatestFailedBuildResultSummaries

    @Deprecated
    public java.util.List<BuildResultsSummary> getLatestFailedBuildResultSummaries()
    Deprecated. 

    Description copied from interface: BuildResultsSummaryManager
    Retrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see

    Specified by:
    getLatestFailedBuildResultSummaries in interface BuildResultsSummaryManager
    Returns:
    List of BuildResultsSummary

    getLatestResultSummaries

    public java.util.List<ResultsSummary> getLatestResultSummaries()
    Description copied from interface: ResultsSummaryManager
    Retrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see

    Specified by:
    getLatestResultSummaries in interface ResultsSummaryManager
    Returns:
    List of ResultsSummary

    getLatestFailedResultSummaries

    public java.util.List<ResultsSummary> getLatestFailedResultSummaries()
    Description copied from interface: ResultsSummaryManager
    Retrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see

    Specified by:
    getLatestFailedResultSummaries in interface ResultsSummaryManager
    Returns:
    List of ResultsSummary

    getAverageBuildTime

    public long getAverageBuildTime(@NotNull
                                    Buildable plan,
                                    int numberOfResults)
    Description copied from interface: BuildResultsSummaryManager
    Returns average build duration for given number of builds

    Specified by:
    getAverageBuildTime in interface BuildResultsSummaryManager
    numberOfResults - - How many build results to use in the average. must be greater 0 @return Average build time. 0 if no build found.

    getAveragePlanExecutionDuration

    public long getAveragePlanExecutionDuration(@NotNull
                                                Plan plan,
                                                int numberOfResults)
    Description copied from interface: ResultsSummaryManager
    Get average duration from n last results summaries in finished state for a plan. Results in SUCCESSFUL state are preferred; only if there are none those in FAILED state are selected.

    Specified by:
    getAveragePlanExecutionDuration in interface ResultsSummaryManager
    numberOfResults - amount of results to be taken into account for average calculation
    Returns:
    average duration in milliseconds or 0 if there is no results

    countResultsWithState

    public int countResultsWithState(@NotNull
                                     PlanKey planKey,
                                     int lowerBuildNumber,
                                     int upperBuildNumber,
                                     @NotNull
                                     BuildState buildState)
    Description copied from interface: ResultsSummaryManager
    Counts results with a given state in a given build number range for plan.

    Specified by:
    countResultsWithState in interface ResultsSummaryManager
    Parameters:
    planKey - the key of plan to analyse
    lowerBuildNumber - the build number to start the count with
    upperBuildNumber - the build number to end the count with
    buildState - the state that will be counted
    Returns:
    the count

    getLastResultsSummary

    @Nullable
    public <T extends ResultsSummary> T getLastResultsSummary(@NotNull
                                                                       java.lang.String planKey,
                                                                       java.lang.Class<T> aClass)
    Description copied from interface: ResultsSummaryManager
    Get the last ResultsSummary for planKey and Class

    Specified by:
    getLastResultsSummary in interface ResultsSummaryManager
    Returns:

    updateCancelledDetails

    public void updateCancelledDetails(@NotNull
                                       ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Marks ResultSummary as cancelled

    Specified by:
    updateCancelledDetails in interface ResultsSummaryManager
    Parameters:
    resultsSummary - results summary

    moveResultSummaries

    public void moveResultSummaries(@NotNull
                                    Plan newParentPlan,
                                    @NotNull
                                    PlanKey oldPlanKey,
                                    @NotNull
                                    PlanKey newPlanKey)
    Description copied from interface: ResultsSummaryManager
    Reassigns plan key ResultsSummaries associated with selected plan key.

    Specified by:
    moveResultSummaries in interface ResultsSummaryManager
    Parameters:
    newParentPlan - the new parent plan of result summaries. This should be a plan, not a job.

    moveResultSummaries

    public void moveResultSummaries(PlanKey oldPlanKey,
                                    PlanKey newPlanKey)
    Description copied from interface: ResultsSummaryManager
    Reassigns plan key ResultsSummaries associated with selected plan key.

    Specified by:
    moveResultSummaries in interface ResultsSummaryManager

    scrollResultSummaries

    public long scrollResultSummaries(@NotNull
                                      java.lang.String buildKey,
                                      @NotNull
                                      com.google.common.base.Function<ResultsSummary,java.lang.Void> function)
    Description copied from interface: ResultsSummaryManager
    Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.

    Specified by:
    scrollResultSummaries in interface ResultsSummaryManager
    Parameters:
    buildKey - of the plan you want to scroll the result summaries for
    function - function to be executed on each of the BuildResultSummary
    Returns:
    number of traversed rows

    scrollResultSummaries

    public long scrollResultSummaries(@NotNull
                                      java.lang.String buildKey,
                                      ResultDataRead resultDataRead,
                                      @NotNull
                                      com.google.common.base.Function<ResultsSummary,java.lang.Void> function)
    Description copied from interface: ResultsSummaryManager
    Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.

    Specified by:
    scrollResultSummaries in interface ResultsSummaryManager
    Parameters:
    buildKey - of the plan you want to scroll the result summaries for
    resultDataRead - if the data should be loaded lazy or eagerly
    function - function to be executed on each of the BuildResultSummary
    Returns:
    number of traversed rows

    logVariablesForSubstitution

    public void logVariablesForSubstitution(@NotNull
                                            BuildContext buildContext,
                                            @NotNull
                                            ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Adds expected variable substitution to ResultsSummary This method logs substitution before build was performed and is used basically to log substitution against plan result as there will be no possibility to track it afterwards

    Specified by:
    logVariablesForSubstitution in interface ResultsSummaryManager

    logSubstitutedVariables

    public void logSubstitutedVariables(@NotNull
                                        BuildContext buildContext,
                                        @NotNull
                                        ResultsSummary resultsSummary)
    Description copied from interface: ResultsSummaryManager
    Adds variable substitution result to ResultsSummary This method logs substitution after it was performed and will use only REALLY substituted values

    Specified by:
    logSubstitutedVariables in interface ResultsSummaryManager

    setBuildResultsSummaryDao

    public void setBuildResultsSummaryDao(BuildResultsSummaryDao buildResultsSummaryDao)

    setExtendedAuthorManager

    public void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)

    setBuildResultsIndexer

    public void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)

    setEventManager

    public void setEventManager(com.atlassian.event.EventManager eventManager)

    setJiraIssueUtils

    public void setJiraIssueUtils(JiraIssueUtils jiraIssueUtils)

    setArtifactLinkManager

    public void setArtifactLinkManager(ArtifactLinkManager artifactLinkManager)

    setCommitDao

    public void setCommitDao(CommitDao commitDao)

    setBuildExecutionManager

    public void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)


    Copyright © 2011 Atlassian. All Rights Reserved.