public class BuildResultsSummaryHibernateDao extends BambooHibernateObjectDao<ResultsSummary> implements BuildResultsSummaryDao
| Modifier and Type | Field and 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 |
NUMBER_OF_DAYS_TO_FILTER| Constructor and Description |
|---|
BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate) |
| Modifier and Type | Method and Description |
|---|---|
Long |
calculateQueueDuration(ChainResultsSummary resultsSummary)
Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.
|
Long |
calculateVcsUpdateDuration(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(String planKey) |
long |
countResultSummaries(ResultsSummaryCriteria criteria)
Count the number of
ResultsSummary objects given a ResultsSummaryCriteria. |
int |
countResultsWithState(PlanKey planKey,
int lowerBuildNumber,
int upperBuildNumber,
BuildState buildState)
Counts results with a given state in a given build number range for plan.
|
List<Integer> |
findAllBuildResultsNumbers(PlanKey planKey) |
<T extends ResultsSummary> |
findAnyResultSummary(ResultsSummaryCriteria criteria,
ResultDataRead dataRead)
Searches for any
ResultsSummary object given a ResultsSummaryCriteria. |
Range<Integer> |
findBuildResultsNumberRange(PlanKey planKey)
Finds minimum and maximum build number for a plan.
|
List<ResultsSummary> |
findBuildResultsSummariesByJiraIssues(List<String> issueKeys)
Get a list of results summaries associated with the list of issue keys.
|
List<ResultsSummary> |
findBuildResultsSummariesByProjectKey(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.
|
List<BuildResultsSummary> |
findBuildsForImageConfiguration(String planKey,
ElasticImageConfiguration elasticImage,
BuildState buildState,
int maxResults)
Searcher for builds of an image
|
<E extends ResultsSummary> |
findById(long id,
Class<E> aClass)
Find an entity by its id
|
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(String planKey,
int buildNumber)
Returns the build number of next existing build results.
|
ResultsSummary |
findFirstBuildResultWithBuildStateAfter(String planKey,
int buildNumber,
BuildState buildState)
Finds the last successful
BuildResultsSummary after buildNumber |
ResultsSummary |
findFirstBuildResultWithBuildStateBetween(String planKey,
int lowerBuildNumber,
int upperBuildNumber,
BuildState buildState)
Returns the first build that matches
BuildState between the given build number range
Note that this function is inclusive of the upper and lower bound |
<T extends ResultsSummary> |
findFirstResultAfter(String planKey,
int buildNumber,
Class<T> aClass)
Finds the first successful or failed
BuildResultsSummary after buildNumber |
List<PlanKey> |
findJobKeysFromExistingChainResults(PlanKey chainKey)
Find keys of jobs for which results associated with given plan exist.
|
Integer |
findLastBuildNumberBefore(String planKey,
int buildNumber)
Returns the build number of previous existing build results.
|
<T extends ResultsSummary> |
findLastBuildResultBeforeWithTests(PlanResultKey planResultKey,
Class<T> aClass,
boolean includeOnceOffBuilds) |
ResultsSummary |
findLastBuildResultWithBuildStateBefore(String planKey,
int buildNumber,
BuildState buildState,
boolean includeOnceOffBuilds)
Finds the last
BuildResultsSummary before buildNumber with BuildState |
<T extends ResultsSummary> |
findLastResultBefore(String planKey,
int buildNumber,
Class<T> aClass,
boolean includeOnceOffBuilds)
Finds the last successful or failed
ResultsSummary before buildNumber |
<T extends ResultsSummary> |
findLastResultSummaryWithState(PlanKey planKey,
BuildState buildState,
Class<T> aClass) |
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_FILTER
|
List<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_FILTER
|
int |
findMinimumBuildNumberForNLatest(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 the
ChainResultsSummary objects in the database that do not have a matching Chain |
<T extends ResultsSummary> |
findResultsSummaries(ResultsSummaryCriteria criteria)
Searches for
ResultsSummary objects given a ResultsSummaryCriteria. |
<T extends ResultsSummary> |
findResultSummariesForExpiry(ExpiryCriteria expiryCriteria)
Searches for
ResultsSummary objects given a ExpiryCriteria. |
Set<Long> |
findSpecsStatesIdsReferencedByBuildResultSummaries()
Finds all specs states ids that are referenced by any build result summary
|
List<ResultsSummary> |
getAfterSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns build results strictly after given build number.
|
<T extends ResultsSummary> |
getAllActiveResultSummariesForPlan(PlanKey planKey,
Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.PENDING, LifeCycleState.QUEUED, LifeCycleState.IN_PROGRESS state with the given Class
See also LifeCycleState.isActive(LifeCycleState) and ImmutableResultsSummary.isActive() |
<T extends ResultsSummary> |
getAllBuildResultSummariesInBuildState(BuildState state,
Class<T> aClass)
Returns all the
BuildResultsSummary in requested build state. |
<T extends ResultsSummary> |
getAllBuildResultSummariesInLifeCycleState(LifeCycleState state,
Class<T> aClass)
Returns all the
BuildResultsSummary in requested lifecycle state. |
<T extends ResultsSummary> |
getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all the
BuildResultsSummary in a BuildState.UNKNOWN
state
This will not return records marked for deletion. |
Collection<BuildResultsSummary> |
getAllInProgressBuildResultSummaries()
Returns all the
BuildResultsSummary in a LifeCycleState.IN_PROGRESS state
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllInProgressResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.IN_PROGRESS state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllPendingResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.PENDING state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllQueuedResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.QUEUED state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllResultSummariesForPlan(Plan plan)
Get all the
ResultsSummarys for the given Plan |
List<ResultsSummary> |
getBeforeSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns build results strictly before given build number.
|
ResultsSummary |
getBreakingBuild(ResultsSummary summary) |
ChainStageResult |
getChainStageResultById(long id)
Returns a
ChainStageResult by its id |
<T extends ResultsSummary> |
getFinalizedResultSummariesForPlan(PlanKey planKey,
Class<T> aClass,
int firstResult,
int maxResults)
Returns all the
ResultsSummary in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state with the given Class. |
BuildResultsSummary |
getFirstBuildSummary(PlanKey planKey)
Returns the first available
BuildResultsSummary for the given PlanKey |
ResultsSummary |
getFixingBuild(ResultsSummary summary)
Returns the first successful
BuildResultsSummary for given BuildResultsSummary. |
List<LinkedJiraIssue> |
getJiraIssuesForBuildResults(List<ResultsSummary> buildResults)
Retrieves a list of
LinkedJiraIssue linked to the given build result summaries |
List<LinkedJiraIssue> |
getJiraIssuesForPlanKey(PlanKey planKey)
Retrieves a list of
LinkedJiraIssue that are linked to the given build. |
<T extends ResultsSummary> |
getLastResultSummary(String planKey,
Class<T> aClass)
Returns the latest completed
ResultsSummary for the plan represented by planKey |
List<ResultsSummary> |
getNeighbouringSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns build results "around" given build number.
|
List<ResultsSummary> |
getNeighbouringSummaries(Plan plan,
int currentBuildNumber)
Returns build results "around" given build number
|
int |
getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Get the number of concurrently running builds for planKey
|
long |
getNumberOfFinalizedResults(ImmutablePlan plan)
|
long |
getNumberOfFinalizedResults(PlanKey planKey)
Get number of the
ResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan |
long |
getNumberOfFinishedResults(Plan plan)
Returns the number of finished results available for the given
Plan |
ChainResultsSummary |
getParentResultSummary(ResultsSummary summary)
Get (@link ChainResultsSummary} containing given
ResultsSummary |
List<PlanKey> |
getPlanKeysSortedByNumberOfFinalizedResultSummaries() |
<T extends ResultsSummary> |
getResultsSummary(PlanResultKey planResultKey,
Class<T> aClass)
Lookup
ResultsSummary by PlanResultKey and expected type |
<T extends ResultsSummary> |
getResultsSummary(PlanResultKey planResultKey,
Class<T> aClass,
ResultDataRead dataRead)
Lookup
ResultsSummary by PlanResultKey and expected type, all lazy initialized collections can be eagerly read |
Long |
getResultsSummaryId(PlanResultKey planResultKey)
Return
ResultsSummary's database id. |
<T extends ResultsSummary> |
getResultSummariesByChangeSetId(String changeSetId,
Class<T> discriminator)
Get a list of all build results containing a commit with the given changeset ID.
|
<T extends ResultsSummary> |
getResultSummariesByChangeSetIdAndRepository(long repositoryId,
String changeSetId,
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> |
getResultSummariesByChangeSetIds(List<String> changeSetIds,
Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs.
|
<T extends ResultsSummary> |
getResultSummariesByCheckoutChangesetId(String changesetId,
Class<T> discriminator)
Get a list of all build results containing repositories checked out with the given changeset ID.
|
<T extends ResultsSummary> |
getResultSummariesForPlan(ImmutablePlan plan,
int firstResult,
int maxResults)
Get the
ResultsSummarys for the given Plan. |
<T extends ResultsSummary> |
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 summary)
Get (@link ChainStageResult} containing given
ResultsSummary |
int |
markResultSummariesForDeletion(PlanKey planKey)
Mass update of all
ResultsSummary records in the database related to a Plan identified by planKey. |
int |
moveResultSummaries(PlanKey oldPlanKey,
PlanKey newPlanKey)
Reassigns plan key ResultsSummaries associated with selected plan key.
|
int |
removeResultsSummariesForPlan(PlanKey planKey)
Remove all resultSummary objects for the given plan.
|
void |
removeResultsSummary(ResultsSummary resultsSummary)
Removes the passed result summary
|
long |
scrollResultSummaries(String buildKey,
ResultDataRead dataRead,
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(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) |
countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, merge, save, saveAllgetCacheAwareHibernateTemplatecheckDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcountAll, countWithRestriction, delete, deleteAll, findAll, merge, save, saveAllprotected static final String CREATION_DATE
protected static final String BUILD_COMPLETED_DATE
protected static final String BUILD_AGENT_ID
protected static final String BUILD_NUMBER
protected static final String PLAN_KEY
protected static final String BUILD_STATE
protected static final String LIFE_CYCLE_STATE
protected static final String DELTA_STATE
protected static final String CONTINUABLE
public static final int NEIGHBOURING_SUMMARIES_MAX_COUNT
public BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
public Long getResultsSummaryId(@NotNull PlanResultKey planResultKey)
BuildResultsSummaryDaoResultsSummary's database id.
This method is intended for internal use (currently in importer)getResultsSummaryId in interface BuildResultsSummaryDaoplanResultKey - plan result key of ResultsSummary to be foundResultsSummary or null if not found@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass)
BuildResultsSummaryDaoResultsSummary by PlanResultKey and expected typegetResultsSummary in interface BuildResultsSummaryDao@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead)
BuildResultsSummaryDaoResultsSummary by PlanResultKey and expected type, all lazy initialized collections can be eagerly readgetResultsSummary in interface BuildResultsSummaryDaopublic <E extends ResultsSummary> E findById(long id, @NotNull Class<E> aClass)
BambooObjectDaofindById in interface BambooObjectDao<ResultsSummary>findById in class BambooHibernateObjectDao<ResultsSummary>id - id of entityaClass - class of entity@NotNull public <T extends ResultsSummary> Collection<T> getAllBuildResultSummariesInBuildState(@NotNull BuildState state, @NotNull Class<T> aClass)
BuildResultsSummaryDaoBuildResultsSummary in requested build state.
This will not return records marked for deletion.getAllBuildResultSummariesInBuildState in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull LifeCycleState state, @NotNull Class<T> aClass)
BuildResultsSummaryDaoBuildResultsSummary in requested lifecycle state.
This will not return records marked for deletion.getAllBuildResultSummariesInLifeCycleState in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
BuildResultsSummaryDaoBuildResultsSummary in a BuildState.UNKNOWN
state
This will not return records marked for deletion.getAllBuildResultSummariesInUnknownState in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllPendingResultSummaries(Class<T> aClass)
BuildResultsSummaryDaoResultsSummary in a LifeCycleState.PENDING state with the given Class
This will not return records marked for deletion.getAllPendingResultSummaries in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
BuildResultsSummaryDaoResultsSummary in a LifeCycleState.QUEUED state with the given Class
This will not return records marked for deletion.getAllQueuedResultSummaries in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
BuildResultsSummaryDaoResultsSummary in a LifeCycleState.IN_PROGRESS state with the given Class
This will not return records marked for deletion.getAllInProgressResultSummaries in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
BuildResultsSummaryDaoResultsSummary in a LifeCycleState.PENDING, LifeCycleState.QUEUED, LifeCycleState.IN_PROGRESS state with the given Class
See also LifeCycleState.isActive(LifeCycleState) and ImmutableResultsSummary.isActive()getAllActiveResultSummariesForPlan in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
BuildResultsSummaryDaoResultsSummary in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state with the given Class.
Result are sorted descending by build number.getFinalizedResultSummariesForPlan in interface BuildResultsSummaryDaofirstResult - - specifies the first result to be included in the list.maxResults - - specifies the length of the result; 0 for all results;public int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
BuildResultsSummaryDaogetNumberOfConcurrentlyRunningBuilds in interface BuildResultsSummaryDao@NotNull public Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
BuildResultsSummaryDaoBuildResultsSummary in a LifeCycleState.IN_PROGRESS state
This will not return records marked for deletion.getAllInProgressBuildResultSummaries in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> T findAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
BuildResultsSummaryDaoResultsSummary object given a ResultsSummaryCriteria.
Note that if criteria does not specify order then result of this method might be non-deterministic.findAnyResultSummary in interface BuildResultsSummaryDaoList of BuildResultsSummary@NotNull public <T extends ResultsSummary> List<T> findResultsSummaries(@NotNull ResultsSummaryCriteria criteria)
BuildResultsSummaryDaoResultsSummary objects given a ResultsSummaryCriteria.
Note that if criteria does not specify maxResults property, a hard cap of 10000 results is applied to search operation.findResultsSummaries in interface BuildResultsSummaryDaoList of BuildResultsSummarypublic int moveResultSummaries(@NotNull
PlanKey oldPlanKey,
@NotNull
PlanKey newPlanKey)
BuildResultsSummaryDaomoveResultSummaries in interface BuildResultsSummaryDaooldPlanKey - the plan key to move fromnewPlanKey - the plan key to move topublic long countResultSummaries(@NotNull
ResultsSummaryCriteria criteria)
BuildResultsSummaryDaoResultsSummary objects given a ResultsSummaryCriteria.countResultSummaries in interface BuildResultsSummaryDaoResultsSummary that match the criteria.@NotNull public <T extends ResultsSummary> List<T> findResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria)
BuildResultsSummaryDaoResultsSummary objects given a ExpiryCriteria.findResultSummariesForExpiry in interface BuildResultsSummaryDaoT - type of result objects (determined according to given criteria)expiryCriteria - search constraintsList of ResultsSummary@NotNull public List<PlanKey> findJobKeysFromExistingChainResults(@NotNull PlanKey chainKey)
BuildResultsSummaryDaofindJobKeysFromExistingChainResults in interface BuildResultsSummaryDaopublic int removeResultsSummariesForPlan(@NotNull
PlanKey planKey)
BuildResultsSummaryDaoResultsSummary objects to be deletedremoveResultsSummariesForPlan in interface BuildResultsSummaryDaoplanKey - identifier of plan to remove results for.ResultsSummary objectspublic Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
BuildResultsSummaryDaoChainResultsSummary objects in the database that do not have a matching ChainfindPlanKeysFromAllOrphanedResultSummaries in interface BuildResultsSummaryDaoPlanKeys they referencepublic int countBuildResultsSummaries(@NotNull
String planKey)
countBuildResultsSummaries in interface BuildResultsSummaryDaopublic int countBuildResultsSummaries()
BuildResultsSummaryDaocountBuildResultsSummaries in interface BuildResultsSummaryDao@NotNull public List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImage, @Nullable BuildState buildState, int maxResults)
BuildResultsSummaryDaofindBuildsForImageConfiguration in interface BuildResultsSummaryDaopublic List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
BuildResultsSummaryDaofindBuildResultsWithArtifacts in interface BuildResultsSummaryDaopublic <T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull String changeSetId, @NotNull Class<T> discriminator)
BuildResultsSummaryDaoGet 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).
getResultSummariesByChangeSetId in interface BuildResultsSummaryDaochangeSetId - of the commitdiscriminator - class of the ResultSummary interface requiredpublic <T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull String changesetId, @NotNull Class<T> discriminator)
BuildResultsSummaryDaoGet 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).
getResultSummariesByCheckoutChangesetId in interface BuildResultsSummaryDaochangesetId - of the commitdiscriminator - class of the ResultSummary interface requiredchangesetId commitpublic <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull String changeSetId, @NotNull Class<T> discriminator)
BuildResultsSummaryDaogetResultSummariesByChangeSetIdAndRepository in interface BuildResultsSummaryDaoT - extends ResultSummaryrepositoryId - of the repositorychangeSetId - of the commitdiscriminator - class of the ResultSummary interface requiredpublic <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, @NotNull Class<T> discriminator)
BuildResultsSummaryDaogetResultSummariesByChangeSetIds in interface BuildResultsSummaryDaochangeSetIds - of the commitsdiscriminator - class of the ResultSummary interface required@NotNull public List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)
BuildResultsSummaryDaofindBuildResultsSummariesByJiraIssues in interface BuildResultsSummaryDao@NotNull public List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable String jiraProjectKey)
BuildResultsSummaryDaofindBuildResultsSummariesByProjectKey in interface BuildResultsSummaryDaojiraProjectKey - - JIRA project key (prefix of the jira issues e.g. 'BAM')public void removeResultsSummary(@NotNull
ResultsSummary resultsSummary)
BuildResultsSummaryDaoremoveResultsSummary in interface BuildResultsSummaryDaoresultsSummary - -public BuildResultsSummary getFirstBuildSummary(@NotNull PlanKey planKey)
BuildResultsSummaryDaoBuildResultsSummary for the given PlanKeygetFirstBuildSummary in interface BuildResultsSummaryDaopublic <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
BuildResultsSummaryDaoResultsSummary for the plan represented by planKeygetLastResultSummary in interface BuildResultsSummaryDaopublic Integer findFirstBuildNumberAfter(@NotNull String planKey, int buildNumber)
BuildResultsSummaryDaofindFirstBuildNumberAfter in interface BuildResultsSummaryDaopublic Integer findLastBuildNumberBefore(@NotNull String planKey, int buildNumber)
BuildResultsSummaryDaofindLastBuildNumberBefore in interface BuildResultsSummaryDaopublic long getNumberOfFinishedResults(Plan plan)
BuildResultsSummaryDaoPlangetNumberOfFinishedResults in interface BuildResultsSummaryDaopublic long getNumberOfFinalizedResults(@NotNull
ImmutablePlan plan)
getNumberOfFinalizedResults in interface BuildResultsSummaryDaoplan - public long getNumberOfFinalizedResults(@NotNull
PlanKey planKey)
BuildResultsSummaryDaoResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given PlangetNumberOfFinalizedResults in interface BuildResultsSummaryDao@NotNull public List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
BuildResultsSummaryDaogetNeighbouringSummaries in interface BuildResultsSummaryDao@NotNull public List<ResultsSummary> getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDaogetNeighbouringSummaries in interface BuildResultsSummaryDaoplan - the plan to return results forbuildNumber - the build number to search aroundmaxCount - the maximum number of builds to returnmaxCount items in the list, inclusive of
the result for buildNumber (if present).@NotNull public List<ResultsSummary> getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDaogetBeforeSummaries in interface BuildResultsSummaryDaoplan - the plan to return results forbuildNumber - the build number to search beforemaxCount - the maximum number of builds to returnmaxCount items in the list,
exclusive of the result for buildNumber (if present).@NotNull public List<ResultsSummary> getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDaogetAfterSummaries in interface BuildResultsSummaryDaoplan - the plan to return results forbuildNumber - the build number to search aftermaxCount - the maximum number of builds to returnmaxCount items in the list, exclusive of
the result for buildNumber (if present).@Nullable public ResultsSummary getBreakingBuild(ResultsSummary summary)
getBreakingBuild in interface BuildResultsSummaryDao@Nullable public ResultsSummary getFixingBuild(ResultsSummary summary)
BuildResultsSummaryDaoBuildResultsSummary for given BuildResultsSummary.
The input build is returned if it is successful.getFixingBuild in interface BuildResultsSummaryDao@NotNull public List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull List<ResultsSummary> buildResults)
BuildResultsSummaryDaoLinkedJiraIssue linked to the given build result summariesgetJiraIssuesForBuildResults in interface BuildResultsSummaryDao@NotNull public List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull PlanKey planKey)
BuildResultsSummaryDaoLinkedJiraIssue that are linked to the given build.getJiraIssuesForPlanKey in interface BuildResultsSummaryDaopublic long scrollVariableSubstitutionForExport(@NotNull
Consumer<VariableSubstitution> consumer)
BuildResultsSummaryDaoscrollVariableSubstitutionForExport in interface BuildResultsSummaryDaoconsumer - consumer to accept each of the VariableSubstitution@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull String planKey, int buildNumber, Class<T> aClass)
BuildResultsSummaryDaoBuildResultsSummary after buildNumberfindFirstResultAfter in interface BuildResultsSummaryDao@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
BuildResultsSummaryDaoResultsSummary before buildNumberfindLastResultBefore in interface BuildResultsSummaryDaoincludeOnceOffBuilds - tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculationspublic <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
findLastBuildResultBeforeWithTests in interface BuildResultsSummaryDaoT - of resultplanResultKey - of the resultaClass - ofincludeOnceOffBuilds - tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculationspublic ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState)
BuildResultsSummaryDaoBuildResultsSummary after buildNumberfindFirstBuildResultWithBuildStateAfter in interface BuildResultsSummaryDaopublic ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState, boolean includeOnceOffBuilds)
BuildResultsSummaryDaoBuildResultsSummary before buildNumber with BuildStatefindLastBuildResultWithBuildStateBefore in interface BuildResultsSummaryDao@Nullable public ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)
BuildResultsSummaryDaoBuildState between the given build number range
Note that this function is inclusive of the upper and lower boundfindFirstBuildResultWithBuildStateBetween in interface BuildResultsSummaryDaopublic long scrollResultSummaries(@NotNull
String buildKey,
@NotNull
ResultDataRead dataRead,
@NotNull
Consumer<ResultsSummary> consumer)
BuildResultsSummaryDaoscrollResultSummaries in interface BuildResultsSummaryDaobuildKey - 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 BuildResultSummariespublic ChainStageResult getChainStageResultById(long id)
BuildResultsSummaryDaoChainStageResult by its idgetChainStageResultById in interface BuildResultsSummaryDaopublic <T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull Plan plan)
BuildResultsSummaryDaoResultsSummarys for the given PlangetAllResultSummariesForPlan in interface BuildResultsSummaryDao@NotNull public <T extends ResultsSummary> List<T> getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)
BuildResultsSummaryDaoResultsSummarys for the given Plan. 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.getResultSummariesForPlan in interface BuildResultsSummaryDaofirstResult - 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.@NotNull public <T extends ResultsSummary> List<T> getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
BuildResultsSummaryDaoResultsSummarys 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.getResultSummariesForPlanByLifeCycleState in interface BuildResultsSummaryDaofirstResult - 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.@Nullable public ChainResultsSummary getParentResultSummary(ResultsSummary summary)
BuildResultsSummaryDaoResultsSummarygetParentResultSummary in interface BuildResultsSummaryDao@Nullable public ChainStageResult getStageForResult(ResultsSummary summary)
BuildResultsSummaryDaoResultsSummarygetStageForResult in interface BuildResultsSummaryDaopublic List<ResultsSummary> findLatestResultsSummaries()
BuildResultsSummaryDaofindLatestResultsSummaries in interface BuildResultsSummaryDaopublic List<ResultsSummary> findLatestFailedResultSummaries()
BuildResultsSummaryDaofindLatestFailedResultSummaries in interface BuildResultsSummaryDaopublic List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria, List<Label> labels)
BuildResultsSummaryDaofindChainResultsWithJobLabelled in interface BuildResultsSummaryDaoqueryCriteria - containing the restrictions for the chains to be returnedlabels - that the jobs can be associated withpublic <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass)
findLastResultSummaryWithState in interface BuildResultsSummaryDaoResultsSummary with the provided BuildStatepublic int countResultsWithState(@NotNull
PlanKey planKey,
int lowerBuildNumber,
int upperBuildNumber,
@NotNull
BuildState buildState)
BuildResultsSummaryDaocountResultsWithState in interface BuildResultsSummaryDaoplanKey - 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 countedpublic int markResultSummariesForDeletion(@NotNull
PlanKey planKey)
BuildResultsSummaryDaoResultsSummary records in the database related to a Plan identified by planKey.markResultSummariesForDeletion in interface BuildResultsSummaryDaoplanKey - key of a plan@NotNull public List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
getPlanKeysSortedByNumberOfFinalizedResultSummaries in interface BuildResultsSummaryDao@Nullable public Long calculateQueueDuration(@NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDaocalculateQueueDuration in interface BuildResultsSummaryDaoresultsSummary - ChainResultsSummary for which calculation has to be madeBuildResultsSummary records@Nullable public Long calculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDaocalculateVcsUpdateDuration in interface BuildResultsSummaryDaoresultsSummary - ChainResultsSummary for which calculation has to be madeBuildResultsSummary recordspublic void setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry)
public void setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
public List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
findAllBuildResultsNumbers in interface BuildResultsSummaryDao@NotNull public Range<Integer> findBuildResultsNumberRange(PlanKey planKey)
BuildResultsSummaryDaofindBuildResultsNumberRange in interface BuildResultsSummaryDao@NotNull public List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
findChainResultsWithFormatVersionLessThan in interface BuildResultsSummaryDao@NotNull public Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
BuildResultsSummaryDaofindSpecsStatesIdsReferencedByBuildResultSummaries in interface BuildResultsSummaryDaopublic int findMinimumBuildNumberForNLatest(@NotNull
PlanKey planKey,
int n)
BuildResultsSummaryDaofindMinimumBuildNumberForNLatest in interface BuildResultsSummaryDaoCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.