com.atlassian.bamboo.plan.cache
Interface CachedPlanManager

All Superinterfaces:
FilteringPlanManager
All Known Implementing Classes:
CachedPlanManagerImpl

@ExperimentalApi
public interface CachedPlanManager
extends FilteringPlanManager


Method Summary
 boolean assertPlanPermission(PlanIdentifier plan)
          Used to validate user permission for plan.
 List<ImmutableChainBranch> getBranchesForChain(PlanIdentifier chain)
          Get all feature branches associated with the given chain
 ImmutableJob getMasterOfJob(PlanKey masterChainKey, PlanKey jobKey)
           
 ImmutableChain getMasterPlan(PlanKey branchKey)
          Returns master branch for a given branchKey.
<T extends ImmutablePlan>
T
getPlanById(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>
T
getPlanByKey(PlanKey planKey, Class<T> planType)
          Returns a ImmutablePlan by its planKey and Class
<T extends ImmutablePlan>
T
getPlanByKeyIfOfType(PlanKey planKey, Class<T> planType)
          Returns a Plan by its planKey and if it's of the type Class.
 List<ImmutableTopLevelPlan> getPlans()
          Returns all TopLevelPlan's.
<T extends ImmutablePlan>
List<T>
getPlans(Class<T> planType)
          Returns all Plan's filtered by Class.
<T extends ImmutablePlan>
List<T>
getPlans(Class<T> planType, com.google.common.base.Predicate<? super T> filter)
          Returns all Plan's filtered by Class.
 List<ImmutableTopLevelPlan> getPlansByProject(Project project)
          Returns all ImmutableTopLevelPlan's filtered by Project.
<T extends ImmutablePlan>
List<T>
getPlansByProject(Project project, Class<T> planType)
          Returns all Plan's filtered by Project and Class.
<T extends ImmutablePlan>
List<T>
getPlansByProject(Project project, Class<T> planType, com.google.common.base.Predicate<? super T> filter)
           
 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.
 
Methods inherited from interface com.atlassian.bamboo.plan.FilteringPlanManager
getAllPlansForClone, getEditablePlansByProject, getPlansForClone, getRunnablePlans, getRunnablePlansByProject
 

Method Detail

getPlanByKey

@Nullable
ImmutablePlan getPlanByKey(@NotNull
                                    PlanKey planKey)
Returns a ImmutablePlan by its planKey

Parameters:
planKey - to search for
Returns:
plan with the given plan key or null if not found

getPlanByKey

@Nullable
<T extends ImmutablePlan> T getPlanByKey(@NotNull
                                                  PlanKey planKey,
                                                  Class<T> planType)
                                     throws IncorrectPlanTypeException
Returns a ImmutablePlan by its planKey and Class

Parameters:
planKey - to search for
planType - - the type of the plan to retrieve
Returns:
plan with the given plan key, if found AND is of the correct type.
Throws:
IncorrectPlanTypeException - if plan cannot be found with the correct type

getPlanByKeyIfOfType

@Nullable
<T extends ImmutablePlan> T getPlanByKeyIfOfType(@NotNull
                                                          PlanKey planKey,
                                                          @NotNull
                                                          Class<T> planType)
Returns a 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.

Type Parameters:
T -
Parameters:
planKey -
planType -
Returns:
null if the plan doesn't exist, or it's not of the found type

getPlanById

@Nullable
<T extends ImmutablePlan> T getPlanById(long id,
                                                 Class<T> planType)
                                    throws IncorrectPlanTypeException
Returns a ImmutablePlan by its database id and Class

Parameters:
id - to search for
planType - - the type of the plan to retrieve
Returns:
plan with the given database id, if found AND is of the correct type.
Throws:
IncorrectPlanTypeException - if plan cannot be found with the correct type

getPlans

@NotNull
List<ImmutableTopLevelPlan> getPlans()
Returns all TopLevelPlan's. This method is Acegi-filtered.

Returns:
plans

getPlansUnrestricted

@NotNull
List<ImmutableTopLevelPlan> getPlansUnrestricted()
Returns all ImmutableTopLevelPlan's ignoring permissions.

Returns:

getPlans

@NotNull
<T extends ImmutablePlan> List<T> getPlans(Class<T> planType)
Returns all Plan's filtered by Class. 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
<T extends ImmutablePlan> List<T> getPlans(Class<T> planType,
                                                   @NotNull
                                                   com.google.common.base.Predicate<? super T> filter)
Returns all Plan's filtered by Class. 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()

getPlansByProject

@NotNull
List<ImmutableTopLevelPlan> getPlansByProject(Project project)
Returns all ImmutableTopLevelPlan's filtered by Project. This method is Acegi-filtered.

Parameters:
project - - that the plans will belong to
Returns:
ImmutableTopLevelPlan plans contained within the given project

getPlansByProject

@NotNull
<T extends ImmutablePlan> List<T> getPlansByProject(Project project,
                                                            Class<T> planType)
Returns all Plan's filtered by Project and Class. This method is Acegi-filtered.

Parameters:
project - - that the plans will belong to
planType - - the type of the plan to retrieve
Returns:
plans contained within the given project and of the given type

getPlansByProject

<T extends ImmutablePlan> List<T> getPlansByProject(@NotNull
                                                    Project project,
                                                    @NotNull
                                                    Class<T> planType,
                                                    @NotNull
                                                    com.google.common.base.Predicate<? super T> filter)

getBranchesForChain

@NotNull
List<ImmutableChainBranch> getBranchesForChain(@NotNull
                                                       PlanIdentifier chain)
Get all feature branches associated with the given chain

Parameters:
chain - - the master
Returns:
List ChainBranchs associated with the given chain.

getMasterPlan

@Nullable
ImmutableChain getMasterPlan(@NotNull
                                      PlanKey branchKey)
Returns master branch for a given branchKey. If branchKey identifies plan which has no master (is a master itself) then this plan is returned, otherwise a master of a plan is returned.

Parameters:
branchKey - key of a branch
Returns:
master branch for a given branchKey or null if branchKey doesn't identify a plan

isBranchOf

boolean isBranchOf(@NotNull
                   PlanKey chainKey,
                   @NotNull
                   PlanKey branchKey)
Test if plan identified by branchKey is a branch of plan identified by chainKey. If branchKey identifies master plan method also returns true.

Parameters:
chainKey - key of master branch
branchKey - key of alleged branch
Returns:
true if plan identified by branchKey is a branch of plan identified by chainKey, false otherwise

assertPlanPermission

boolean assertPlanPermission(@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

getMasterOfJob

@Nullable
ImmutableJob getMasterOfJob(@NotNull
                                     PlanKey masterChainKey,
                                     @NotNull
                                     PlanKey jobKey)

getPlansWithRepository

Iterable<ImmutableChain> getPlansWithRepository(@NotNull
                                                PlanRepositoryIndex.Query query)
Returns chains that use repositories with given params



Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.