Class InternalResultsSummaryAccessorImpl
java.lang.Object
com.atlassian.bamboo.resultsummary.accessor.InternalResultsSummaryAccessorImpl
- All Implemented Interfaces:
InternalResultsSummaryAccessor
public class InternalResultsSummaryAccessorImpl
extends Object
implements InternalResultsSummaryAccessor
-
Constructor Summary
ConstructorDescriptionInternalResultsSummaryAccessorImpl
(BuildResultsSummaryDao buildResultsSummaryDao) -
Method Summary
Modifier and TypeMethodDescriptionfindBuildResultNumbersRange
(@NotNull PlanKey planKey) Finds minimum and maximum build number for a plan.long
getAveragePlanExecutionDuration
(@NotNull ImmutablePlan plan, int numberOfResults) Get average duration from n last results summaries in finished state for a plan.<T extends ResultsSummary>
TgetLastResultsSummary
(@NotNull PlanKey planKey, Class<T> aClass) Get the lastResultsSummary
for planKey andClass
<T extends ResultsSummary>
TgetLastResultsSummary
(@NotNull PlanKey planKey, Class<T> aClass, boolean ignoreSpecsResults) Get the lastResultsSummary
for planKey andClass
with possible skip of specs results.@Nullable ResultsSummary
getResultsSummary
(@NotNull PlanResultKey planResultKey) Lookup the ResultsSummary byPlanResultKey
<T extends ResultsSummary>
TgetResultsSummary
(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass) LookupResultsSummary
byPlanResultKey
and expected type<T extends ResultsSummary>
TgetResultsSummary
(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead) Lookup the ResultsSummary byPlanResultKey
.@Nullable ResultsSummary
getResultsSummary
(@NotNull PlanResultKey planResultKey, ResultDataRead dataRead) Lookup the ResultsSummary byPlanResultKey
.
-
Constructor Details
-
InternalResultsSummaryAccessorImpl
-
-
Method Details
-
getLastResultsSummary
@Nullable public <T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull PlanKey planKey, Class<T> aClass) Description copied from interface:InternalResultsSummaryAccessor
Get the lastResultsSummary
for planKey andClass
- Specified by:
getLastResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
-
getLastResultsSummary
@Nullable public <T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull PlanKey planKey, Class<T> aClass, boolean ignoreSpecsResults) Description copied from interface:InternalResultsSummaryAccessor
Get the lastResultsSummary
for planKey andClass
with possible skip of specs results.- Specified by:
getLastResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
-
getResultsSummary
@Nullable public @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:InternalResultsSummaryAccessor
Lookup the ResultsSummary byPlanResultKey
- Specified by:
getResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
- resultsSummary
-
getResultsSummary
@Nullable public @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, ResultDataRead dataRead) Description copied from interface:InternalResultsSummaryAccessor
Lookup the ResultsSummary byPlanResultKey
. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call- Specified by:
getResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
- resultsSummary
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass) Description copied from interface:InternalResultsSummaryAccessor
LookupResultsSummary
byPlanResultKey
and expected type- Specified by:
getResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
- resultSummary
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead) Description copied from interface:InternalResultsSummaryAccessor
Lookup the ResultsSummary byPlanResultKey
. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call- Specified by:
getResultsSummary
in interfaceInternalResultsSummaryAccessor
- Returns:
- resultsSummary
-
getAveragePlanExecutionDuration
public long getAveragePlanExecutionDuration(@NotNull @NotNull ImmutablePlan plan, int numberOfResults) Description copied from interface:InternalResultsSummaryAccessor
Get average duration from n last results summaries in finished state for a plan. Results in SUCCESSFUL state are preferred; only if there are none those in FAILED state are selected.- Specified by:
getAveragePlanExecutionDuration
in interfaceInternalResultsSummaryAccessor
numberOfResults
- amount of results to be taken into account for average calculation- Returns:
- average duration in milliseconds or 0 if there is no results
-
findBuildResultNumbersRange
@NotNull public @NotNull Range<Integer> findBuildResultNumbersRange(@NotNull @NotNull PlanKey planKey) Description copied from interface:InternalResultsSummaryAccessor
Finds minimum and maximum build number for a plan. Works for both chains and jobs.- Specified by:
findBuildResultNumbersRange
in interfaceInternalResultsSummaryAccessor
- Returns:
- (min, max) pair or (0,0) if there are no results.
-