public interface CachedPlanManager extends FilteringPlanManager
Modifier and Type | Method and Description |
---|---|
Set<Project> |
getAllProjectsWithPlan()
Returns all projects which have at least one plan (plan is in the cache)
|
Optional<ImmutableChain> |
getAnyPlan(Predicate<? super ImmutableChain> predicate)
Returns a plan matching the supplied predicate, permission filtering is applied.
|
Optional<ImmutableChain> |
getAnyPlanUnrestricted(Predicate<? super ImmutableChain> predicate)
Returns a plan matching the supplied predicate.
|
Set<PlanBranchGist> |
getBranchGistsOfChain(PlanKey chainKey)
Returns basic data of all branches for the supplied chain.
|
Set<PlanKey> |
getBranchKeysOfChain(PlanKey chainKey)
Returns keys of all branches for the supplied chain.
|
ImmutableJob |
getMasterOfJob(PlanKey masterChainKey,
PlanKey jobKey) |
ImmutableChain |
getMasterPlan(PlanKey branchKey)
Returns master branch for a given branchKey.
|
<T extends ImmutablePlan> |
getPlanById(long id,
Class<T> planType)
Returns a
ImmutablePlan by its database id and Class |
<T extends ImmutablePlan> |
getPlanByIdNotThrowing(long id,
Class<T> planType)
Returns a
ImmutablePlan by its database id and Class . |
ImmutablePlan |
getPlanByKey(PlanKey planKey)
Returns a
ImmutablePlan by its planKey |
<T extends ImmutablePlan> |
getPlanByKey(PlanKey planKey,
Class<T> planType)
Returns a
ImmutablePlan by its planKey and Class |
<T extends ImmutablePlan> |
getPlanByKeyIfOfType(PlanKey planKey,
Class<T> planType)
|
List<ImmutableTopLevelPlan> |
getPlansUnrestricted()
Returns all
ImmutableTopLevelPlan 's ignoring permissions. |
Iterable<ImmutableChain> |
getPlansWithRepository(PlanRepositoryIndex.Query query)
Returns chains that use repositories with given params
|
boolean |
isBranchOf(PlanKey chainKey,
PlanKey branchKey)
Test if plan identified by branchKey is a branch of plan identified by chainKey.
|
assertPlanPermission, getBranchesForChain, getBranchesOfChain, getEditablePlansByProject, getFilteredPlansWithRepository, getPlans, getPlans, getPlans, getPlansByProject, getPlansByProject, getPlansByProject, getPlansForClone, getRunnablePlans
@Nullable ImmutablePlan getPlanByKey(@NotNull PlanKey planKey)
ImmutablePlan
by its planKeyplanKey
- to search for@Nullable <T extends ImmutablePlan> T getPlanByKey(@NotNull PlanKey planKey, Class<T> planType) throws IncorrectPlanTypeException
ImmutablePlan
by its planKey and Class
planKey
- to search forplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable <T extends ImmutablePlan> T getPlanByKeyIfOfType(@NotNull PlanKey planKey, @NotNull Class<T> planType)
Plan
by its planKey and if it's of the type Class
. Does not throw IncorrectPlanTypeException
. Should only be used when the type of the plan can not be known.T
- planKey
- planType
- Optional<ImmutableChain> getAnyPlan(Predicate<? super ImmutableChain> predicate)
getAnyPlan
in interface FilteringPlanManager
Optional<ImmutableChain> getAnyPlanUnrestricted(Predicate<? super ImmutableChain> predicate)
@Nullable <T extends ImmutablePlan> T getPlanById(long id, Class<T> planType) throws IncorrectPlanTypeException, NoSuchElementException
ImmutablePlan
by its database id and Class
id
- to search forplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct typeNoSuchElementException
@Nullable <T extends ImmutablePlan> T getPlanByIdNotThrowing(long id, Class<T> planType)
ImmutablePlan
by its database id and Class
.
This method does not throw exception if plan is not found.id
- to search forplanType
- - the type of the plan to retrieve@NotNull List<ImmutableTopLevelPlan> getPlansUnrestricted()
ImmutableTopLevelPlan
's ignoring permissions.@NotNull Set<PlanKey> getBranchKeysOfChain(@NotNull PlanKey chainKey)
@NotNull Set<PlanBranchGist> getBranchGistsOfChain(@NotNull PlanKey chainKey)
@Nullable ImmutableChain getMasterPlan(@NotNull PlanKey branchKey)
branchKey
- key of a branchboolean isBranchOf(@NotNull PlanKey chainKey, @NotNull PlanKey branchKey)
chainKey
- key of master branchbranchKey
- key of alleged branch@Nullable ImmutableJob getMasterOfJob(@NotNull PlanKey masterChainKey, @NotNull PlanKey jobKey)
Iterable<ImmutableChain> getPlansWithRepository(@NotNull PlanRepositoryIndex.Query query)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.