Class TaskConfigurationServiceImpl

    • Method Detail

      • createTask

        public TaskDefinition createTask​(@NotNull
                                         @NotNull PlanKey planKey,
                                         @NotNull
                                         @NotNull TaskModuleDescriptor taskDescriptor,
                                         @Nullable
                                         @Nullable String userDescription,
                                         boolean isEnabled,
                                         @NotNull
                                         @NotNull Map<String,​String> configuration,
                                         @NotNull
                                         @NotNull TaskRootDirectorySelector taskRootDirectorySelector)
        Description copied from interface: TaskConfigurationService
        Create a task Definition and save it against the plan
        Specified by:
        createTask in interface TaskConfigurationService
        Parameters:
        planKey - of the plan to add the taskDefinition to, plan should be Buildable
        taskDescriptor - for the taskDefinition to be added
        userDescription - description the user has specified for this taskDefinition
        isEnabled - - set enabled/disabled state of the newly created task
        configuration - configuration from the plugin for this taskDefinition
        taskRootDirectorySelector - - data defining root of working directory of task
        Returns:
        the TaskDefinition created
      • createTask

        public TaskDefinition createTask​(@NotNull
                                         @NotNull PlanKey planKey,
                                         @NotNull
                                         @NotNull TaskModuleDescriptor taskDescriptor,
                                         @Nullable
                                         @Nullable String userDescription,
                                         boolean isEnabled,
                                         @NotNull
                                         @NotNull List<TaskConditionConfig> conditions,
                                         @NotNull
                                         @NotNull Map<String,​String> configuration,
                                         @NotNull
                                         @NotNull TaskRootDirectorySelector taskRootDirectorySelector)
        Description copied from interface: TaskConfigurationService
        Create a task Definition and save it against the plan
        Specified by:
        createTask in interface TaskConfigurationService
        Parameters:
        planKey - of the plan to add the taskDefinition to, plan should be Buildable
        taskDescriptor - for the taskDefinition to be added
        userDescription - description the user has specified for this taskDefinition
        isEnabled - - set enabled/disabled state of the newly created task
        conditions - - task conditions
        configuration - configuration from the plugin for this taskDefinition
        taskRootDirectorySelector - - data defining root of working directory of task
        Returns:
        the TaskDefinition created
      • createTaskList

        public void createTaskList​(PlanKey planKey,
                                   @NotNull
                                   @NotNull List<TaskDefinition> taskDefinitions)
        Description copied from interface: TaskConfigurationService
        Initializes task list of a plan with the provided list. WARNING: If plan has existing tasks they are erased. It is assumed that the list is well-formed (i.e. ids are properly initialized) It can be used when automatically creating Jobs.
        Specified by:
        createTaskList in interface TaskConfigurationService
        Parameters:
        planKey - - the plan the task list belongs to
        taskDefinitions - - list of the tasks to be added
      • moveTask

        public void moveTask​(@NotNull
                             @NotNull PlanKey planKey,
                             long taskId,
                             long beforeId,
                             long afterId,
                             boolean isFinal)
        Description copied from interface: TaskConfigurationService
        Move a taskDefinition from one spot in its list, to another. And save changes. Uses the before and after tasks to ensure that the task list is in the same state the user saw when editing.
        Specified by:
        moveTask in interface TaskConfigurationService
        Parameters:
        planKey - the plan the taskDefinition is in
        taskId - ID of the TaskDefinition to move
        beforeId - ID of the taskDefinition that will be before the moving Task, -1 if the beginning of the list
        afterId - ID of the taskDefinition that will be after the moving Task, -1 if the end of the list
        isFinal - whether the task being moved is finalising or not, may or may not require changing.
      • deleteTask

        public void deleteTask​(@NotNull
                               @NotNull PlanKey planKey,
                               long taskId)
        Description copied from interface: TaskConfigurationService
        Delete a given taskDefinition
        Specified by:
        deleteTask in interface TaskConfigurationService
        Parameters:
        planKey - for the plan to delete the TaskDefinition from
        taskId - of the TaskDefinition to delete.
      • editTask

        public TaskDefinition editTask​(@NotNull
                                       @NotNull PlanKey planKey,
                                       long taskId,
                                       @Nullable
                                       @Nullable String userDescription,
                                       boolean isEnabled,
                                       @NotNull
                                       @NotNull Map<String,​String> taskConfigurationMap,
                                       @NotNull
                                       @NotNull TaskRootDirectorySelector taskRootDirectorySelector)
                                throws IllegalArgumentException
        Description copied from interface: TaskConfigurationService
        Update the details of specific taskDefinition
        Specified by:
        editTask in interface TaskConfigurationService
        Parameters:
        planKey - - the plan the taskDefintion belongs to, must be buildable
        taskId - - the taskDefinition to edit
        userDescription - - new user description
        isEnabled - - set new enabled/disabled state
        taskConfigurationMap - - new task Configuration
        taskRootDirectorySelector - - data defining root of working directory of task
        Returns:
        TaskDefinition with updates.
        Throws:
        IllegalArgumentException - if planKey or taskId is invalid.