Interface MovePlanService

  • All Known Implementing Classes:
    MovePlanServiceImpl

    public interface MovePlanService
    Service for moving plans between projects
    Since:
    v4.0
    • Method Detail

      • validatePlanKeysAndNamesForProject

        void validatePlanKeysAndNamesForProject​(com.atlassian.struts.ValidationAware validationAware,
                                                Project newProject,
                                                Map<String,​String> planKeyMappings,
                                                Map<String,​String> planNameMappings)
        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.
        Parameters:
        validationAware - - to add errors to
        newProject - - project to validate plans against
        planKeyMappings - - Map of a temporary index to plan key, of plans to validate
        planNameMappings - - Map of a temporary index to plan name, of plans to validate
      • validateUsageOfProjectResources

        void validateUsageOfProjectResources​(@NotNull
                                             @NotNull com.atlassian.struts.ValidationAware validationAware,
                                             Collection<TopLevelPlan> plans)
        Validate if source plans don't use project repositories or shared credentials.
        Parameters:
        validationAware - - to add errors to
        plans - - source plans
      • movePlansToProject

        Map<PlanKey,​PlanKey> movePlansToProject​(Collection<TopLevelPlan> plans,
                                                      Project project,
                                                      Map<String,​String> planIdMappings,
                                                      Map<String,​String> planKeyMappings,
                                                      Map<String,​String> planNameMappings)
                                               throws MovePlansException
        Moves a list of plans to a new project. Assumes plan Key and name validation already complete.
        Parameters:
        plans - to move
        project - to move to
        planIdMappings - temporary index/id for each plan to move
        planKeyMappings - 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.