|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<ResultsSummary>
com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao
public class BuildResultsSummaryHibernateDao
Field Summary | |
---|---|
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 |
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 class org.springframework.dao.support.DaoSupport |
---|
logger |
Fields inherited from interface com.atlassian.bamboo.resultsummary.BuildResultsSummaryDao |
---|
NUMBER_OF_DAYS_TO_FILTER |
Constructor Summary | |
---|---|
BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
|
Method Summary | ||
---|---|---|
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(long agentId,
BuildState buildState)
Count how many build results match the agent & optional build state. |
|
int |
countBuildResultsSummaries(String planKey)
|
|
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)
|
|
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 |
|
|
findById(long id,
Class<E> aClass)
Find an entity by its id |
|
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 |
|
|
findFirstResultAfter(String planKey,
int buildNumber,
Class<T> aClass)
Finds the first successful or failed BuildResultsSummary after buildNumber |
|
Integer |
findLastBuildNumberBefore(String planKey,
int buildNumber)
Returns the build number of previous existing build results. |
|
|
findLastBuildResultBeforeWithTests(PlanResultKey planResultKey,
Class<T> aClass,
boolean includeOnceOffBuilds)
|
|
ResultsSummary |
findLastBuildResultWithBuildStateBefore(String planKey,
int buildNumber,
BuildState buildState)
Finds the last BuildResultsSummary before buildNumber with BuildState |
|
|
findLastResultBefore(String planKey,
int buildNumber,
Class<T> aClass,
boolean includeOnceOffBuilds)
Finds the last successful or failed ResultsSummary before buildNumber |
|
|
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 ResultsSummary objects in the database that do not have a matching Plan |
|
|
findResultsSummaries(ResultsSummaryCriteria criteria)
Searches for ResultsSummary objects given a ResultsSummaryCriteria . |
|
|
findResultSummariesForExpiry(ExpiryCriteria expiryCriteria)
Searches for ResultsSummary objects given a ExpiryCriteria . |
|
|
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() |
|
|
getAllBuildResultSummariesInBuildState(BuildState state,
Class<T> aClass)
Returns all the BuildResultsSummary in requested build state. |
|
|
getAllBuildResultSummariesInLifeCycleState(LifeCycleState state,
Class<T> aClass)
Returns all the BuildResultsSummary in requested lifecycle state. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
getAllResultSummariesForPlan(Plan plan)
Get all the ResultsSummary s for the given Plan |
|
ResultsSummary |
getBreakingBuild(ResultsSummary summary)
|
|
ChainStageResult |
getChainStageResultById(long id)
Returns a ChainStageResult by its id |
|
|
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(Plan plan)
Returns the first available BuildResultsSummary for the given Plan |
|
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. |
|
|
getLastResultSummary(String planKey,
Class<T> aClass)
Returns the latest completed ResultsSummary for the plan represented by planKey |
|
List<ResultsSummary> |
getNeighbouringSummaries(ImmutablePlan plan,
int currentBuildNumber,
int neighbouringSummariesMaxCount)
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)
Get number of the ResultsSummary s 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()
|
|
|
getResultsSummary(PlanResultKey planResultKey,
Class<T> aClass)
Lookup ResultsSummary by PlanResultKey and expected type |
|
|
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. |
|
|
getResultSummariesByChangeSetId(String changeSetId,
Class<T> discriminator)
Get a list of all build results containing a commit with the given change set ID. |
|
|
getResultSummariesByChangeSetIdAndRepository(long repositoryId,
String changeSetId,
Class<T> discriminator)
Get a list of all build results containing a commit with the given change set ID that are in the given repository. |
|
|
getResultSummariesByChangeSetIds(List<String> changeSetIds,
Class<T> discriminator)
Get a list of all build results containing a commit with any of the given change set IDs. |
|
|
getResultSummariesForPlan(ImmutablePlan plan,
int firstResult,
int maxResults)
Get the ResultsSummary s for the given Plan . |
|
|
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 |
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,
com.google.common.base.Function<ResultsSummary,Void> function)
Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized. |
|
long |
scrollVariableSubstitutionForExport(com.google.common.base.Function<VariableSubstitution,Void> function)
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)
|
|
void |
setTestResultsHibernateDao(TestResultsHibernateDao testResultsHibernateDao)
|
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao |
---|
countAll, countWithRestriction, delete, deleteAll, execute, executeCountQuery, executeReturnInt, executeReturnLong, findAll, save, saveAll |
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport |
---|
getCacheAwareHibernateTemplate |
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
---|
afterPropertiesSet, initDao |
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, executeReturnInt, executeReturnLong, findAll, save, saveAll |
Field Detail |
---|
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
public static final int NEIGHBOURING_SUMMARIES_MAX_COUNT
Constructor Detail |
---|
public BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
Method Detail |
---|
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 found
ResultsSummary
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 type
getResultsSummary
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 read
getResultsSummary
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> 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
criteria
- @NotNull
List
of BuildResultsSummary
@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 constraints
List
of ResultsSummary
public int removeResultsSummariesForPlan(@NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
objects to be deleted
in such case #scheduleResultsSummariesForDelayedDeletion(PlanKey)
should be considered.
removeResultsSummariesForPlan
in interface BuildResultsSummaryDao
planKey
- identifier of plan to remove results for.
ResultsSummary
objectspublic Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
BuildResultsSummaryDao
ResultsSummary
objects in the database that do not have a matching Plan
findPlanKeysFromAllOrphanedResultSummaries
in interface BuildResultsSummaryDao
PlanKey
s they reference ordered by BRS, CRSpublic int countBuildResultsSummaries(long agentId, @Nullable BuildState buildState)
BuildResultsSummaryDao
countBuildResultsSummaries
in interface BuildResultsSummaryDao
buildState
- - can be null.
public 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
buildState
- @Nullable
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
getResultSummariesByChangeSetId
in interface BuildResultsSummaryDao
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required
public <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 required
public <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
- - @NotNull@Nullable public BuildResultsSummary getFirstBuildSummary(@NotNull Plan plan)
BuildResultsSummaryDao
BuildResultsSummary
for the given Plan
getFirstBuildSummary
in interface BuildResultsSummaryDao
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 planKey
getLastResultSummary
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)
ResultsSummary
s or LifeCycleState.NOT_BUILT
state for the given Plan
getNumberOfFinalizedResults
in interface BuildResultsSummaryDao
plan
-
@NotNull public List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
@NotNull public List<ResultsSummary> getNeighbouringSummaries(ImmutablePlan plan, int currentBuildNumber, int neighbouringSummariesMaxCount)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
@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 summaries
getJiraIssuesForBuildResults
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 com.google.common.base.Function<VariableSubstitution,Void> function)
BuildResultsSummaryDao
scrollVariableSubstitutionForExport
in interface BuildResultsSummaryDao
function
- function to be executed on each of the VariableSubstitution
@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull String planKey, int buildNumber, Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumber
findFirstResultAfter
in interface BuildResultsSummaryDao
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
BuildResultsSummaryDao
ResultsSummary
before buildNumber
findLastResultBefore
in interface BuildResultsSummaryDao
includeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations
public <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 calculations
public ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumber
findFirstBuildResultWithBuildStateAfter
in interface BuildResultsSummaryDao
public ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState)
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 bound
findFirstBuildResultWithBuildStateBetween
in interface BuildResultsSummaryDao
public long scrollResultSummaries(@NotNull String buildKey, @NotNull ResultDataRead dataRead, @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
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 eagerlyfunction
- function to be executed on each of the BuildResultSummary
public ChainStageResult getChainStageResultById(long id)
BuildResultsSummaryDao
ChainStageResult
by its id
getChainStageResultById
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 with
public <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 counted
public 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 made
BuildResultsSummary
records@Nullable public Long calculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDao
calculateVcsUpdateDuration
in interface BuildResultsSummaryDao
resultsSummary
- ChainResultsSummary
for which calculation has to be made
BuildResultsSummary
recordspublic void setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry)
public void setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
public void setTestResultsHibernateDao(TestResultsHibernateDao testResultsHibernateDao)
public List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
findAllBuildResultsNumbers
in interface BuildResultsSummaryDao
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |