|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PlanManager
Manager for all Plan types within Bamboo
Use this manager if you need to address Builds, Plans, etc.
Method Summary | ||
---|---|---|
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. |
|
java.util.Set<ImmutableChain> |
filterFavouritedPlans(java.util.Collection<? extends ImmutableChain> plans,
com.atlassian.user.User user)
Return a set of Plan s that are a subset of the given TopLevelPlan s
collection that are favourited by the User |
|
java.util.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 Chain s returned. |
|
java.util.List<TopLevelPlan> |
getAllPlans()
Returns all TopLevelPlan 's |
|
|
getAllPlans(java.lang.Class<T> planType)
Returns all Plan 's filtered by Class . |
|
|
getAllPlansByProject(Project project,
java.lang.Class<T> planType)
Returns all Plan 's filtered by Project and Class , including the plans marked for
deletion. |
|
|
getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
Returns a list of Plan s that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given type |
|
java.util.List<TopLevelPlan> |
getAllPlansUnrestricted()
Returns all TopLevelPlan 's ignoring permissions |
|
java.util.Set<ImmutableChain> |
getFavouritePlans(com.atlassian.user.User user)
|
|
Plan |
getPlanById(long id)
Returns a Plan by its id |
|
|
getPlanById(long id,
java.lang.Class<T> planType)
Returns a Plan by its id and Class |
|
Plan |
getPlanByKey(PlanKey planKey)
Returns a Plan by its PlanKey |
|
|
getPlanByKey(PlanKey planKey,
java.lang.Class<T> planType)
Returns a Plan by its PlanKey and Class |
|
Plan |
getPlanByKey(java.lang.String planKey)
Deprecated. |
|
|
getPlanByKey(java.lang.String planKey,
java.lang.Class<T> planType)
Deprecated. |
|
|
getPlanByKeyIfOfType(PlanKey planKey,
java.lang.Class<T> planType)
Returns a Plan by its planKey and if it's of the type Class . |
|
|
getPlanByKeyIfOfType(java.lang.String planKey,
java.lang.Class<T> planType)
Deprecated. since 4.2 use getPlanByKeyIfOfType(com.atlassian.bamboo.plan.PlanKey, java.lang.Class and PlanKeys.getPlanKey(String) |
|
|
getPlanByPartialKeyAndName(PlanKey partialPlanKey,
java.lang.String planName,
java.lang.Class<T> planType)
Deprecated. |
|
Plan |
getPlanByResultKey(PlanResultKey planResultKey)
Deprecated. |
|
|
getPlanByResultKey(PlanResultKey planResultKey,
java.lang.Class<T> planType)
Deprecated. |
|
java.lang.Class<? extends Plan> |
getPlanClass(PlanKey planKey)
|
|
int |
getPlanCount()
|
|
|
getPlanCount(java.lang.Class<T> planType)
How many plans filtered by Class currently exist |
|
PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(java.lang.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 TopLevelPlan s |
|
|
getPlanIdentifiersForProject(ProjectIdentifier project,
java.lang.Class<T> planType,
boolean includeMarkedForDeletion)
Retrieve a list of plans for a given project. |
|
java.util.List<TopLevelPlan> |
getPlansByProject(Project project)
Returns all TopLevelPlan 's filtered by Project
Result of this method is filtered by Acegi. |
|
|
getPlansByProject(Project project,
java.lang.Class<T> planType)
Returns all Plan 's filtered by Project and Class |
|
|
getProjectPlanMap(java.lang.Class<T> planType,
boolean includeEmptyProjects)
Return mapping of Project to Plan of given type |
|
boolean |
isChainNameConflicting(java.lang.String projectKey,
long planIdToIgnore,
java.lang.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,
java.util.Collection<java.lang.Long> stageIds)
Remove the tages from the plan specified. |
|
void |
savePlan(Plan plan)
Saves the Plan |
|
void |
setPlanSuspendedState(Plan plan,
boolean newState)
Deprecated. since 4.1. Use setPlanSuspendedState(PlanKey, boolean) instead |
|
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. |
Method Detail |
---|
@Nullable PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull java.lang.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 TopLevelPlan
s
planKey
- of the plan to find
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable Plan getPlanById(long id) throws IncorrectPlanTypeException
Plan
by its id
id
- of the plan
IncorrectPlanTypeException
- if plan cannot be found@Nullable <T extends Plan> T getPlanById(long id, java.lang.Class<T> planType) throws IncorrectPlanTypeException
Plan
by its id and Class
id
- of the planplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable Plan getPlanByKey(@NotNull PlanKey planKey) throws IncorrectPlanTypeException
Plan
by its PlanKey
planKey
- to search for
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable <T extends Plan> T getPlanByKey(@NotNull PlanKey planKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
Plan
by its PlanKey
and Class
planKey
- to search forplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable <T extends Plan> T getPlanByKeyIfOfType(@NotNull PlanKey planKey, @NotNull java.lang.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 java.util.List<TopLevelPlan> getAllPlans()
TopLevelPlan
's
java.util.List<TopLevelPlan> getAllPlansUnrestricted()
TopLevelPlan
's ignoring permissions
@NotNull <T extends Plan> java.util.List<T> getAllPlans(java.lang.Class<T> planType)
Plan
's filtered by Class
. Does not include plans marked for deletion.
planType
- - the type of the plan to retrieve
DescriptionProvider.getName()
@NotNull java.util.List<Chain> getAllChainsAndJobsUnrestricted()
ChainStage
and Job
of all Chain
s returned.
@NotNull java.util.List<TopLevelPlan> getPlansByProject(Project project)
TopLevelPlan
's filtered by Project
Result of this method is filtered by Acegi.
project
- - that the plans will belong to
TopLevelPlan
plans contained within the given project@NotNull <T extends Plan> java.util.List<T> getPlansByProject(Project project, java.lang.Class<T> planType)
Plan
's filtered by Project
and Class
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve
@NotNull <T extends Plan> java.util.List<T> getAllPlansByProject(Project project, java.lang.Class<T> planType)
Plan
's filtered by Project
and Class
, including the plans marked for
deletion.
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve
@NotNull <T extends Plan> java.util.Map<Project,java.util.Collection<T>> getProjectPlanMap(java.lang.Class<T> planType, boolean includeEmptyProjects)
Project
to Plan
of given type
planType
- type of plan to be selected from DBincludeEmptyProjects
- should empty projects be included in result
Project
to Plan
of given type@NotNull <T extends Plan> java.util.List<PlanIdentifier> getPlanIdentifiersForProject(@NotNull ProjectIdentifier project, @NotNull java.lang.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 deletion
java.util.Set<ImmutableChain> getFavouritePlans(@NotNull com.atlassian.user.User user)
@NotNull java.util.Set<ImmutableChain> filterFavouritedPlans(@NotNull java.util.Collection<? extends ImmutableChain> plans, @NotNull com.atlassian.user.User user)
Plan
s that are a subset of the given TopLevelPlan
s
collection that are favourited by the User
plans
- to filteruser
- to return the favourites of
Chain
s that are a subset of the given TopLevelPlan
s collection that are favourited by the User
@NotNull <T extends Plan> java.util.Collection<T> getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
Plan
s that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given type
int getPlanCount()
Buildable
's exists<T extends Plan> int getPlanCount(java.lang.Class<T> planType)
Class
currently exist
planType
- - the type of the plan to retrieve
boolean isChainNameConflicting(@NotNull java.lang.String projectKey, long planIdToIgnore, @NotNull java.lang.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 installation
planKey
- key of the plan to be searched for in the database
@Nullable @Deprecated <T extends Plan> T getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey, @NotNull java.lang.String planName, java.lang.Class<T> planType) throws IncorrectPlanTypeException
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable java.lang.Class<? extends Plan> getPlanClass(@NotNull PlanKey planKey)
boolean assertPlanPermission(@NotNull PlanIdentifier plan)
plan
- to check the permissions of
boolean isPlanCreationAllowed()
void savePlan(@NotNull Plan plan)
Plan
plan
- to be savedvoid 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 java.util.Collection<java.lang.Long> stageIds)
Chain
key
- stageIds
- @Deprecated @Nullable <T extends Plan> T getPlanByKeyIfOfType(@NotNull java.lang.String planKey, @NotNull java.lang.Class<T> planType)
getPlanByKeyIfOfType(com.atlassian.bamboo.plan.PlanKey, java.lang.Class)
and PlanKeys.getPlanKey(String)
@Nullable @Deprecated Plan getPlanByKey(@NotNull java.lang.String planKey) throws IncorrectPlanTypeException
Plan
by its planKey
planKey
- of the plan to find
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable @Deprecated <T extends Plan> T getPlanByKey(@NotNull java.lang.String planKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
Plan
by its planKey and Class
planKey
- to search forplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable @Deprecated Plan getPlanByResultKey(@NotNull PlanResultKey planResultKey) throws IncorrectPlanTypeException
Plan
by a PlanResultKey
planResultKey
- to look for the parent plan
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable @Deprecated <T extends Plan> T getPlanByResultKey(@NotNull PlanResultKey planResultKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
Plan
from a PlanResultKey
and Class
planResultKey
- to look for the parent planplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Deprecated void setPlanSuspendedState(Plan plan, boolean newState)
setPlanSuspendedState(PlanKey, boolean)
instead
plan
- to be suspended/resumed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |