Class BuildResultsSummaryHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<ResultsSummary>
-
- com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao
-
- All Implemented Interfaces:
BambooObjectDao<ResultsSummary>
,BuildResultsSummaryDao
,org.springframework.beans.factory.InitializingBean
public class BuildResultsSummaryHibernateDao extends BambooHibernateObjectDao<ResultsSummary> implements BuildResultsSummaryDao
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
BUILD_AGENT_ID
protected static String
BUILD_COMPLETED_DATE
protected static String
BUILD_NUMBER
protected static String
BUILD_STATE
protected static String
CONTINUABLE
protected static String
CREATION_DATE
protected static String
DELTA_STATE
protected static String
LIFE_CYCLE_STATE
static int
NEIGHBOURING_SUMMARIES_MAX_COUNT
protected static String
PLAN_KEY
-
Fields inherited from interface com.atlassian.bamboo.resultsummary.BuildResultsSummaryDao
NUMBER_OF_DAYS_TO_FILTER
-
-
Constructor Summary
Constructors Constructor Description BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Long
calculateQueueDuration(@NotNull ChainResultsSummary resultsSummary)
Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.@Nullable Long
calculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary)
Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.int
countBuildResultsSummaries()
Count all result summaries records.int
countBuildResultsSummaries(@NotNull String planKey)
<T extends ResultsSummary>
LongcountByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass)
CountsResultsSummary
objects given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.long
countResultSummaries(@NotNull ResultsSummaryCriteria criteria)
Count the number ofResultsSummary
objects given aResultsSummaryCriteria
.int
countResultsWithState(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)
Counts results with a given state in a given build number range for plan.List<Integer>
findAllBuildResultsNumbers(PlanKey planKey)
<T extends ResultsSummary>
TfindAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
Searches for anyResultsSummary
object given aResultsSummaryCriteria
.@NotNull Range<Integer>
findBuildResultsNumberRange(PlanKey planKey)
Finds minimum and maximum build number for a plan.@NotNull List<ResultsSummary>
findBuildResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)
Get a list of results summaries associated with the list of issue keys.@NotNull List<ResultsSummary>
findBuildResultsSummariesByProjectKey(@Nullable String jiraProjectKey)
Retrieve a list of results summaries associated with given JIRA project key This will not return records marked for deletion.List<Pair<ArtifactLink,BuildResultsSummary>>
findBuildResultsWithArtifacts(String planKey)
Find all build results which have matching artifacts.@NotNull List<BuildResultsSummary>
findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImage, @Nullable BuildState buildState, int maxResults)
Searcher for builds of an image<T extends ResultsSummary>
List<T>findByAuthors(Collection<ExtendedAuthor> authors, Class<T> resultClass, int maxResults)
<T extends ResultsSummary>
@NotNull List<T>findByCriteria(@NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass, @NotNull ResultDataRead dataRead)
Searches for anyResultsSummary
object given aResultSummarySearchCriteria
.<E extends ResultsSummary>
EfindById(long id, @NotNull Class<E> aClass)
Find an entity by its id<T extends ResultsSummary>
@NotNull List<T>findByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass, @NotNull ResultDataRead dataRead)
Searches for anyResultsSummary
object given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.@NotNull List<PlanResultKey>
findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
List<ChainResultsSummary>
findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria, List<Label> labels)
Searches through all chains to find any that have jobs which match the given labels.Integer
findFirstBuildNumberAfter(@NotNull String planKey, int buildNumber)
Returns the build number of next existing build results.ResultsSummary
findFirstBuildResultWithBuildStateAfter(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState)
Finds the last successfulBuildResultsSummary
after buildNumber@Nullable ResultsSummary
findFirstBuildResultWithBuildStateBetween(@NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)
Returns the first build that matchesBuildState
between the given build number range Note that this function is inclusive of the upper and lower bound<T extends ResultsSummary>
TfindFirstResultAfter(@NotNull String planKey, int buildNumber, Class<T> aClass)
Finds the first successful or failedBuildResultsSummary
after buildNumber@NotNull List<PlanKey>
findJobKeysFromExistingChainResults(@NotNull PlanKey chainKey)
Find keys of jobs for which results associated with given plan exist.Integer
findLastBuildNumberBefore(@NotNull String planKey, int buildNumber)
Returns the build number of previous existing build results.<T extends ResultsSummary>
TfindLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
ResultsSummary
findLastBuildResultWithBuildStateBefore(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState, boolean includeOnceOffBuilds)
Finds the lastBuildResultsSummary
before buildNumber withBuildState
<T extends ResultsSummary>
TfindLastResultBefore(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
Finds the last successful or failedResultsSummary
before buildNumber<T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass)
<T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass, boolean ignoreSpecsResults)
List<ResultsSummary>
findLatestFailedResultSummaries()
Find the failed result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTERList<ResultsSummary>
findLatestResultsSummaries()
Find the result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTERint
findMinimumBuildNumberForNLatest(@NotNull PlanKey planKey, int n)
Find a build number for which exist n non-specs results with a build number greater or equal.Iterable<PlanKey>
findPlanKeysFromAllOrphanedResultSummaries()
Scans database for all theChainResultsSummary
objects in the database that do not have a matchingChain
<T extends ResultsSummary>
@NotNull List<T>findResultsSummaries(@NotNull ResultsSummaryCriteria criteria)
Searches forResultsSummary
objects given aResultsSummaryCriteria
.<T extends ResultsSummary>
@NotNull List<T>findResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria)
Searches forResultsSummary
objects given aExpiryCriteria
.@NotNull Set<Long>
findSpecsStatesIdsReferencedByBuildResultSummaries()
Finds all specs states ids that are referenced by any build result summary@NotNull List<ResultsSummary>
getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results strictly after given build number.<T extends ResultsSummary>
@NotNull Collection<T>getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.PENDING
,LifeCycleState.QUEUED
,LifeCycleState.IN_PROGRESS
state with the givenClass
See alsoLifeCycleState.isActive(LifeCycleState)
andImmutableResultsSummary.isActive()
<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInBuildState(@NotNull BuildState state, @NotNull Class<T> aClass)
Returns all theBuildResultsSummary
in requested build state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInLifeCycleState(@NotNull LifeCycleState state, @NotNull Class<T> aClass)
Returns all theBuildResultsSummary
in requested lifecycle state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state This will not return records marked for deletion.@NotNull Collection<BuildResultsSummary>
getAllInProgressBuildResultSummaries()
Returns all theBuildResultsSummary
in aLifeCycleState.IN_PROGRESS
state This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllInProgressResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllPendingResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.PENDING
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllQueuedResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.QUEUED
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
List<T>getAllResultSummariesForPlan(@NotNull Plan plan)
Get all theResultsSummary
s for the givenPlan
@NotNull List<ResultsSummary>
getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results strictly before given build number.@Nullable ResultsSummary
getBreakingBuild(ResultsSummary summary)
ChainStageResult
getChainStageResultById(long id)
Returns aChainStageResult
by its id<T extends ResultsSummary>
@NotNull List<T>getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
Returns all theResultsSummary
in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state with the givenClass
.BuildResultsSummary
getFirstBuildSummary(@NotNull PlanKey planKey)
Returns the first availableBuildResultsSummary
for the givenPlanKey
@Nullable ResultsSummary
getFixingBuild(ResultsSummary summary)
Returns the first successfulBuildResultsSummary
for givenBuildResultsSummary
.@NotNull List<LinkedJiraIssue>
getJiraIssuesForBuildResults(@NotNull List<ResultsSummary> buildResults)
Retrieves a list ofLinkedJiraIssue
linked to the given build result summaries@NotNull List<LinkedJiraIssue>
getJiraIssuesForPlanKey(@NotNull PlanKey planKey)
Retrieves a list ofLinkedJiraIssue
that are linked to the given build.<T extends ResultsSummary>
TgetLastResultSummary(String planKey, Class<T> aClass)
Returns the latest completedResultsSummary
andClass
for the plan represented by planKey<T extends ResultsSummary>
TgetLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
Returns the latest completedResultsSummary
andClass
for the plan represented by planKey with possible skip of specs results.@NotNull List<ResultsSummary>
getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results "around" given build number.@NotNull List<ResultsSummary>
getNeighbouringSummaries(Plan plan, int currentBuildNumber)
Returns build results "around" given build numberint
getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Get the number of concurrently running builds for planKeylong
getNumberOfFinalizedResults(@NotNull ImmutablePlan plan)
long
getNumberOfFinalizedResults(@NotNull PlanKey planKey)
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
long
getNumberOfFinishedResults(Plan plan)
Returns the number of finished results available for the givenPlan
@Nullable ChainResultsSummary
getParentResultSummary(ResultsSummary summary)
Get (@link ChainResultsSummary} containing givenResultsSummary
@NotNull List<PlanKey>
getPlanKeysSortedByNumberOfFinalizedResultSummaries()
<T extends ResultsSummary>
TgetResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass)
LookupResultsSummary
byPlanResultKey
and expected type<T extends ResultsSummary>
TgetResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead)
LookupResultsSummary
byPlanResultKey
and expected type, all lazy initialized collections can be eagerly readLong
getResultsSummaryId(@NotNull PlanResultKey planResultKey)
ReturnResultsSummary
's database id.<T extends ResultsSummary>
List<T>getResultSummariesByChangeSetId(@NotNull String changeSetId, @NotNull Class<T> discriminator)
Get a list of all build results containing a commit with the given changeset ID.<T extends ResultsSummary>
List<T>getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull String changeSetId, @NotNull Class<T> discriminator)
Get a list of all build results containing a commit with the given changeset ID that are in the given repository.<T extends ResultsSummary>
List<T>getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, @NotNull Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs.<T extends ResultsSummary>
List<T>getResultSummariesByCheckoutChangesetId(@NotNull String changesetId, @NotNull Class<T> discriminator)
Get a list of all build results containing repositories checked out with the given changeset ID.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)
Get theResultsSummary
s for the givenPlan
.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
Get theResultsSummary
s for the givenPlan
in giveLifeCycleState
that are Results are sorted by build number (descending).@Nullable ChainStageResult
getStageForResult(ResultsSummary summary)
Get (@link ChainStageResult} containing givenResultsSummary
int
markResultSummariesForDeletion(@NotNull PlanKey planKey)
Mass update of allResultsSummary
records in the database related to a Plan identified by planKey.int
moveResultSummaries(@NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey)
Reassigns plan key ResultsSummaries associated with selected plan key.int
removeResultsSummariesForPlan(@NotNull PlanKey planKey)
Remove all resultSummary objects for the given plan.void
removeResultsSummary(@NotNull ResultsSummary resultsSummary)
Removes the passed result summarylong
scrollResultSummaries(@NotNull String buildKey, @NotNull ResultDataRead dataRead, @NotNull Consumer<ResultsSummary> consumer)
Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized.long
scrollVariableSubstitutionForExport(@NotNull Consumer<VariableSubstitution> consumer)
Scroll through and execute function for each of VariableSubstitution Objects passed to function are not fully initialized.void
setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
void
setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry)
-
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, merge, save, saveAll
-
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
-
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, merge, save, saveAll
-
-
-
-
Field Detail
-
CREATION_DATE
protected static final String CREATION_DATE
- See Also:
- Constant Field Values
-
BUILD_COMPLETED_DATE
protected static final String BUILD_COMPLETED_DATE
- See Also:
- Constant Field Values
-
BUILD_AGENT_ID
protected static final String BUILD_AGENT_ID
- See Also:
- Constant Field Values
-
BUILD_NUMBER
protected static final String BUILD_NUMBER
- See Also:
- Constant Field Values
-
PLAN_KEY
protected static final String PLAN_KEY
- See Also:
- Constant Field Values
-
BUILD_STATE
protected static final String BUILD_STATE
- See Also:
- Constant Field Values
-
LIFE_CYCLE_STATE
protected static final String LIFE_CYCLE_STATE
- See Also:
- Constant Field Values
-
DELTA_STATE
protected static final String DELTA_STATE
- See Also:
- Constant Field Values
-
CONTINUABLE
protected static final String CONTINUABLE
- See Also:
- Constant Field Values
-
NEIGHBOURING_SUMMARIES_MAX_COUNT
public static final int NEIGHBOURING_SUMMARIES_MAX_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BuildResultsSummaryHibernateDao
public BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
-
-
Method Detail
-
getResultsSummaryId
public Long getResultsSummaryId(@NotNull @NotNull PlanResultKey planResultKey)
Description copied from interface:BuildResultsSummaryDao
ReturnResultsSummary
's database id. This method is intended for internal use (currently in importer)- Specified by:
getResultsSummaryId
in interfaceBuildResultsSummaryDao
- Parameters:
planResultKey
- plan result key ofResultsSummary
to be found- Returns:
- id of
ResultsSummary
or null if not found
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
LookupResultsSummary
byPlanResultKey
and expected type- Specified by:
getResultsSummary
in interfaceBuildResultsSummaryDao
- Returns:
- resultSummary
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead)
Description copied from interface:BuildResultsSummaryDao
LookupResultsSummary
byPlanResultKey
and expected type, all lazy initialized collections can be eagerly read- Specified by:
getResultsSummary
in interfaceBuildResultsSummaryDao
- Returns:
- resultSummary
-
findById
public <E extends ResultsSummary> E findById(long id, @NotNull @NotNull Class<E> aClass)
Description copied from interface:BambooObjectDao
Find an entity by its id- Specified by:
findById
in interfaceBambooObjectDao<ResultsSummary>
- Overrides:
findById
in classBambooHibernateObjectDao<ResultsSummary>
- Parameters:
id
- id of entityaClass
- class of entity- Returns:
- entity
-
getAllBuildResultSummariesInBuildState
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInBuildState(@NotNull @NotNull BuildState state, @NotNull @NotNull Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theBuildResultsSummary
in requested build state. This will not return records marked for deletion.- Specified by:
getAllBuildResultSummariesInBuildState
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getAllBuildResultSummariesInLifeCycleState
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull @NotNull LifeCycleState state, @NotNull @NotNull Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theBuildResultsSummary
in requested lifecycle state. This will not return records marked for deletion.- Specified by:
getAllBuildResultSummariesInLifeCycleState
in interfaceBuildResultsSummaryDao
-
getAllBuildResultSummariesInUnknownState
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state This will not return records marked for deletion.- Specified by:
getAllBuildResultSummariesInUnknownState
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getAllPendingResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theResultsSummary
in aLifeCycleState.PENDING
state with the givenClass
This will not return records marked for deletion.- Specified by:
getAllPendingResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getAllQueuedResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theResultsSummary
in aLifeCycleState.QUEUED
state with the givenClass
This will not return records marked for deletion.- Specified by:
getAllQueuedResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getAllInProgressResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state with the givenClass
This will not return records marked for deletion.- Specified by:
getAllInProgressResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getAllActiveResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns all theResultsSummary
in aLifeCycleState.PENDING
,LifeCycleState.QUEUED
,LifeCycleState.IN_PROGRESS
state with the givenClass
See alsoLifeCycleState.isActive(LifeCycleState)
andImmutableResultsSummary.isActive()
- Specified by:
getAllActiveResultSummariesForPlan
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getFinalizedResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
Description copied from interface:BuildResultsSummaryDao
Returns all theResultsSummary
in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state with the givenClass
. Result are sorted descending by build number.- Specified by:
getFinalizedResultSummariesForPlan
in interfaceBuildResultsSummaryDao
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:BuildResultsSummaryDao
Get the number of concurrently running builds for planKey- Specified by:
getNumberOfConcurrentlyRunningBuilds
in interfaceBuildResultsSummaryDao
- Returns:
-
getAllInProgressBuildResultSummaries
@NotNull public @NotNull Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
Description copied from interface:BuildResultsSummaryDao
Returns all theBuildResultsSummary
in aLifeCycleState.IN_PROGRESS
state This will not return records marked for deletion.- Specified by:
getAllInProgressBuildResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
findAnyResultSummary
@Nullable public <T extends ResultsSummary> T findAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
Description copied from interface:BuildResultsSummaryDao
Searches for anyResultsSummary
object given aResultsSummaryCriteria
. Note that if criteria does not specify order then result of this method might be non-deterministic.- Specified by:
findAnyResultSummary
in interfaceBuildResultsSummaryDao
- Returns:
List
ofBuildResultsSummary
-
findByJiraCriteria
@NotNull public <T extends ResultsSummary> @NotNull List<T> findByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
Description copied from interface:BuildResultsSummaryDao
Searches for anyResultsSummary
object given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.- Specified by:
findByJiraCriteria
in interfaceBuildResultsSummaryDao
-
countByJiraCriteria
public <T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass)
Description copied from interface:BuildResultsSummaryDao
CountsResultsSummary
objects given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.- Specified by:
countByJiraCriteria
in interfaceBuildResultsSummaryDao
-
findByCriteria
@NotNull public <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
Description copied from interface:BuildResultsSummaryDao
Searches for anyResultsSummary
object given aResultSummarySearchCriteria
.- Specified by:
findByCriteria
in interfaceBuildResultsSummaryDao
-
findResultsSummaries
@NotNull public <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
Description copied from interface:BuildResultsSummaryDao
Searches forResultsSummary
objects given aResultsSummaryCriteria
. Note that if criteria does not specify maxResults property, a hard cap of 10000 results is applied to search operation.- Specified by:
findResultsSummaries
in interfaceBuildResultsSummaryDao
- Returns:
List
ofBuildResultsSummary
-
findByAuthors
public <T extends ResultsSummary> List<T> findByAuthors(Collection<ExtendedAuthor> authors, Class<T> resultClass, int maxResults)
- Specified by:
findByAuthors
in interfaceBuildResultsSummaryDao
-
moveResultSummaries
public int moveResultSummaries(@NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)
Description copied from interface:BuildResultsSummaryDao
Reassigns plan key ResultsSummaries associated with selected plan key.- Specified by:
moveResultSummaries
in interfaceBuildResultsSummaryDao
- Parameters:
oldPlanKey
- the plan key to move fromnewPlanKey
- the plan key to move to- Returns:
- the number of result summaries updated
-
countResultSummaries
public long countResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
Description copied from interface:BuildResultsSummaryDao
Count the number ofResultsSummary
objects given aResultsSummaryCriteria
.- Specified by:
countResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- long representing the count of
ResultsSummary
that match the criteria.
-
findResultSummariesForExpiry
@NotNull public <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria expiryCriteria)
Description copied from interface:BuildResultsSummaryDao
Searches forResultsSummary
objects given aExpiryCriteria
.- Specified by:
findResultSummariesForExpiry
in interfaceBuildResultsSummaryDao
- Type Parameters:
T
- type of result objects (determined according to given criteria)- Parameters:
expiryCriteria
- search constraints- Returns:
List
ofResultsSummary
-
findJobKeysFromExistingChainResults
@NotNull public @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey)
Description copied from interface:BuildResultsSummaryDao
Find keys of jobs for which results associated with given plan exist. The jobs themselves might no longer exist.- Specified by:
findJobKeysFromExistingChainResults
in interfaceBuildResultsSummaryDao
-
removeResultsSummariesForPlan
public int removeResultsSummariesForPlan(@NotNull @NotNull PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Remove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands ofResultsSummary
objects to be deleted- Specified by:
removeResultsSummariesForPlan
in interfaceBuildResultsSummaryDao
- Parameters:
planKey
- identifier of plan to remove results for.- Returns:
- number of deleted
ResultsSummary
objects
-
findPlanKeysFromAllOrphanedResultSummaries
public Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
Description copied from interface:BuildResultsSummaryDao
Scans database for all theChainResultsSummary
objects in the database that do not have a matchingChain
- Specified by:
findPlanKeysFromAllOrphanedResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- list of distinct
PlanKey
s they reference
-
countBuildResultsSummaries
public int countBuildResultsSummaries(@NotNull @NotNull String planKey)
- Specified by:
countBuildResultsSummaries
in interfaceBuildResultsSummaryDao
-
countBuildResultsSummaries
public int countBuildResultsSummaries()
Description copied from interface:BuildResultsSummaryDao
Count all result summaries records. This will not count records marked for deletion.- Specified by:
countBuildResultsSummaries
in interfaceBuildResultsSummaryDao
- Returns:
-
findBuildsForImageConfiguration
@NotNull public @NotNull List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImage, @Nullable @Nullable BuildState buildState, int maxResults)
Description copied from interface:BuildResultsSummaryDao
Searcher for builds of an image- Specified by:
findBuildsForImageConfiguration
in interfaceBuildResultsSummaryDao
- Returns:
-
findBuildResultsWithArtifacts
public List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
Description copied from interface:BuildResultsSummaryDao
Find all build results which have matching artifacts. Sorted by buildNumber, ascending- Specified by:
findBuildResultsWithArtifacts
in interfaceBuildResultsSummaryDao
- Returns:
-
getResultSummariesByChangeSetId
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
Description copied from interface:BuildResultsSummaryDao
Get a list of all build results containing a commit with the given changeset ID.
Please note that a build result summary contains list of commits which were added in a given build (compared to a previous one). It means that a list of commits may be empty if there were no repository changes. A list of commits is also empty in case of a first build in a plan or a first build of a plan's branch. A build results summary may also contain no commits if no version control system was used.
This will not return records marked for deletion.
In case you need to find build results based on commit which was checked out into a build workspace, see the
BuildResultsSummaryDao.getResultSummariesByCheckoutChangesetId(String, Class)
.- Specified by:
getResultSummariesByChangeSetId
in interfaceBuildResultsSummaryDao
- Parameters:
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
-
getResultSummariesByCheckoutChangesetId
public <T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull @NotNull String changesetId, @NotNull @NotNull Class<T> discriminator)
Description copied from interface:BuildResultsSummaryDao
Get a list of all build results containing repositories checked out with the given changeset ID.
A build may use one or more repositories, each checked out with a certain changeset. This method returns build results having exact changeset ID checked out (note that it does not search for intermediate commits between two changeset IDs).
This will not return records marked for deletion.
In case you need to find build results based on commits which were added in certain build (compared to a previous one), see the
BuildResultsSummaryDao.getResultSummariesByChangeSetId(String, Class)
.- Specified by:
getResultSummariesByCheckoutChangesetId
in interfaceBuildResultsSummaryDao
- Parameters:
changesetId
- of the commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a repository which
was checked out with a
changesetId
commit
-
getResultSummariesByChangeSetIdAndRepository
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
Description copied from interface:BuildResultsSummaryDao
Get a list of all build results containing a commit with the given changeset ID that are in the given repository. This will not return records marked for deletion.- Specified by:
getResultSummariesByChangeSetIdAndRepository
in interfaceBuildResultsSummaryDao
- Type Parameters:
T
- extends ResultSummary- Parameters:
repositoryId
- of the repositorychangeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
-
getResultSummariesByChangeSetIds
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, @NotNull @NotNull Class<T> discriminator)
Description copied from interface:BuildResultsSummaryDao
Get a list of all build results containing a commit with any of the given changeset IDs. This will not return records marked for deletion.- Specified by:
getResultSummariesByChangeSetIds
in interfaceBuildResultsSummaryDao
- Parameters:
changeSetIds
- of the commitsdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the any of the given changeSetIds
-
findBuildResultsSummariesByJiraIssues
@NotNull public @NotNull List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
Description copied from interface:BuildResultsSummaryDao
Get a list of results summaries associated with the list of issue keys. This will not return records marked for deletion.- Specified by:
findBuildResultsSummariesByJiraIssues
in interfaceBuildResultsSummaryDao
- Returns:
- list of result summaries
-
findBuildResultsSummariesByProjectKey
@NotNull public @NotNull List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable @Nullable String jiraProjectKey)
Description copied from interface:BuildResultsSummaryDao
Retrieve a list of results summaries associated with given JIRA project key This will not return records marked for deletion.- Specified by:
findBuildResultsSummariesByProjectKey
in interfaceBuildResultsSummaryDao
- Parameters:
jiraProjectKey
- - JIRA project key (prefix of the jira issues e.g. 'BAM')- Returns:
- a list of results summaries associated with given JIRA project key
-
removeResultsSummary
public void removeResultsSummary(@NotNull @NotNull ResultsSummary resultsSummary)
Description copied from interface:BuildResultsSummaryDao
Removes the passed result summary- Specified by:
removeResultsSummary
in interfaceBuildResultsSummaryDao
- Parameters:
resultsSummary
- -
-
getFirstBuildSummary
public BuildResultsSummary getFirstBuildSummary(@NotNull @NotNull PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Returns the first availableBuildResultsSummary
for the givenPlanKey
- Specified by:
getFirstBuildSummary
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
getLastResultSummary
public <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Returns the latest completedResultsSummary
andClass
for the plan represented by planKey- Specified by:
getLastResultSummary
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
getLastResultSummary
public <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
Description copied from interface:BuildResultsSummaryDao
Returns the latest completedResultsSummary
andClass
for the plan represented by planKey with possible skip of specs results.- Specified by:
getLastResultSummary
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
findFirstBuildNumberAfter
public Integer findFirstBuildNumberAfter(@NotNull @NotNull String planKey, int buildNumber)
Description copied from interface:BuildResultsSummaryDao
Returns the build number of next existing build results.- Specified by:
findFirstBuildNumberAfter
in interfaceBuildResultsSummaryDao
- Returns:
- null if no build result summary with higher number exists
-
findLastBuildNumberBefore
public Integer findLastBuildNumberBefore(@NotNull @NotNull String planKey, int buildNumber)
Description copied from interface:BuildResultsSummaryDao
Returns the build number of previous existing build results.- Specified by:
findLastBuildNumberBefore
in interfaceBuildResultsSummaryDao
- Returns:
- null if no build result summary with lower number exists
-
getNumberOfFinishedResults
public long getNumberOfFinishedResults(Plan plan)
Description copied from interface:BuildResultsSummaryDao
Returns the number of finished results available for the givenPlan
- Specified by:
getNumberOfFinishedResults
in interfaceBuildResultsSummaryDao
- Returns:
- numberOfResults
-
getNumberOfFinalizedResults
public long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)
- Specified by:
getNumberOfFinalizedResults
in interfaceBuildResultsSummaryDao
- Parameters:
plan
-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
public long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
- Specified by:
getNumberOfFinalizedResults
in interfaceBuildResultsSummaryDao
- Returns:
- number of summaries
-
getNeighbouringSummaries
@NotNull public @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
Description copied from interface:BuildResultsSummaryDao
Returns build results "around" given build number- Specified by:
getNeighbouringSummaries
in interfaceBuildResultsSummaryDao
- Returns:
-
getNeighbouringSummaries
@NotNull public @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Description copied from interface:BuildResultsSummaryDao
Returns build results "around" given build number.- Specified by:
getNeighbouringSummaries
in interfaceBuildResultsSummaryDao
- Parameters:
plan
- the plan to return results forbuildNumber
- the build number to search aroundmaxCount
- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCount
items in the list, inclusive of the result forbuildNumber
(if present).
-
getBeforeSummaries
@NotNull public @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Description copied from interface:BuildResultsSummaryDao
Returns build results strictly before given build number.- Specified by:
getBeforeSummaries
in interfaceBuildResultsSummaryDao
- Parameters:
plan
- the plan to return results forbuildNumber
- the build number to search beforemaxCount
- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCount
items in the list, exclusive of the result forbuildNumber
(if present).
-
getAfterSummaries
@NotNull public @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Description copied from interface:BuildResultsSummaryDao
Returns build results strictly after given build number.- Specified by:
getAfterSummaries
in interfaceBuildResultsSummaryDao
- Parameters:
plan
- the plan to return results forbuildNumber
- the build number to search aftermaxCount
- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCount
items in the list, exclusive of the result forbuildNumber
(if present).
-
getBreakingBuild
@Nullable public @Nullable ResultsSummary getBreakingBuild(ResultsSummary summary)
- Specified by:
getBreakingBuild
in interfaceBuildResultsSummaryDao
-
getFixingBuild
@Nullable public @Nullable ResultsSummary getFixingBuild(ResultsSummary summary)
Description copied from interface:BuildResultsSummaryDao
Returns the first successfulBuildResultsSummary
for givenBuildResultsSummary
. The input build is returned if it is successful.- Specified by:
getFixingBuild
in interfaceBuildResultsSummaryDao
- Returns:
- null if there is no fixing build.
-
getJiraIssuesForBuildResults
@NotNull public @NotNull List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull @NotNull List<ResultsSummary> buildResults)
Description copied from interface:BuildResultsSummaryDao
Retrieves a list ofLinkedJiraIssue
linked to the given build result summaries- Specified by:
getJiraIssuesForBuildResults
in interfaceBuildResultsSummaryDao
- Returns:
-
getJiraIssuesForPlanKey
@NotNull public @NotNull List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Retrieves a list ofLinkedJiraIssue
that are linked to the given build.- Specified by:
getJiraIssuesForPlanKey
in interfaceBuildResultsSummaryDao
- Returns:
-
scrollVariableSubstitutionForExport
public long scrollVariableSubstitutionForExport(@NotNull @NotNull Consumer<VariableSubstitution> consumer)
Description copied from interface:BuildResultsSummaryDao
Scroll through and execute function for each of VariableSubstitution Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Specified by:
scrollVariableSubstitutionForExport
in interfaceBuildResultsSummaryDao
- Parameters:
consumer
- consumer to accept each of the VariableSubstitution- Returns:
- number of traversed rows
-
findFirstResultAfter
@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass)
Description copied from interface:BuildResultsSummaryDao
Finds the first successful or failedBuildResultsSummary
after buildNumber- Specified by:
findFirstResultAfter
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
findLastResultBefore
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
Description copied from interface:BuildResultsSummaryDao
Finds the last successful or failedResultsSummary
before buildNumber- Specified by:
findLastResultBefore
in interfaceBuildResultsSummaryDao
includeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations- Returns:
- buildResult
-
findLastBuildResultBeforeWithTests
public <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
- Specified by:
findLastBuildResultBeforeWithTests
in interfaceBuildResultsSummaryDao
- Type Parameters:
T
- of result- Parameters:
planResultKey
- of the resultaClass
- ofincludeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations- Returns:
- resultsSummary
-
findFirstBuildResultWithBuildStateAfter
public ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState)
Description copied from interface:BuildResultsSummaryDao
Finds the last successfulBuildResultsSummary
after buildNumber- Specified by:
findFirstBuildResultWithBuildStateAfter
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
findLastBuildResultWithBuildStateBefore
public ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds)
Description copied from interface:BuildResultsSummaryDao
Finds the lastBuildResultsSummary
before buildNumber withBuildState
- Specified by:
findLastBuildResultWithBuildStateBefore
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
findFirstBuildResultWithBuildStateBetween
@Nullable public @Nullable ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull @NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
Description copied from interface:BuildResultsSummaryDao
Returns the first build that matchesBuildState
between the given build number range Note that this function is inclusive of the upper and lower bound- Specified by:
findFirstBuildResultWithBuildStateBetween
in interfaceBuildResultsSummaryDao
- Returns:
- buildResult
-
scrollResultSummaries
public long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull ResultDataRead dataRead, @NotNull @NotNull Consumer<ResultsSummary> consumer)
Description copied from interface:BuildResultsSummaryDao
Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Specified by:
scrollResultSummaries
in interfaceBuildResultsSummaryDao
- Parameters:
buildKey
- of the plan you want to scroll the result summaries fordataRead
- if the data should be loaded lazy or eagerlyconsumer
- consumer to accept each of the BuildResultSummaries- Returns:
- number of traversed rows
-
getChainStageResultById
public ChainStageResult getChainStageResultById(long id)
Description copied from interface:BuildResultsSummaryDao
Returns aChainStageResult
by its id- Specified by:
getChainStageResultById
in interfaceBuildResultsSummaryDao
- Returns:
- chainStageResult
-
getAllResultSummariesForPlan
public <T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull @NotNull Plan plan)
Description copied from interface:BuildResultsSummaryDao
Get all theResultsSummary
s for the givenPlan
- Specified by:
getAllResultSummariesForPlan
in interfaceBuildResultsSummaryDao
- Returns:
- summaries
-
getResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
Description copied from interface:BuildResultsSummaryDao
Get theResultsSummary
s for the givenPlan
. Results are sorted by build number (descending). User can skip first n result and request maximum number of results. Note: fetching huge amount of data in single call should be avoided.- Specified by:
getResultSummariesForPlan
in interfaceBuildResultsSummaryDao
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
-
getResultSummariesForPlanByLifeCycleState
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull @NotNull Plan plan, @NotNull @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
Description copied from interface:BuildResultsSummaryDao
Get theResultsSummary
s for the givenPlan
in giveLifeCycleState
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 interfaceBuildResultsSummaryDao
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
-
getParentResultSummary
@Nullable public @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary summary)
Description copied from interface:BuildResultsSummaryDao
Get (@link ChainResultsSummary} containing givenResultsSummary
- Specified by:
getParentResultSummary
in interfaceBuildResultsSummaryDao
- Returns:
-
getStageForResult
@Nullable public @Nullable ChainStageResult getStageForResult(ResultsSummary summary)
Description copied from interface:BuildResultsSummaryDao
Get (@link ChainStageResult} containing givenResultsSummary
- Specified by:
getStageForResult
in interfaceBuildResultsSummaryDao
- Returns:
-
findLatestResultsSummaries
public List<ResultsSummary> findLatestResultsSummaries()
Description copied from interface:BuildResultsSummaryDao
Find the result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER- Specified by:
findLatestResultsSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- list of latest results summaries
-
findLatestFailedResultSummaries
public List<ResultsSummary> findLatestFailedResultSummaries()
Description copied from interface:BuildResultsSummaryDao
Find the failed result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER- Specified by:
findLatestFailedResultSummaries
in interfaceBuildResultsSummaryDao
- Returns:
- list of latest results summaries
-
findChainResultsWithJobLabelled
public List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria, List<Label> labels)
Description copied from interface:BuildResultsSummaryDao
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
- Specified by:
findChainResultsWithJobLabelled
in interfaceBuildResultsSummaryDao
- Parameters:
queryCriteria
- containing the restrictions for the chains to be returnedlabels
- that the jobs can be associated with- Returns:
- list of ChainResultSummary that match the criteria and have jobs with any of the given labels
-
findLastResultSummaryWithState
public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass)
- Specified by:
findLastResultSummaryWithState
in interfaceBuildResultsSummaryDao
- Returns:
- the last
ResultsSummary
with the providedBuildState
-
findLastResultSummaryWithState
@Nullable public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass, boolean ignoreSpecsResults)
- Specified by:
findLastResultSummaryWithState
in interfaceBuildResultsSummaryDao
- Returns:
- the last
ResultsSummary
with the providedBuildState
-
countResultsWithState
public int countResultsWithState(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
Description copied from interface:BuildResultsSummaryDao
Counts results with a given state in a given build number range for plan.- Specified by:
countResultsWithState
in interfaceBuildResultsSummaryDao
- Parameters:
planKey
- the key of plan to analyselowerBuildNumber
- the build number to start the count withupperBuildNumber
- the build number to end the count withbuildState
- the state that will be counted- Returns:
- the count
-
markResultSummariesForDeletion
public int markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Mass update of allResultsSummary
records in the database related to a Plan identified by planKey.- Specified by:
markResultSummariesForDeletion
in interfaceBuildResultsSummaryDao
- Parameters:
planKey
- key of a plan- Returns:
- number of updated records
-
getPlanKeysSortedByNumberOfFinalizedResultSummaries
@NotNull public @NotNull List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
- Specified by:
getPlanKeysSortedByNumberOfFinalizedResultSummaries
in interfaceBuildResultsSummaryDao
-
calculateQueueDuration
@Nullable public @Nullable Long calculateQueueDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
Description copied from interface:BuildResultsSummaryDao
Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.- Specified by:
calculateQueueDuration
in interfaceBuildResultsSummaryDao
- Parameters:
resultsSummary
-ChainResultsSummary
for which calculation has to be made- Returns:
- queueDuration value or null if there are no related
BuildResultsSummary
records
-
calculateVcsUpdateDuration
@Nullable public @Nullable Long calculateVcsUpdateDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
Description copied from interface:BuildResultsSummaryDao
Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.- Specified by:
calculateVcsUpdateDuration
in interfaceBuildResultsSummaryDao
- Parameters:
resultsSummary
-ChainResultsSummary
for which calculation has to be made- Returns:
- vcsUpdateDuration value or null if there are no related
BuildResultsSummary
records
-
setResultsSummaryDiscriminatorRegistry
public void setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry)
-
setPlanDiscriminatorRegistry
public void setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
-
findAllBuildResultsNumbers
public List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
- Specified by:
findAllBuildResultsNumbers
in interfaceBuildResultsSummaryDao
-
findBuildResultsNumberRange
@NotNull public @NotNull Range<Integer> findBuildResultsNumberRange(PlanKey planKey)
Description copied from interface:BuildResultsSummaryDao
Finds minimum and maximum build number for a plan. Works for both chains and jobs.- Specified by:
findBuildResultsNumberRange
in interfaceBuildResultsSummaryDao
- Returns:
- (min, max) pair or (0,0) if there are no results.
-
findChainResultsWithFormatVersionLessThan
@NotNull public @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
- Specified by:
findChainResultsWithFormatVersionLessThan
in interfaceBuildResultsSummaryDao
-
findSpecsStatesIdsReferencedByBuildResultSummaries
@NotNull public @NotNull Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
Description copied from interface:BuildResultsSummaryDao
Finds all specs states ids that are referenced by any build result summary- Specified by:
findSpecsStatesIdsReferencedByBuildResultSummaries
in interfaceBuildResultsSummaryDao
-
findMinimumBuildNumberForNLatest
public int findMinimumBuildNumberForNLatest(@NotNull @NotNull PlanKey planKey, int n)
Description copied from interface:BuildResultsSummaryDao
Find a build number for which exist n non-specs results with a build number greater or equal. If the build has less that n such results, the lowest build number is returned.- Specified by:
findMinimumBuildNumberForNLatest
in interfaceBuildResultsSummaryDao
-
-