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
|
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 . |
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
ResultsSummary s 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
ResultsSummary s 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
ResultsSummary s for the given Plan . |
<T extends ResultsSummary> |
getResultSummariesForPlanByLifeCycleState(Plan plan,
LifeCycleState lifeCycleState,
int firstResult,
int maxResults)
Get the
ResultsSummary s 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, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countAll, countWithRestriction, delete, deleteAll, findAll, merge, save, saveAll
protected 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)
BuildResultsSummaryDao
ResultsSummary
's database id.
This method is intended for internal use (currently in importer)getResultsSummaryId
in interface BuildResultsSummaryDao
planResultKey
- 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)
BuildResultsSummaryDao
ResultsSummary
by PlanResultKey
and expected typegetResultsSummary
in interface BuildResultsSummaryDao
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead)
BuildResultsSummaryDao
ResultsSummary
by PlanResultKey
and expected type, all lazy initialized collections can be eagerly readgetResultsSummary
in interface BuildResultsSummaryDao
public <E extends ResultsSummary> E findById(long id, @NotNull Class<E> aClass)
BambooObjectDao
findById
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)
BuildResultsSummaryDao
BuildResultsSummary
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)
BuildResultsSummaryDao
BuildResultsSummary
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)
BuildResultsSummaryDao
BuildResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state with the given Class
.
Result are sorted descending by build number.getFinalizedResultSummariesForPlan
in interface BuildResultsSummaryDao
firstResult
- - 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)
BuildResultsSummaryDao
getNumberOfConcurrentlyRunningBuilds
in interface BuildResultsSummaryDao
@NotNull public Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
BuildResultsSummaryDao
BuildResultsSummary
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)
BuildResultsSummaryDao
ResultsSummary
object given a ResultsSummaryCriteria
.
Note that if criteria does not specify order then result of this method might be non-deterministic.findAnyResultSummary
in interface BuildResultsSummaryDao
List
of BuildResultsSummary
@NotNull public <T extends ResultsSummary> List<T> findResultsSummaries(@NotNull ResultsSummaryCriteria criteria)
BuildResultsSummaryDao
ResultsSummary
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 BuildResultsSummaryDao
List
of BuildResultsSummary
public int moveResultSummaries(@NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey)
BuildResultsSummaryDao
moveResultSummaries
in interface BuildResultsSummaryDao
oldPlanKey
- the plan key to move fromnewPlanKey
- the plan key to move topublic long countResultSummaries(@NotNull ResultsSummaryCriteria criteria)
BuildResultsSummaryDao
ResultsSummary
objects given a ResultsSummaryCriteria
.countResultSummaries
in interface BuildResultsSummaryDao
ResultsSummary
that match the criteria.@NotNull public <T extends ResultsSummary> List<T> findResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria)
BuildResultsSummaryDao
ResultsSummary
objects given a ExpiryCriteria
.findResultSummariesForExpiry
in interface BuildResultsSummaryDao
T
- type of result objects (determined according to given criteria)expiryCriteria
- search constraintsList
of ResultsSummary
@NotNull public List<PlanKey> findJobKeysFromExistingChainResults(@NotNull PlanKey chainKey)
BuildResultsSummaryDao
findJobKeysFromExistingChainResults
in interface BuildResultsSummaryDao
public int removeResultsSummariesForPlan(@NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
objects to be deletedremoveResultsSummariesForPlan
in interface BuildResultsSummaryDao
planKey
- identifier of plan to remove results for.ResultsSummary
objectspublic Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
BuildResultsSummaryDao
ChainResultsSummary
objects in the database that do not have a matching Chain
findPlanKeysFromAllOrphanedResultSummaries
in interface BuildResultsSummaryDao
PlanKey
s they referencepublic int countBuildResultsSummaries(@NotNull String planKey)
countBuildResultsSummaries
in interface BuildResultsSummaryDao
public int countBuildResultsSummaries()
BuildResultsSummaryDao
countBuildResultsSummaries
in interface BuildResultsSummaryDao
@NotNull public List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImage, @Nullable BuildState buildState, int maxResults)
BuildResultsSummaryDao
findBuildsForImageConfiguration
in interface BuildResultsSummaryDao
public List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
BuildResultsSummaryDao
findBuildResultsWithArtifacts
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull String changeSetId, @NotNull Class<T> discriminator)
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)
.
getResultSummariesByChangeSetId
in interface BuildResultsSummaryDao
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface requiredpublic <T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull String changesetId, @NotNull Class<T> discriminator)
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)
.
getResultSummariesByCheckoutChangesetId
in interface BuildResultsSummaryDao
changesetId
- 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)
BuildResultsSummaryDao
getResultSummariesByChangeSetIdAndRepository
in interface BuildResultsSummaryDao
T
- 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)
BuildResultsSummaryDao
getResultSummariesByChangeSetIds
in interface BuildResultsSummaryDao
changeSetIds
- of the commitsdiscriminator
- class of the ResultSummary interface required@NotNull public List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)
BuildResultsSummaryDao
findBuildResultsSummariesByJiraIssues
in interface BuildResultsSummaryDao
@NotNull public List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable String jiraProjectKey)
BuildResultsSummaryDao
findBuildResultsSummariesByProjectKey
in interface BuildResultsSummaryDao
jiraProjectKey
- - JIRA project key (prefix of the jira issues e.g. 'BAM')public void removeResultsSummary(@NotNull ResultsSummary resultsSummary)
BuildResultsSummaryDao
removeResultsSummary
in interface BuildResultsSummaryDao
resultsSummary
- -public BuildResultsSummary getFirstBuildSummary(@NotNull PlanKey planKey)
BuildResultsSummaryDao
BuildResultsSummary
for the given PlanKey
getFirstBuildSummary
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
for the plan represented by planKeygetLastResultSummary
in interface BuildResultsSummaryDao
public Integer findFirstBuildNumberAfter(@NotNull String planKey, int buildNumber)
BuildResultsSummaryDao
findFirstBuildNumberAfter
in interface BuildResultsSummaryDao
public Integer findLastBuildNumberBefore(@NotNull String planKey, int buildNumber)
BuildResultsSummaryDao
findLastBuildNumberBefore
in interface BuildResultsSummaryDao
public long getNumberOfFinishedResults(Plan plan)
BuildResultsSummaryDao
Plan
getNumberOfFinishedResults
in interface BuildResultsSummaryDao
public long getNumberOfFinalizedResults(@NotNull ImmutablePlan plan)
getNumberOfFinalizedResults
in interface BuildResultsSummaryDao
plan
- public long getNumberOfFinalizedResults(@NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
s in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state for the given Plan
getNumberOfFinalizedResults
in interface BuildResultsSummaryDao
@NotNull public List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
@NotNull public List<ResultsSummary> getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
plan
- 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)
BuildResultsSummaryDao
getBeforeSummaries
in interface BuildResultsSummaryDao
plan
- 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)
BuildResultsSummaryDao
getAfterSummaries
in interface BuildResultsSummaryDao
plan
- 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)
BuildResultsSummaryDao
BuildResultsSummary
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)
BuildResultsSummaryDao
LinkedJiraIssue
linked to the given build result summariesgetJiraIssuesForBuildResults
in interface BuildResultsSummaryDao
@NotNull public List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull PlanKey planKey)
BuildResultsSummaryDao
LinkedJiraIssue
that are linked to the given build.getJiraIssuesForPlanKey
in interface BuildResultsSummaryDao
public long scrollVariableSubstitutionForExport(@NotNull Consumer<VariableSubstitution> consumer)
BuildResultsSummaryDao
scrollVariableSubstitutionForExport
in interface BuildResultsSummaryDao
consumer
- consumer to accept each of the VariableSubstitution@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull String planKey, int buildNumber, Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumberfindFirstResultAfter
in interface BuildResultsSummaryDao
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
BuildResultsSummaryDao
ResultsSummary
before buildNumberfindLastResultBefore
in interface BuildResultsSummaryDao
includeOnceOffBuilds
- 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 BuildResultsSummaryDao
T
- 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)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumberfindFirstBuildResultWithBuildStateAfter
in interface BuildResultsSummaryDao
public ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState, boolean includeOnceOffBuilds)
BuildResultsSummaryDao
BuildResultsSummary
before buildNumber with BuildState
findLastBuildResultWithBuildStateBefore
in interface BuildResultsSummaryDao
@Nullable public ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)
BuildResultsSummaryDao
BuildState
between the given build number range
Note that this function is inclusive of the upper and lower boundfindFirstBuildResultWithBuildStateBetween
in interface BuildResultsSummaryDao
public long scrollResultSummaries(@NotNull String buildKey, @NotNull ResultDataRead dataRead, @NotNull Consumer<ResultsSummary> consumer)
BuildResultsSummaryDao
scrollResultSummaries
in interface BuildResultsSummaryDao
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 BuildResultSummariespublic ChainStageResult getChainStageResultById(long id)
BuildResultsSummaryDao
ChainStageResult
by its idgetChainStageResultById
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull Plan plan)
BuildResultsSummaryDao
ResultsSummary
s for the given Plan
getAllResultSummariesForPlan
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> List<T> getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)
BuildResultsSummaryDao
ResultsSummary
s 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 BuildResultsSummaryDao
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.@NotNull public <T extends ResultsSummary> List<T> getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
BuildResultsSummaryDao
ResultsSummary
s 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 BuildResultsSummaryDao
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.@Nullable public ChainResultsSummary getParentResultSummary(ResultsSummary summary)
BuildResultsSummaryDao
ResultsSummary
getParentResultSummary
in interface BuildResultsSummaryDao
@Nullable public ChainStageResult getStageForResult(ResultsSummary summary)
BuildResultsSummaryDao
ResultsSummary
getStageForResult
in interface BuildResultsSummaryDao
public List<ResultsSummary> findLatestResultsSummaries()
BuildResultsSummaryDao
findLatestResultsSummaries
in interface BuildResultsSummaryDao
public List<ResultsSummary> findLatestFailedResultSummaries()
BuildResultsSummaryDao
findLatestFailedResultSummaries
in interface BuildResultsSummaryDao
public List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria, List<Label> labels)
BuildResultsSummaryDao
findChainResultsWithJobLabelled
in interface BuildResultsSummaryDao
queryCriteria
- 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 BuildResultsSummaryDao
ResultsSummary
with the provided BuildState
public int countResultsWithState(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)
BuildResultsSummaryDao
countResultsWithState
in interface BuildResultsSummaryDao
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 countedpublic int markResultSummariesForDeletion(@NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
records in the database related to a Plan identified by planKey.markResultSummariesForDeletion
in interface BuildResultsSummaryDao
planKey
- key of a plan@NotNull public List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
getPlanKeysSortedByNumberOfFinalizedResultSummaries
in interface BuildResultsSummaryDao
@Nullable public Long calculateQueueDuration(@NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDao
calculateQueueDuration
in interface BuildResultsSummaryDao
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
records@Nullable public Long calculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDao
calculateVcsUpdateDuration
in interface BuildResultsSummaryDao
resultsSummary
- 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)
BuildResultsSummaryDao
findBuildResultsNumberRange
in interface BuildResultsSummaryDao
@NotNull public List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
findChainResultsWithFormatVersionLessThan
in interface BuildResultsSummaryDao
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.