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, ResultsSummaryManager


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 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
<T extends ResultsSummary>
T
createResultsSummary(ChainResultsSummary chainResultsSummary, BuildContext buildContext, java.lang.Class<T> aClass)
           
 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(ImmutablePlan 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(ImmutablePlan 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, boolean includeOnceOffBuilds)
          Finds the last successful or failing BuildResultsSummary before buildNumber
 ResultsSummary findLastFailingBuildResultBefore(ImmutablePlan 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
findLastResultBefore(PlanResultKey planResultKey, java.lang.Class<T> aClass, boolean includeOnceOffBuilds)
          Finds the last ResultsSummary before planResultKey.getBuildNumber
<T extends ResultsSummary>
T
findLastResultSummaryWithState(PlanKey planKey, BuildState buildState, java.lang.Class<T> aClass)
           
 ResultsSummary findLastSuccessfulBuildResultBefore(ImmutablePlan 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> 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
<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(ImmutableBuildable plan, int numberOfResults)
          Returns average build duration for given number of builds
 long getAveragePlanExecutionDuration(ImmutablePlan 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.
 ChainStageResult getChainStageResultById(java.lang.Long id)
          Returns a ChainStageResult by its id
 java.util.List<UnassociatedCommit> getCommitsForUser(java.lang.String username, int max)
          Retrieve a list of recent Commits for the given user.
<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.
 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)
           
 java.util.List<BuildResultsSummary> getLastNBuildResultsSummaries(ImmutableBuildable 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(ImmutablePlan plan, int numberOfResults)
          Provides a list of the latest N results summaries for the given plan, newest first.
<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)
           
 ResultsSummary getLastSuccessfulResultSummary(PlanKey planKey)
          Get the last successful ResultsSummary for planKey
 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(ImmutablePlan plan, int buildNumber, int neighbouringSummariesMaxCount)
          Returns all the ResultsSummary objects that matches the passed build numbers
 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(ImmutablePlan 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(long id)
          Lookup the ResultsSummary by id
 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>
getResultSummariesByChangeSetId(java.lang.String changeSetId, java.lang.Class<T> discriminator)
          Get a list of all build results containing a commit with the given change set ID.
<T extends ResultsSummary>
java.util.List<T>
getResultSummariesByChangeSetIds(java.util.List<java.lang.String> changeSetIds, java.lang.Class<T> discriminator)
          Get a list of all build results containing a commit with any of the given change set IDs.
<T extends ResultsSummary>
java.util.List<T>
getResultSummariesForPlan(ImmutablePlan 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
 int markResultSummariesForDeletion(PlanKey planKey)
          Mass update of all ResultsSummary records in the database related to a Plan identified by planKey.
 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(ImmutablePlan plan, int buildNumber)
          Remove any artifacts stored for this plan result
 void removeBuildLogs(ImmutablePlan plan, int buildNumber)
          Remove any build logs stored for this plan result
 void removeBuildResult(Buildable buildable, int buildNumber)
           
 void removeMatchingArtifacts(ResultsSummary resultsSummary, com.google.common.base.Predicate<ArtifactLink> predicate)
          Remove artifacts from results summary that match a predicate.
 void removeMergeResultSummary(MergeResultSummary mergeResult)
          Removes merge result.
 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.
 ResultsSummary resetResultSummary(BuildResultsSummary resultsSummary)
          Prepare result summry to be reuse for plan rerun
 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 setArtifactDao(ArtifactDao artifactDao)
           
 void setArtifactLinkManager(ArtifactLinkManager artifactLinkManager)
           
 void setArtifactManager(ArtifactManager artifactManager)
           
 void setBranchIntegrationService(BranchIntegrationService branchIntegrationService)
           
 void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
           
 void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)
           
 void setBuildResultsSummaryDao(BuildResultsSummaryDao buildResultsSummaryDao)
           
 void setCommentManager(CommentManager commentManager)
           
 void setCommitDao(CommitDao commitDao)
           
 void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
           
 void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)
           
 void setJiraIssueUtils(JiraIssueUtils jiraIssueUtils)
           
 void setMergeResultSummaryDao(MergeResultSummaryDao mergeResultSummaryDao)
           
 void setPlanManager(PlanManager planManager)
           
 void setRepositoryDefinitionManager(RepositoryDefinitionManager repositoryDefinitionManager)
           
 void setTestsManager(TestsManager testsManager)
           
 void setVariableContextBaselineDao(VariableContextBaselineDao variableContextBaselineDao)
           
 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 ImmutableResultsSummary.getProcessingDuration() and ChainStageResult.getProcessingDuration() based on chain execution.
 void updateResultSummaryWithBuildChanges(BuildContext buildContext)
           
 
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
                                                                                      ImmutablePlan 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

getResultsSummary

public ResultsSummary getResultsSummary(long id)
Description copied from interface: ResultsSummaryManager
Lookup the ResultsSummary by id

Specified by:
getResultsSummary in interface ResultsSummaryManager
Parameters:
id - - database id
Returns:
resultsSummary

resetResultSummary

public ResultsSummary resetResultSummary(@NotNull
                                         BuildResultsSummary resultsSummary)
Description copied from interface: ResultsSummaryManager
Prepare result summry to be reuse for plan rerun

Specified by:
resetResultSummary in interface ResultsSummaryManager
Returns:

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

createResultsSummary

public <T extends ResultsSummary> T createResultsSummary(@Nullable
                                                         ChainResultsSummary chainResultsSummary,
                                                         @NotNull
                                                         BuildContext buildContext,
                                                         @NotNull
                                                         java.lang.Class<T> aClass)
                                              throws ResultsSummaryCreationException
Specified by:
createResultsSummary in interface BuildResultsSummaryManager
Throws:
ResultsSummaryCreationException

updateResultSummaryWithBuildChanges

public void updateResultSummaryWithBuildChanges(@NotNull
                                                BuildContext buildContext)
                                         throws ResultsSummaryCreationException
Specified by:
updateResultSummaryWithBuildChanges in interface ResultsSummaryManager
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

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 ImmutableResultsSummary.getProcessingDuration() and ChainStageResult.getProcessingDuration() based on chain execution.

Specified by:
updateProcessingDuration in interface ResultsSummaryManager

markResultSummariesForDeletion

public int markResultSummariesForDeletion(@NotNull
                                          PlanKey planKey)
Description copied from interface: ResultsSummaryManager
Mass update of all ResultsSummary records in the database related to a Plan identified by planKey.

Specified by:
markResultSummariesForDeletion in interface ResultsSummaryManager
Parameters:
planKey - key of a plan
Returns:
number of updated records

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.

getLastNBuildResultsSummaries

@Deprecated
@NotNull
public java.util.List<BuildResultsSummary> getLastNBuildResultsSummaries(@NotNull
                                                                                            ImmutableBuildable 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
                                                                       ImmutablePlan 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.

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:

countBuildResultsSummaries

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

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
                                                                     ImmutablePlan 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)

removeBuildLogs

public void removeBuildLogs(ImmutablePlan 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(@NotNull
                            ImmutablePlan 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

    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
    Returns:
    List of BuildResultsSummary

    getNeighbouringSummaries

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

    Specified by:
    getNeighbouringSummaries in interface ResultsSummaryManager
    Returns:
    List of BuildResultsSummary

    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

    saveResultSummary

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

    Specified by:
    saveResultSummary in interface ResultsSummaryManager

    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

    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

    findLastSuccessfulBuildResultBefore

    @Nullable
    public ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull
                                                                       ImmutablePlan 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:

    findLastResultBefore

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

    Specified by:
    findLastResultBefore in interface ResultsSummaryManager
    includeOnceOffBuilds - - should we skip once-off builds or include them in the search
    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

    getResultSummariesByChangeSetId

    @NotNull
    public <T extends ResultsSummary> java.util.List<T> getResultSummariesByChangeSetId(@NotNull
                                                                                                java.lang.String changeSetId,
                                                                                                java.lang.Class<T> discriminator)
    Description copied from interface: ResultsSummaryManager
    Get a list of all build results containing a commit with the given change set ID.

    Specified by:
    getResultSummariesByChangeSetId in interface ResultsSummaryManager
    Type Parameters:
    T - extends ResultSummary
    Parameters:
    changeSetId - of the commit
    discriminator - class of the ResultSummary interface required
    Returns:
    List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId

    getResultSummariesByChangeSetIds

    @NotNull
    public <T extends ResultsSummary> java.util.List<T> getResultSummariesByChangeSetIds(@NotNull
                                                                                                 java.util.List<java.lang.String> changeSetIds,
                                                                                                 java.lang.Class<T> discriminator)
    Description copied from interface: ResultsSummaryManager
    Get a list of all build results containing a commit with any of the given change set IDs.

    Specified by:
    getResultSummariesByChangeSetIds in interface ResultsSummaryManager
    Type Parameters:
    T - extends ResultSummary
    Parameters:
    changeSetIds - of the commit
    discriminator - class of the ResultSummary interface required
    Returns:
    List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with any of the given changeSetIds

    getCommitsForUser

    @NotNull
    public java.util.List<UnassociatedCommit> getCommitsForUser(@NotNull
                                                                        java.lang.String username,
                                                                        int max)
    Description copied from interface: ResultsSummaryManager
    Retrieve a list of recent Commits for the given user. Items in the collection are unique and sorted by date.

    Specified by:
    getCommitsForUser in interface ResultsSummaryManager
    Parameters:
    username - to filter commits by
    max - maximum number of commits to get.
    Returns:
    a list of recent Commits for the given user

    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,
                                                                           boolean includeOnceOffBuilds)
    Description copied from interface: ResultsSummaryManager
    Finds the last successful or failing BuildResultsSummary before buildNumber

    Specified by:
    findLastBuildResultBeforeWithTests in interface ResultsSummaryManager
    includeOnceOffBuilds - should once-off builds be considered or ignored in the search
    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
                                                                    ImmutablePlan 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
                                                                     ImmutablePlan 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(@NotNull
                                           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 ResultsSummaryManager
    Returns:
    number of summaries

    getNumberOfFinalizedResults

    public long getNumberOfFinalizedResults(@NotNull
                                            ImmutablePlan 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

    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
                                    ImmutableBuildable 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
                                                ImmutablePlan 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

    removeMergeResultSummary

    public void removeMergeResultSummary(@NotNull
                                         MergeResultSummary mergeResult)
    Description copied from interface: ResultsSummaryManager
    Removes merge result. Use with care.

    Specified by:
    removeMergeResultSummary in interface ResultsSummaryManager

    setBuildResultsSummaryDao

    public void setBuildResultsSummaryDao(BuildResultsSummaryDao buildResultsSummaryDao)

    setExtendedAuthorManager

    public void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)

    setBuildResultsIndexer

    public void setBuildResultsIndexer(BuildResultsIndexer buildResultsIndexer)

    setEventPublisher

    public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)

    setJiraIssueUtils

    public void setJiraIssueUtils(JiraIssueUtils jiraIssueUtils)

    setArtifactLinkManager

    public void setArtifactLinkManager(ArtifactLinkManager artifactLinkManager)

    setCommitDao

    public void setCommitDao(CommitDao commitDao)

    setBuildExecutionManager

    public void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)

    setRepositoryDefinitionManager

    public void setRepositoryDefinitionManager(RepositoryDefinitionManager repositoryDefinitionManager)

    setTestsManager

    public void setTestsManager(TestsManager testsManager)

    setCommentManager

    public void setCommentManager(CommentManager commentManager)

    setBranchIntegrationService

    public void setBranchIntegrationService(BranchIntegrationService branchIntegrationService)

    setArtifactManager

    public void setArtifactManager(ArtifactManager artifactManager)

    setMergeResultSummaryDao

    public void setMergeResultSummaryDao(MergeResultSummaryDao mergeResultSummaryDao)

    setVariableContextBaselineDao

    public void setVariableContextBaselineDao(VariableContextBaselineDao variableContextBaselineDao)

    setPlanManager

    public void setPlanManager(PlanManager planManager)

    setArtifactDao

    public void setArtifactDao(ArtifactDao artifactDao)


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