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.
|
@NotNull Set<PlanBranchGist> |
getBranchGistsOfChain(@NotNull PlanKey chainKey)
Returns basic data of all branches for the supplied chain.
|
@NotNull Set<PlanKey> |
getBranchKeysOfChain(@NotNull PlanKey chainKey)
Returns keys of all branches for the supplied chain.
|
@Nullable ImmutableJob |
getMasterOfJob(@NotNull PlanKey masterChainKey,
@NotNull PlanKey jobKey) |
@Nullable ImmutableChain |
getMasterPlan(@NotNull 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 . |
@Nullable ImmutablePlan |
getPlanByKey(@NotNull PlanKey planKey)
Returns a
ImmutablePlan by its planKey |
<T extends ImmutablePlan> |
getPlanByKey(@NotNull PlanKey planKey,
Class<T> planType)
Returns a
ImmutablePlan by its planKey and Class |
<T extends ImmutablePlan> |
getPlanByKeyIfOfType(@NotNull PlanKey planKey,
@NotNull Class<T> planType)
|
@NotNull List<ImmutableChain> |
getPlansByProjectUnrestricted(Project project)
Returns all
ImmutableChain 's filtered by Project
ignoring permissions |
@NotNull 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(@NotNull PlanKey chainKey,
@NotNull 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 @Nullable ImmutablePlan getPlanByKey(@NotNull @NotNull PlanKey planKey)
ImmutablePlan
by its planKeyplanKey
- to search for@Nullable <T extends ImmutablePlan> T getPlanByKey(@NotNull @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 @NotNull PlanKey planKey, @NotNull @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 @NotNull List<ImmutableTopLevelPlan> getPlansUnrestricted()
ImmutableTopLevelPlan
's ignoring permissions.@NotNull @NotNull List<ImmutableChain> getPlansByProjectUnrestricted(Project project)
ImmutableChain
's filtered by Project
ignoring permissionsproject
- - that the plans will belong toImmutableChain
plans contained within the given project@NotNull @NotNull Set<PlanKey> getBranchKeysOfChain(@NotNull @NotNull PlanKey chainKey)
@NotNull @NotNull Set<PlanBranchGist> getBranchGistsOfChain(@NotNull @NotNull PlanKey chainKey)
@Nullable @Nullable ImmutableChain getMasterPlan(@NotNull @NotNull PlanKey branchKey)
branchKey
- key of a branchboolean isBranchOf(@NotNull @NotNull PlanKey chainKey, @NotNull @NotNull PlanKey branchKey)
chainKey
- key of master branchbranchKey
- key of alleged branch@Nullable @Nullable ImmutableJob getMasterOfJob(@NotNull @NotNull PlanKey masterChainKey, @NotNull @NotNull PlanKey jobKey)
Iterable<ImmutableChain> getPlansWithRepository(@NotNull PlanRepositoryIndex.Query query)
Copyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.