public class CachedPlanManagerImpl extends Object implements CachedPlanManager, FilteringPlanManager
| Constructor and Description |
|---|
CachedPlanManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
assertPlanPermission(PlanIdentifier plan)
Used to validate user permission for plan.
|
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.
|
List<ImmutableChainBranch> |
getBranchesForChain(PlanIdentifier chain)
Get all feature branches associated with the given chain, sorted
|
Stream<ImmutableChainBranch> |
getBranchesOfChain(PlanKey chainKey)
Get all feature branches associated with the given chain, unsorted
|
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.
|
Iterable<ImmutableTopLevelPlan> |
getEditablePlansByProject(Project project)
|
Stream<ImmutableChain> |
getFilteredPlansWithRepository(PlanRepositoryIndex.Query query)
Returns chains that use repositories with given params
|
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> |
getPlans()
Returns all
TopLevelPlan's. |
<T extends ImmutablePlan> |
getPlans(Class<T> planType)
|
<T extends ImmutablePlan> |
getPlans(Class<T> planType,
com.google.common.base.Predicate<? super T> filter)
|
List<ImmutableTopLevelPlan> |
getPlansByProject(Project project)
Returns all
ImmutableTopLevelPlan's filtered by Project. |
<T extends ImmutablePlan> |
getPlansByProject(Project project,
Class<T> planType)
|
<T extends ImmutablePlan> |
getPlansByProject(Project project,
Class<T> planType,
com.google.common.base.Predicate<? super T> filter) |
List<ImmutableChain> |
getPlansForClone()
Returns all
Chain's. |
List<ImmutableTopLevelPlan> |
getPlansUnrestricted()
Returns all
ImmutableTopLevelPlan's ignoring permissions. |
Iterable<ImmutableChain> |
getPlansWithRepository(PlanRepositoryIndex.Query query)
Returns chains that use repositories with given params
|
<T extends ImmutablePlan> |
getRunnablePlans(Project project,
Class<T> planType)
|
boolean |
isBranchOf(PlanKey chainKey,
PlanKey branchKey)
Test if plan identified by branchKey is a branch of plan identified by chainKey.
|
@Nullable public ImmutablePlan getPlanByKey(@NotNull PlanKey planKey)
CachedPlanManagerImmutablePlan by its planKeygetPlanByKey in interface CachedPlanManagerplanKey - to search for@Nullable public <T extends ImmutablePlan> T getPlanByKey(@NotNull PlanKey planKey, Class<T> planType) throws IncorrectPlanTypeException
CachedPlanManagerImmutablePlan by its planKey and ClassgetPlanByKey in interface CachedPlanManagerplanKey - to search forplanType - - the type of the plan to retrieveIncorrectPlanTypeException - if plan cannot be found with the correct type@Nullable public <T extends ImmutablePlan> T getPlanByKeyIfOfType(@NotNull PlanKey planKey, @NotNull Class<T> planType)
CachedPlanManagerPlan 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.getPlanByKeyIfOfType in interface CachedPlanManager@NotNull public List<ImmutableTopLevelPlan> getPlans()
FilteringPlanManagerTopLevelPlan's.
This method is Acegi-filtered.getPlans in interface FilteringPlanManager@NotNull public List<ImmutableTopLevelPlan> getPlansUnrestricted()
CachedPlanManagerImmutableTopLevelPlan's ignoring permissions.getPlansUnrestricted in interface CachedPlanManager@NotNull public <T extends ImmutablePlan> List<T> getPlans(Class<T> planType)
FilteringPlanManagerPlan's filtered by Class. Does not include plans marked for deletion.
This method is Acegi-filtered.getPlans in interface FilteringPlanManagerplanType - - the type of the plan to retrieveDescriptionProvider.getName()@NotNull public <T extends ImmutablePlan> List<T> getPlans(Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)
FilteringPlanManagerPlan's filtered by Class. Does not include plans marked for deletion.
This method is Acegi-filtered.getPlans in interface FilteringPlanManagerplanType - - the type of the plan to retrieveDescriptionProvider.getName()@NotNull public List<ImmutableTopLevelPlan> getPlansByProject(Project project)
FilteringPlanManagerImmutableTopLevelPlan's filtered by Project.
This method is Acegi-filtered.getPlansByProject in interface FilteringPlanManagerproject - - that the plans will belong toImmutableTopLevelPlan plans contained within the given project@NotNull public Iterable<ImmutableTopLevelPlan> getEditablePlansByProject(Project project)
FilteringPlanManagerPlan's filtered by Project and user can edit (EDIT permission assigned for plan to user)getEditablePlansByProject in interface FilteringPlanManagerproject - - that the plans will belong to@NotNull public <T extends ImmutablePlan> List<T> getPlansByProject(Project project, Class<T> planType)
FilteringPlanManagergetPlansByProject in interface FilteringPlanManagerproject - - that the plans will belong toplanType - - the type of the plan to retrievepublic <T extends ImmutablePlan> List<T> getPlansByProject(@NotNull Project project, @NotNull Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)
getPlansByProject in interface FilteringPlanManager@NotNull public List<ImmutableChainBranch> getBranchesForChain(@NotNull PlanIdentifier chain)
FilteringPlanManagergetBranchesForChain in interface FilteringPlanManagerchain - - the masterChainBranchs associated with the given chain.@NotNull public Stream<ImmutableChainBranch> getBranchesOfChain(@NotNull PlanKey chainKey)
FilteringPlanManagergetBranchesOfChain in interface FilteringPlanManagerchainKey - - the masterChainBranchs associated with the given chain.@NotNull public Set<PlanKey> getBranchKeysOfChain(@NotNull PlanKey chainKey)
CachedPlanManagergetBranchKeysOfChain in interface CachedPlanManager@NotNull public Set<PlanBranchGist> getBranchGistsOfChain(@NotNull PlanKey chainKey)
CachedPlanManagergetBranchGistsOfChain in interface CachedPlanManager@Nullable public ImmutableChain getMasterPlan(@NotNull PlanKey branchKey)
CachedPlanManagergetMasterPlan in interface CachedPlanManagerbranchKey - key of a branchpublic boolean isBranchOf(@NotNull
PlanKey chainKey,
@NotNull
PlanKey branchKey)
CachedPlanManagerisBranchOf in interface CachedPlanManagerchainKey - key of master branchbranchKey - key of alleged branchpublic boolean assertPlanPermission(@NotNull
PlanIdentifier plan)
FilteringPlanManagerassertPlanPermission in interface FilteringPlanManagerplan - to check the permissions of@NotNull public List<ImmutableChain> getPlansForClone()
FilteringPlanManagerChain's. Return list filtered to show only plans the current user is allowed to clone.getPlansForClone in interface FilteringPlanManager@NotNull public <T extends ImmutablePlan> List<T> getRunnablePlans(@NotNull Project project, @NotNull Class<T> planType)
FilteringPlanManagergetRunnablePlans in interface FilteringPlanManagerproject - - that the plans will belong toplanType - - the type of the plan to retrieve@Nullable public ImmutableJob getMasterOfJob(@NotNull PlanKey masterChainKey, @NotNull PlanKey jobKey)
getMasterOfJob in interface CachedPlanManagerpublic Iterable<ImmutableChain> getPlansWithRepository(@NotNull PlanRepositoryIndex.Query query)
CachedPlanManagergetPlansWithRepository in interface CachedPlanManagerpublic Stream<ImmutableChain> getFilteredPlansWithRepository(@NotNull PlanRepositoryIndex.Query query)
FilteringPlanManagergetFilteredPlansWithRepository in interface FilteringPlanManagerpublic Optional<ImmutableChain> getAnyPlan(Predicate<? super ImmutableChain> predicate)
CachedPlanManagergetAnyPlan in interface CachedPlanManagergetAnyPlan in interface FilteringPlanManagerpublic Optional<ImmutableChain> getAnyPlanUnrestricted(Predicate<? super ImmutableChain> predicate)
CachedPlanManagergetAnyPlanUnrestricted in interface CachedPlanManager@Nullable public <T extends ImmutablePlan> T getPlanById(long id, Class<T> planType)
CachedPlanManagerImmutablePlan by its database id and ClassgetPlanById in interface CachedPlanManagerid - to search forplanType - - the type of the plan to retrieve@Nullable public <T extends ImmutablePlan> T getPlanByIdNotThrowing(long id, Class<T> planType)
CachedPlanManagerImmutablePlan by its database id and Class.
This method does not throw exception if plan is not found.getPlanByIdNotThrowing in interface CachedPlanManagerid - to search forplanType - - the type of the plan to retrievepublic Set<Project> getAllProjectsWithPlan()
CachedPlanManagergetAllProjectsWithPlan in interface CachedPlanManagerCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.