Package com.atlassian.bamboo.plan.move
Class MovePlanServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.plan.move.MovePlanServiceImpl
-
- All Implemented Interfaces:
MovePlanService
public class MovePlanServiceImpl extends Object implements MovePlanService
-
-
Constructor Summary
Constructors Constructor Description MovePlanServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<PlanKey,PlanKey>
movePlansToProject(Collection<TopLevelPlan> plans, Project newProject, Map<String,String> planIdMappings, Map<String,String> planKeyMappings, Map<String,String> planNameMappings)
Moves a list of plans to a new project.void
validatePlanKeysAndNamesForProject(com.atlassian.struts.ValidationAware validationAware, Project project, Map<String,String> planKeyMappings, Map<String,String> planNameMappings)
Validates a list of plan names and keys against a single project.void
validateUsageOfProjectResources(@NotNull com.atlassian.struts.ValidationAware validationAware, Collection<TopLevelPlan> plans)
Validate if source plans don't use project repositories or shared credentials.
-
-
-
Method Detail
-
validatePlanKeysAndNamesForProject
public void validatePlanKeysAndNamesForProject(com.atlassian.struts.ValidationAware validationAware, Project project, Map<String,String> planKeyMappings, Map<String,String> planNameMappings)
Description copied from interface:MovePlanService
Validates a list of plan names and keys against a single project. Ensures that the plan names and keys don't conflict with each other or any existing plans/branches in the project.- Specified by:
validatePlanKeysAndNamesForProject
in interfaceMovePlanService
- Parameters:
validationAware
- - to add errors toproject
- - project to validate plans againstplanKeyMappings
- - Map of a temporary index to plan key, of plans to validateplanNameMappings
- - Map of a temporary index to plan name, of plans to validate
-
validateUsageOfProjectResources
public void validateUsageOfProjectResources(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, Collection<TopLevelPlan> plans)
Description copied from interface:MovePlanService
Validate if source plans don't use project repositories or shared credentials.- Specified by:
validateUsageOfProjectResources
in interfaceMovePlanService
- Parameters:
validationAware
- - to add errors toplans
- - source plans
-
movePlansToProject
public Map<PlanKey,PlanKey> movePlansToProject(Collection<TopLevelPlan> plans, Project newProject, Map<String,String> planIdMappings, Map<String,String> planKeyMappings, Map<String,String> planNameMappings) throws MovePlansException
Description copied from interface:MovePlanService
Moves a list of plans to a new project. Assumes plan Key and name validation already complete.- Specified by:
movePlansToProject
in interfaceMovePlanService
- Parameters:
plans
- to movenewProject
- to move toplanIdMappings
- temporary index/id for each plan to moveplanKeyMappings
- temporary index/key for each plan to move (may be the same or new but must be already validated)planNameMappings
- temporaryindex/name for each plan to move (may be the same or new but must be already validated)- Returns:
- Map of oldKey to newKey for all plans moved
- Throws:
MovePlansException
- if a plan move fails. Plans previously moved will not be rolled back, all future plans to be moved will be aborted. The map of oldKey to newKey of already moved plans can be found in the Exception.
-
-