|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.migration.plan.PlanManagerDecorator
public class PlanManagerDecorator
Pass-through decorator for PlanManager
Constructor Summary | |
---|---|
PlanManagerDecorator(PlanManager planManager)
|
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<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)
Returns a Plan by its planKey |
|
|
getPlanByKey(java.lang.String planKey,
java.lang.Class<T> planType)
Returns a Plan by its planKey and Class |
|
|
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)
Returns a Plan by its planKey and if it's of the type Class . |
|
|
getPlanByName(java.lang.String projectKey,
java.lang.String planName,
java.lang.Class<T> planType)
Returns a Plan from a project with the given plan name and Class
It is not possible to use this method if the planType parameter is a marker interface type such as Plan ,
Buildable or TopLevelPlan since it is possible to have a Chain and a Job that share the same name. |
|
|
getPlanByPartialKeyAndName(PlanKey partialPlanKey,
java.lang.String planName,
java.lang.Class<T> planType)
Returns a Plan that matches the start of the given PlanKey and the full plan name |
|
Plan |
getPlanByResultKey(PlanResultKey planResultKey)
Returns a Plan by a PlanResultKey |
|
|
getPlanByResultKey(PlanResultKey planResultKey,
java.lang.Class<T> planType)
Returns a Plan from a PlanResultKey and Class |
|
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 |
|
|
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) |
|
java.util.Map<PlanKey,PlanKey> |
movePlanToProject(Plan plan,
Project project,
java.lang.String newPlanKey,
java.lang.String newBuildName)
Moves plan to a selected project. |
|
void |
savePlan(Plan plan)
Saves the Plan |
|
void |
setPlanSuspendedState(Plan plan,
boolean newState)
Persists enable/disable state of a plan. |
|
void |
triggerConfigUpdatedEventsForPlansInProject(Project project)
Triggers updated events for every plan in a project regardless of permissions. |
|
void |
updateNamesAndDescription(java.lang.String projectName,
java.lang.String buildName,
java.lang.String description,
Plan plan)
Updates project and plan names and plan description. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlanManagerDecorator(PlanManager planManager)
Method Detail |
---|
@Nullable public Plan getPlanById(long id) throws IncorrectPlanTypeException
PlanManager
Plan
by its id
getPlanById
in interface PlanManager
id
- of the plan
IncorrectPlanTypeException
- if plan cannot be found@Nullable public <T extends Plan> T getPlanById(long id, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
by its id and Class
getPlanById
in interface PlanManager
id
- of the planplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable public Plan getPlanByKey(@NotNull java.lang.String planKey) throws IncorrectPlanTypeException
PlanManager
Plan
by its planKey
getPlanByKey
in interface PlanManager
planKey
- of the plan to find
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable public PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull java.lang.String planKey)
PlanManager
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
getPlanIdentifierForPermissionCheckingByKey
in interface PlanManager
planKey
- of the plan to find
public java.lang.Class<? extends Plan> getPlanClass(@NotNull PlanKey planKey)
getPlanClass
in interface PlanManager
@Nullable public <T extends Plan> T getPlanByKey(@NotNull java.lang.String planKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
by its planKey and Class
getPlanByKey
in interface PlanManager
planKey
- to search forplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable public <T extends Plan> T getPlanByKeyIfOfType(@NotNull java.lang.String planKey, @NotNull java.lang.Class<T> planType)
PlanManager
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.
getPlanByKeyIfOfType
in interface PlanManager
@Nullable public <T extends Plan> T getPlanByKeyIfOfType(@NotNull PlanKey planKey, @NotNull java.lang.Class<T> planType)
PlanManager
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.
getPlanByKeyIfOfType
in interface PlanManager
planKey
- to search forplanType
- the type of the plan to retrieve
@Nullable public Plan getPlanByKey(@NotNull PlanKey planKey) throws IncorrectPlanTypeException
PlanManager
Plan
by its PlanKey
getPlanByKey
in interface PlanManager
planKey
- to search for
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)public boolean assertPlanPermission(@NotNull PlanIdentifier plan)
PlanManager
assertPlanPermission
in interface PlanManager
plan
- to check the permissions of
@Nullable public <T extends Plan> T getPlanByKey(@NotNull PlanKey planKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
by its PlanKey
and Class
getPlanByKey
in interface PlanManager
planKey
- to search forplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable public Plan getPlanByResultKey(@NotNull PlanResultKey planResultKey) throws IncorrectPlanTypeException
PlanManager
Plan
by a PlanResultKey
getPlanByResultKey
in interface PlanManager
planResultKey
- to look for the parent plan
IncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable public <T extends Plan> T getPlanByResultKey(@NotNull PlanResultKey planResultKey, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
from a PlanResultKey
and Class
getPlanByResultKey
in interface PlanManager
planResultKey
- to look for the parent planplanType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable public <T extends Plan> T getPlanByName(@NotNull java.lang.String projectKey, @NotNull java.lang.String planName, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
from a project with the given plan name and Class
It is not possible to use this method if the planType parameter is a marker interface type such as Plan
,
Buildable
or TopLevelPlan
since it is possible to have a Chain
and a Job
that share the same name.
getPlanByName
in interface PlanManager
projectKey
- of the project to look for the plan inplanName
- - name of the plan inside the project: this is just the plan component of the name (i.e does
not include the project component)planType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if the result is not uniquepublic boolean isChainNameConflicting(@NotNull java.lang.String projectKey, long planIdToIgnore, @NotNull java.lang.String planName)
PlanManager
Chain
name is unique with the given project
isChainNameConflicting
in interface PlanManager
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)
@Nullable public <T extends Plan> T getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey, @NotNull java.lang.String planName, java.lang.Class<T> planType) throws IncorrectPlanTypeException
PlanManager
Plan
that matches the start of the given PlanKey
and the full plan name
getPlanByPartialKeyAndName
in interface PlanManager
partialPlanKey
- - the start of the plan keyplanName
- - name of the plan to search for: this is just the plan component of the name (i.e does not
include the project component)planType
- - the type of the plan to retrieve
IncorrectPlanTypeException
- if plan cannot be found with the correct type@NotNull public java.util.List<TopLevelPlan> getAllPlans()
PlanManager
TopLevelPlan
's
getAllPlans
in interface PlanManager
public java.util.List<TopLevelPlan> getAllPlansUnrestricted()
PlanManager
TopLevelPlan
's ignoring permissions
getAllPlansUnrestricted
in interface PlanManager
@NotNull public <T extends Plan> java.util.List<T> getAllPlans(java.lang.Class<T> planType)
PlanManager
Plan
's filtered by Class
. Does not include plans marked for deletion.
getAllPlans
in interface PlanManager
planType
- - the type of the plan to retrieve
DescriptionProvider.getName()
@NotNull public java.util.List<TopLevelPlan> getPlansByProject(Project project)
PlanManager
TopLevelPlan
's filtered by Project
getPlansByProject
in interface PlanManager
project
- - that the plans will belong to
TopLevelPlan
plans contained within the given project@NotNull public <T extends Plan> java.util.List<T> getPlansByProject(Project project, java.lang.Class<T> planType)
PlanManager
Plan
's filtered by Project
and Class
getPlansByProject
in interface PlanManager
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve
@NotNull public <T extends Plan> java.util.List<T> getAllPlansByProject(Project project, java.lang.Class<T> planType)
PlanManager
Plan
's filtered by Project
and Class
, including the plans marked for
deletion.
getAllPlansByProject
in interface PlanManager
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve
@NotNull public <T extends Plan> java.util.Map<Project,java.util.Collection<T>> getProjectPlanMap(java.lang.Class<T> planType, boolean includeEmptyProjects)
PlanManager
Project
to Plan
of given type
getProjectPlanMap
in interface PlanManager
planType
- type of plan to be selected from DBincludeEmptyProjects
- should empty projects be included in result
Project
to Plan
of given typepublic int getPlanCount()
getPlanCount
in interface PlanManager
Buildable
's existspublic <T extends Plan> int getPlanCount(java.lang.Class<T> planType)
PlanManager
Class
currently exist
getPlanCount
in interface PlanManager
planType
- - the type of the plan to retrieve
public void savePlan(@NotNull Plan plan)
PlanManager
Plan
savePlan
in interface PlanManager
plan
- to be savedpublic void setPlanSuspendedState(Plan plan, boolean newState)
PlanManager
setPlanSuspendedState
in interface PlanManager
plan
- to be suspended/resumedpublic boolean isPlanCreationAllowed()
PlanManager
isPlanCreationAllowed
in interface PlanManager
public void updateNamesAndDescription(@NotNull java.lang.String projectName, @NotNull java.lang.String buildName, @Nullable java.lang.String description, @NotNull Plan plan)
PlanManager
updateNamesAndDescription
in interface PlanManager
projectName
- new name of the projectbuildName
- new name of the plandescription
- new plan descriptionplan
- to update the details ofpublic void createPlan(Plan plan)
PlanManager
createPlan
in interface PlanManager
public void deletePlan(Plan plan)
PlanManager
deletePlan
in interface PlanManager
plan
- to delete.public java.util.Map<PlanKey,PlanKey> movePlanToProject(Plan plan, Project project, java.lang.String newPlanKey, java.lang.String newBuildName)
PlanManager
movePlanToProject
in interface PlanManager
plan
- - plan to be moved/renamedproject
- - project plan should be moved tonewPlanKey
- - new key for the plan (not a full key)newBuildName
- - new name for the plan
public java.util.Set<ImmutableChain> getFavouritePlans(@NotNull com.atlassian.user.User user)
getFavouritePlans
in interface PlanManager
@NotNull public java.util.Set<ImmutableChain> filterFavouritedPlans(@NotNull java.util.Collection<? extends ImmutableChain> plans, @NotNull com.atlassian.user.User user)
PlanManager
Plan
s that are a subset of the given TopLevelPlan
s collection that are favourited by the User
filterFavouritedPlans
in interface PlanManager
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 public <T extends Plan> java.util.Collection<T> getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
PlanManager
Plan
s that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given type
getAllPlansMarkedForDeletion
in interface PlanManager
@NotNull public <T extends Plan> java.util.List<PlanIdentifier> getPlanIdentifiersForProject(ProjectIdentifier project, java.lang.Class<T> planType, boolean includeMarkedForDeletion)
PlanManager
getPlanIdentifiersForProject
in interface PlanManager
project
- to get plans forplanType
- to filter plans byincludeMarkedForDeletion
- set to true if you want to return plans marked for deletion
public void triggerConfigUpdatedEventsForPlansInProject(@NotNull Project project)
PlanManager
triggerConfigUpdatedEventsForPlansInProject
in interface PlanManager
project
- to trigger event for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |