@PublicApi
public interface PlanManager
| Modifier and Type | Method and Description |
|---|---|
boolean |
assertPlanPermission(PlanIdentifier plan)
Used to validate user permission for plan.
|
void |
createPlan(Plan plan)
Same as savePlan, but create permissions used instead of edit permissions.
|
void |
deletePlan(Plan plan)
Removes the plan object from the database.
|
Set<ImmutableChain> |
filterFavouritedPlans(Collection<? extends ImmutableChain> plans,
com.atlassian.user.User user)
Return a set of
Plans that are a subset of the given TopLevelPlans
collection that are favourited by the User |
List<Chain> |
getAllChainsAndJobsUnrestricted()
WARNING this is probably a bad idea from a performance perspective, only do this if you're going to
traverse through all the
ChainStage and Job of all Chains returned. |
<T extends Plan> |
getAllPlanKeys(Class<T> planType)
Returns keys of all
Plan's filtered by Class. |
List<TopLevelPlan> |
getAllPlans()
Deprecated.
since 5.0 please use
CachedPlanManager |
<T extends Plan> |
getAllPlans(Class<T> planType)
Returns all
Plan's filtered by Class. |
<T extends Plan> |
getAllPlans(Class<T> planType,
int firstResult,
int maxResults)
Returns all
Plan's filtered by Class. |
<T extends Plan> |
getAllPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
getAllPlansMarkedForDeletion(Class<T> planType)
Returns a list of
Plans that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given type |
List<TopLevelPlan> |
getAllPlansUnrestricted()
Returns all
TopLevelPlan's ignoring permissions |
Set<ImmutableChain> |
getFavouritePlans(com.atlassian.user.User user) |
Plan |
getPlanById(long id)
Returns a
Plan by its id |
<T extends Plan> |
getPlanById(long id,
Class<T> planType)
Returns a
Plan by its id and Class |
Plan |
getPlanByKey(PlanKey planKey)
|
<T extends Plan> |
getPlanByKey(PlanKey planKey,
Class<T> planType)
|
Plan |
getPlanByKey(String planKey)
Deprecated.
since 4.2
|
<T extends Plan> |
getPlanByKey(String planKey,
Class<T> planType)
Deprecated.
since 4.2
|
<T extends Plan> |
getPlanByKeyIfOfType(PlanKey planKey,
Class<T> planType)
Returns a
Plan by its planKey and if it's of the type Class. |
<T extends Plan> |
getPlanByPartialKeyAndName(PlanKey partialPlanKey,
String planName,
Class<T> planType)
Deprecated.
since 4.2
|
Class<? extends Plan> |
getPlanClass(PlanKey planKey) |
int |
getPlanCount() |
<T extends Plan> |
getPlanCount(Class<T> planType)
How many plans filtered by
Class currently exist |
PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(String planKey)
Returns a
Plan skeleton skeleton providing ONLY id and key, that matches the given key This method should
be used only for permission checking using Acegi
If Job key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are
defined only for TopLevelPlans |
<T extends Plan> |
getPlanIdentifiersForProject(ProjectIdentifier project,
Class<T> planType,
boolean includeMarkedForDeletion)
Retrieve a list of plans for a given project.
|
List<TopLevelPlan> |
getPlansByProject(Project project)
Returns all
TopLevelPlan's filtered by Project
Result of this method is filtered by Acegi. |
<T extends Plan> |
getPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
getProjectPlanMap(Class<T> planType,
boolean includeEmptyProjects)
|
boolean |
isChainNameConflicting(String projectKey,
long planIdToIgnore,
String planName)
Verifies whether a
Chain name is unique with the given project
|
boolean |
isPlanCreationAllowed()
Check whether or not a plan can be created or not (based on licensing etc)
|
boolean |
isPlanKeyConflicting(PlanKey planKey)
Verifies whether a
Plan key is unique within whole Bamboo installation |
void |
markPlansForDeletion(PlanKey planKey)
Efficiently marks a plan to be deleted
|
void |
removeStages(PlanKey key,
Collection<Long> stageIds)
Remove the tages from the plan specified.
|
void |
savePlan(Plan plan)
Saves the
Plan |
void |
savePlanWithSchedulesStopped(Plan plan)
Saves the
Plan while polling jobs are stopped. |
void |
setPlanSuspendedState(PlanKey planKey,
boolean newState) |
void |
syncDeletionStatusOfJobs()
Performs a cleanup task to mark
Job objects that have a Plan or ChainStage that is marked
to be deleted, but it itself was not marked as deleted. |
void |
triggerConfigUpdatedEventsForPlansInProject(Project project)
Triggers updated events for every plan in a project regardless of permissions.
|
@Nullable PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull String planKey)
Plan skeleton skeleton providing ONLY id and key, that matches the given key This method should
be used only for permission checking using Acegi
If Job key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are
defined only for TopLevelPlansplanKey - of the plan to findIncorrectPlanTypeException - if plan cannot be found with the correct type (should never happen)@Nullable Plan getPlanById(long id) throws IncorrectPlanTypeException
Plan by its idid - of the planIncorrectPlanTypeException - if plan cannot be found@Nullable <T extends Plan> T getPlanById(long id, Class<T> planType) throws IncorrectPlanTypeException
Plan by its id and Classid - of the planplanType - - the type of the plan to retrieveIncorrectPlanTypeException - if plan cannot be found with the correct type@Nullable Plan getPlanByKey(@NotNull PlanKey planKey) throws IncorrectPlanTypeException
planKey - to search forIncorrectPlanTypeException - if plan cannot be found with the correct type (should never happen)@Nullable <T extends Plan> T getPlanByKey(@NotNull PlanKey planKey, Class<T> planType) throws IncorrectPlanTypeException
planKey - to search forplanType - - the type of the plan to retrieveIncorrectPlanTypeException - if plan cannot be found with the correct type@Nullable <T extends Plan> 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.planKey - to search forplanType - the type of the plan to retrieve@NotNull @Deprecated List<TopLevelPlan> getAllPlans()
CachedPlanManagerTopLevelPlan'sList<TopLevelPlan> getAllPlansUnrestricted()
TopLevelPlan's ignoring permissions@NotNull <T extends Plan> List<T> getAllPlans(Class<T> planType)
Plan's filtered by Class. Does not include plans marked for deletion.planType - - the type of the plan to retrieveDescriptionProvider.getName()@NotNull <T extends Plan> List<PlanKey> getAllPlanKeys(Class<T> planType)
Plan's filtered by Class. Does not include plans marked for deletion.planType - - the type of the plan to retrieve@NotNull <T extends Plan> List<T> getAllPlans(Class<T> planType, int firstResult, int maxResults)
Plan's filtered by Class. Does not include plans marked for deletion.planType - - the type of the plan to retrievefirstResult - firstResult for a paginated resultsmaxResults - maximum number of results to returnDescriptionProvider.getName()@NotNull List<Chain> getAllChainsAndJobsUnrestricted()
ChainStage and Job of all Chains returned.@NotNull List<TopLevelPlan> getPlansByProject(Project project)
TopLevelPlan's filtered by Project
Result of this method is filtered by Acegi.project - - that the plans will belong toTopLevelPlan plans contained within the given project@NotNull <T extends Plan> List<T> getPlansByProject(Project project, Class<T> planType)
project - - that the plans will belong toplanType - - the type of the plan to retrieve@NotNull <T extends Plan> List<T> getAllPlansByProject(Project project, Class<T> planType)
project - - that the plans will belong toplanType - - the type of the plan to retrieve@NotNull <T extends Plan> Map<Project,Collection<T>> getProjectPlanMap(Class<T> planType, boolean includeEmptyProjects)
@NotNull <T extends Plan> List<PlanIdentifier> getPlanIdentifiersForProject(@NotNull ProjectIdentifier project, @NotNull Class<T> planType, boolean includeMarkedForDeletion)
project - to get plans forplanType - to filter plans byincludeMarkedForDeletion - set to true if you want to return plans marked for deletionSet<ImmutableChain> getFavouritePlans(@NotNull com.atlassian.user.User user)
@NotNull Set<ImmutableChain> filterFavouritedPlans(@NotNull Collection<? extends ImmutableChain> plans, @NotNull com.atlassian.user.User user)
Plans that are a subset of the given TopLevelPlans
collection that are favourited by the Userplans - to filteruser - to return the favourites ofChains that are a subset of the given TopLevelPlans collection that are favourited by the User@NotNull <T extends Plan> Collection<T> getAllPlansMarkedForDeletion(Class<T> planType)
Plans that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given typeint getPlanCount()
Buildable's exists<T extends Plan> int getPlanCount(Class<T> planType)
Class currently existplanType - - the type of the plan to retrieveboolean isChainNameConflicting(@NotNull
String projectKey,
long planIdToIgnore,
@NotNull
String planName)
Chain name is unique with the given project
projectKey - of the project to look for the plan inplanIdToIgnore - the id of the plan that has to be ignored during lookup (when you're saving a Plan, you
should supply the plan id here)planName - - name of the plan inside the project: this is just the plan component of the name (i.e
does not include the project component)boolean isPlanKeyConflicting(@NotNull
PlanKey planKey)
Plan key is unique within whole Bamboo installationplanKey - key of the plan to be searched for in the database@Nullable @Deprecated <T extends Plan> T getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey, @NotNull String planName, Class<T> planType) throws IncorrectPlanTypeException
IncorrectPlanTypeException - if plan cannot be found with the correct typeboolean assertPlanPermission(@NotNull
PlanIdentifier plan)
plan - to check the permissions ofboolean isPlanCreationAllowed()
void savePlanWithSchedulesStopped(@NotNull
Plan plan)
Plan while polling jobs are stopped.plan - void setPlanSuspendedState(PlanKey planKey, boolean newState)
void triggerConfigUpdatedEventsForPlansInProject(@NotNull
Project project)
project - to trigger event for.void createPlan(Plan plan)
void deletePlan(Plan plan)
plan - to delete.void markPlansForDeletion(PlanKey planKey)
planKey - void syncDeletionStatusOfJobs()
Job objects that have a Plan or ChainStage that is marked
to be deleted, but it itself was not marked as deleted.void removeStages(@NotNull
PlanKey key,
@NotNull
Collection<Long> stageIds)
Chainkey - stageIds - @Nullable @Deprecated Plan getPlanByKey(@NotNull String planKey) throws IncorrectPlanTypeException
Plan by its planKeyplanKey - of the plan to findIncorrectPlanTypeException - if plan cannot be found with the correct type (should never happen)@Nullable @Deprecated <T extends Plan> T getPlanByKey(@NotNull String planKey, Class<T> planType) throws IncorrectPlanTypeException
Plan by its planKey and ClassplanKey - to search forplanType - - the type of the plan to retrieveIncorrectPlanTypeException - if plan cannot be found with the correct typeCopyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.