com.atlassian.bamboo.task
Interface TaskConfigurationService

All Known Implementing Classes:
TaskConfigurationServiceImpl

public interface TaskConfigurationService

Service to perform task manipulation actions. Helps manage concurrency of manipulations

Since:
3.1

Method Summary
 TaskDefinition createTask(PlanKey planKey, TaskModuleDescriptor taskDescriptor, java.lang.String userDescription, boolean isEnabled, java.util.Map<java.lang.String,java.lang.String> configuration, TaskRootDirectorySelector taskRootDirectorySelector)
          Create a task Definition and save it against the plan
 void createTaskList(PlanKey planKey, java.util.List<TaskDefinition> taskDefinitions)
          Initializes task list of a plan with the provided list.
 void deleteTask(PlanKey planKey, long taskId)
          Delete a given taskDefinition
 TaskDefinition editTask(PlanKey planKey, long taskId, java.lang.String userDescription, boolean isEnabled, java.util.Map<java.lang.String,java.lang.String> taskConfigurationMap, TaskRootDirectorySelector taskRootDirectorySelector)
          Update the details of specific taskDefinition
 java.util.List<TaskDefinition> getRelevantTasksForRepositoryId(ImmutableJob job, long repositoryId)
          Return relevant TaskDefinition for given Job and repositoryId
 java.util.Collection<Requirement> getTasksRequirements(PlanKey planKey)
          Return Requirements for all tasks of Plan represented by PlanKey
 void moveFinalBar(PlanKey planKey, long beforeId, long afterId)
          Moves the final Bar to a specific location in the list.
 void moveTask(PlanKey planKey, long taskId, long beforeId, long afterId, boolean isFinal)
          Move a taskDefinition from one spot in its list, to another.
 TaskDefinition setTaskState(PlanKey planKey, long taskId, boolean isEnabled)
          Update the disable state of specific taskDefinition
 void updateRepositoryIdsInJobsTasks(Job job, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
          Updates task configurations affected by repository edition.
 

Method Detail

createTask

TaskDefinition createTask(@NotNull
                          PlanKey planKey,
                          @NotNull
                          TaskModuleDescriptor taskDescriptor,
                          @Nullable
                          java.lang.String userDescription,
                          boolean isEnabled,
                          @NotNull
                          java.util.Map<java.lang.String,java.lang.String> configuration,
                          @NotNull
                          TaskRootDirectorySelector taskRootDirectorySelector)
                          throws java.lang.IllegalArgumentException
Create a task Definition and save it against the plan

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
Throws:
java.lang.IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a buildable)

moveTask

void moveTask(@NotNull
              PlanKey planKey,
              long taskId,
              long beforeId,
              long afterId,
              boolean isFinal)
              throws java.lang.IllegalArgumentException,
                     java.lang.IllegalStateException
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.

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.
Throws:
java.lang.IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a buildable), or the task to move doesn't exist
java.lang.IllegalStateException - if the task list is not in the expected order, i.e there have been incompatable changes made to the list since the move request was sent.

deleteTask

void deleteTask(@NotNull
                PlanKey planKey,
                long taskId)
                throws java.lang.IllegalArgumentException,
                       java.lang.IllegalStateException
Delete a given taskDefinition

Parameters:
planKey - for the plan to delete the TaskDefinition from
taskId - of the TaskDefinition to delete.
Throws:
java.lang.IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a buildable),
java.lang.IllegalStateException - if the task list has changed since submitting request, i.e the task isn't there to delete anymore.

editTask

TaskDefinition editTask(@NotNull
                        PlanKey planKey,
                        long taskId,
                        @Nullable
                        java.lang.String userDescription,
                        boolean isEnabled,
                        @NotNull
                        java.util.Map<java.lang.String,java.lang.String> taskConfigurationMap,
                        @NotNull
                        TaskRootDirectorySelector taskRootDirectorySelector)
                        throws java.lang.IllegalArgumentException
Update the details of specific taskDefinition

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:
java.lang.IllegalArgumentException - if planKey or taskId is invalid.

setTaskState

TaskDefinition setTaskState(@NotNull
                            PlanKey planKey,
                            long taskId,
                            boolean isEnabled)
                            throws java.lang.IllegalArgumentException
Update the disable state of specific taskDefinition

Parameters:
planKey - - the plan the taskDefintion belongs to, must be buildable
taskId - - the taskDefinition to edit
isEnabled - - set new enabled/disabled state
Returns:
TaskDefinition with updates.
Throws:
java.lang.IllegalArgumentException - if planKey or taskId is invalid.

moveFinalBar

void moveFinalBar(PlanKey planKey,
                  long beforeId,
                  long afterId)
                  throws java.lang.IllegalArgumentException,
                         java.lang.IllegalStateException
Moves the final Bar to a specific location in the list.

Parameters:
planKey - - the plan the task list belongs to
beforeId - - the id of the task we want before the bar, -1 if beginning of list
afterId - - the id of the task we want after the bar, -1 if end of list
Throws:
java.lang.IllegalArgumentException - if plan does not exist
java.lang.IllegalStateException - if task list has changed since move requested

createTaskList

void createTaskList(PlanKey planKey,
                    @NotNull
                    java.util.List<TaskDefinition> taskDefinitions)
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.

Parameters:
planKey - - the plan the task list belongs to
taskDefinitions - - list of the tasks to be added
Throws:
java.lang.IllegalArgumentException - if plan does not exist

getTasksRequirements

@NotNull
java.util.Collection<Requirement> getTasksRequirements(@NotNull
                                                               PlanKey planKey)
Return Requirements for all tasks of Plan represented by PlanKey

Parameters:
planKey -
Returns:
requirements for the Jobs TaskTypes
Throws:
java.lang.IllegalArgumentException - if plan does not exist
java.lang.IllegalStateException

updateRepositoryIdsInJobsTasks

void updateRepositoryIdsInJobsTasks(@NotNull
                                    Job job,
                                    java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
Updates task configurations affected by repository edition.

Parameters:
job -
repositoryIdsChanges - mapping between old and new repositories ids
Since:
3.3

getRelevantTasksForRepositoryId

java.util.List<TaskDefinition> getRelevantTasksForRepositoryId(@NotNull
                                                               ImmutableJob job,
                                                               long repositoryId)
Return relevant TaskDefinition for given Job and repositoryId

Parameters:
job -
repositoryId -
Returns:


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.