Package com.atlassian.bamboo.plan
Interface FilteringPlanManager
-
- All Known Subinterfaces:
CachedPlanManager
- All Known Implementing Classes:
CachedPlanManagerImpl
public interface FilteringPlanManagerAll methods in this class apply permission checks based on Acegi. When, possible they are done declaratively through applicationContextAcegiAuthorization.xml . In other cases, business code is responsible for applying permission checks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanassertPlanPermission(@NotNull PlanIdentifier plan)Used to validate user permission for plan.Optional<ImmutableChain>getAnyPlan(Predicate<? super ImmutableChain> predicate)Returns a plan matching the supplied predicate.@NotNull List<ImmutableChainBranch>getBranchesForChain(@NotNull PlanIdentifier chain)Deprecated.since 6.2 usegetBranchesOfChain(PlanKey)instead.@NotNull List<ImmutableChainBranch>getBranchesForChainWithConsistencyGuarantee(@NotNull PlanIdentifier chain)Get all feature branches associated with the given chain, sorted.@NotNull Stream<ImmutableChainBranch>getBranchesOfChain(@NotNull PlanKey chainKey)Get all feature branches associated with the given chain, unsorted.@NotNull Stream<ImmutableChainBranch>getBranchesOfChainWithConsistencyGuarantee(@NotNull PlanKey chainKey)Get all feature branches associated with the given chain, unsorted.@NotNull Iterable<ImmutableTopLevelPlan>getEditablePlansByProject(Project project)Stream<ImmutableChain>getFilteredPlansWithRepository(PlanRepositoryIndex.Query query)Returns chains that use repositories with given params@NotNull List<ImmutableTopLevelPlan>getPlans()Returns allTopLevelPlan's.<T extends ImmutablePlan>
@NotNull List<T>getPlans(Class<T> planType)<T extends ImmutablePlan>
@NotNull List<T>getPlans(Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)Deprecated.since 5.11 this method warms the whole cache.<T extends ImmutablePlan>
List<T>getPlansByProject(@NotNull Project project, @NotNull Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)@NotNull List<ImmutableTopLevelPlan>getPlansByProject(Project project)Returns allImmutableTopLevelPlan's filtered byProject.<T extends ImmutablePlan>
@NotNull List<T>getPlansByProject(Project project, Class<T> planType)@NotNull List<ImmutableTopLevelPlan>getPlansByProjectWithConsistencyGuarantee(Project project)Returns allImmutableTopLevelPlan's filtered byProject.<T extends ImmutablePlan>
@NotNull List<T>getPlansByProjectWithConsistencyGuarantee(Project project, Class<T> planType)@NotNull List<ImmutableChain>getPlansForClone()Returns allChain's.<T extends ImmutablePlan>
@NotNull List<T>getPlansWithConsistencyGuarantee(Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)<T extends ImmutablePlan>
@NotNull List<T>getRunnablePlans(@NotNull Project project, @NotNull Class<T> planType)
-
-
-
Method Detail
-
assertPlanPermission
boolean assertPlanPermission(@NotNull @NotNull PlanIdentifier plan)Used to validate user permission for plan. This method is Acegi-filtered.- Parameters:
plan- to check the permissions of- Returns:
- true if the current user has read(?) permissions on the plan
-
getAnyPlan
Optional<ImmutableChain> getAnyPlan(Predicate<? super ImmutableChain> predicate)
Returns a plan matching the supplied predicate.
-
getBranchesForChain
@NotNull @Deprecated @NotNull List<ImmutableChainBranch> getBranchesForChain(@NotNull @NotNull PlanIdentifier chain)
Deprecated.since 6.2 usegetBranchesOfChain(PlanKey)instead. Remember about sorting it for UI.Get all feature branches associated with the given chain, sorted. In clustered mode, there is NO consistency guarantee.- Parameters:
chain- - the master- Returns:
- List
ChainBranchs associated with the given chain.
-
getBranchesForChainWithConsistencyGuarantee
@NotNull @NotNull List<ImmutableChainBranch> getBranchesForChainWithConsistencyGuarantee(@NotNull @NotNull PlanIdentifier chain)
Get all feature branches associated with the given chain, sorted. There is a guarantee that the data will be up-to-date.- Parameters:
chain- - the master- Returns:
- List
ChainBranchs associated with the given chain.
-
getBranchesOfChain
@NotNull @NotNull Stream<ImmutableChainBranch> getBranchesOfChain(@NotNull @NotNull PlanKey chainKey)
Get all feature branches associated with the given chain, unsorted. In clustered mode, there is NO consistency guarantee.- Parameters:
chainKey- - the master- Returns:
- List
ChainBranchs associated with the given chain.
-
getBranchesOfChainWithConsistencyGuarantee
@NotNull @NotNull Stream<ImmutableChainBranch> getBranchesOfChainWithConsistencyGuarantee(@NotNull @NotNull PlanKey chainKey)
Get all feature branches associated with the given chain, unsorted. There is a guarantee that the data will be up-to-date.- Parameters:
chainKey- - the master- Returns:
- List
ChainBranchs associated with the given chain. - Since:
- 9.4
-
getEditablePlansByProject
@NotNull @NotNull Iterable<ImmutableTopLevelPlan> getEditablePlansByProject(Project project)
Returns allPlan's filtered byProjectand user can edit (EDIT permission assigned for plan to user)- Parameters:
project- - that the plans will belong to- Returns:
- editable plans for project
-
getPlans
@NotNull @NotNull List<ImmutableTopLevelPlan> getPlans()
Returns allTopLevelPlan's. This method is Acegi-filtered.- Returns:
- plans
-
getPlans
@NotNull <T extends ImmutablePlan> @NotNull List<T> getPlans(Class<T> planType)
Returns allPlan's filtered byClass. Does not include plans marked for deletion. This method is Acegi-filtered.- Parameters:
planType- - the type of the plan to retrieve- Returns:
- plans sorted by
DescriptionProvider.getName()
-
getPlans
@NotNull @Deprecated <T extends ImmutablePlan> @NotNull List<T> getPlans(Class<T> planType, @NotNull @NotNull com.google.common.base.Predicate<? super T> filter)
Deprecated.since 5.11 this method warms the whole cache. Use it very carefully. Avoid it in core Bamboo.Returns allPlan's filtered byClass. Does not include plans marked for deletion. This method is Acegi-filtered. In clustered mode, there is NO consistency guarantee.- Parameters:
planType- - the type of the plan to retrieve- Returns:
- plans sorted by
DescriptionProvider.getName()
-
getPlansWithConsistencyGuarantee
@NotNull <T extends ImmutablePlan> @NotNull List<T> getPlansWithConsistencyGuarantee(Class<T> planType, @NotNull @NotNull com.google.common.base.Predicate<? super T> filter)
Returns allPlan's filtered byClass. Does not include plans marked for deletion. This method is Acegi-filtered. There is a guarantee that the data will be up-to-date.- Parameters:
planType- - the type of the plan to retrieve- Returns:
- plans sorted by
DescriptionProvider.getName()
-
getPlansByProject
@NotNull @NotNull List<ImmutableTopLevelPlan> getPlansByProject(Project project)
Returns allImmutableTopLevelPlan's filtered byProject. This method is Acegi-filtered. In clustered mode, there is NO consistency guarantee.- Parameters:
project- - that the plans will belong to- Returns:
ImmutableTopLevelPlanplans contained within the given project
-
getPlansByProjectWithConsistencyGuarantee
@NotNull @NotNull List<ImmutableTopLevelPlan> getPlansByProjectWithConsistencyGuarantee(Project project)
Returns allImmutableTopLevelPlan's filtered byProject. This method is Acegi-filtered. There is a guarantee that the data will be up-to-date.- Parameters:
project- - that the plans will belong to- Returns:
ImmutableTopLevelPlanplans contained within the given project- Since:
- 9.4
-
getPlansByProject
@NotNull <T extends ImmutablePlan> @NotNull List<T> getPlansByProject(Project project, Class<T> planType)
Returns allPlan's filtered byProjectandClass. This method is Acegi-filtered. In clustered mode, there is NO consistency guarantee.- Parameters:
project- - that the plans will belong toplanType- - the type of the plan to retrieve- Returns:
- plans contained within the given project and of the given type
-
getPlansByProjectWithConsistencyGuarantee
@NotNull <T extends ImmutablePlan> @NotNull List<T> getPlansByProjectWithConsistencyGuarantee(Project project, Class<T> planType)
Returns allPlan's filtered byProjectandClass. This method is Acegi-filtered. There is a guarantee that the data will be up-to-date.- Parameters:
project- - that the plans will belong toplanType- - the type of the plan to retrieve- Returns:
- plans contained within the given project and of the given type
- Since:
- 9.4
-
getPlansByProject
<T extends ImmutablePlan> List<T> getPlansByProject(@NotNull @NotNull Project project, @NotNull @NotNull Class<T> planType, @NotNull @NotNull com.google.common.base.Predicate<? super T> filter)
-
getFilteredPlansWithRepository
Stream<ImmutableChain> getFilteredPlansWithRepository(@NotNull PlanRepositoryIndex.Query query)
Returns chains that use repositories with given params
-
getPlansForClone
@NotNull @NotNull List<ImmutableChain> getPlansForClone()
Returns allChain's. Return list filtered to show only plans the current user is allowed to clone.- Returns:
- plans
-
getRunnablePlans
@NotNull <T extends ImmutablePlan> @NotNull List<T> getRunnablePlans(@NotNull @NotNull Project project, @NotNull @NotNull Class<T> planType)
- Parameters:
project- - that the plans will belong toplanType- - the type of the plan to retrieve- Returns:
- plans contained within the given project and of the given type
-
-