com.atlassian.bamboo.deployments.environments.service
Interface EnvironmentTaskService

All Known Implementing Classes:
EnvironmentTaskServiceImpl

public interface EnvironmentTaskService

Services and functionality for dealing with tasks of environments.


Method Summary
 TaskDefinition createTask(long environmentId, TaskModuleDescriptor taskDescriptor, java.lang.String userDescription, boolean isEnabled, java.util.Map<java.lang.String,java.lang.String> configuration)
          Create a new task in the environment
 void deleteTask(long environmentId, long taskId)
          Delete a task from the environment
 TaskDefinition editTask(long environmentId, long taskId, java.lang.String userDescription, boolean isEnabled, java.util.Map<java.lang.String,java.lang.String> taskConfigurationMap)
          Edit an existing task in the environment
 void moveFinalBar(long environmentId, long beforeId, long afterId)
          Moves the final Bar to a specific location in the list.
 void moveTask(long environmentId, long taskId, long beforeId, long afterId, boolean isFinal)
          Move a taskDefinition from one spot in its list, to another.
 void updateRepositoryIdsInTasks(Environment environment, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
           
 

Method Detail

createTask

TaskDefinition createTask(long environmentId,
                          @NotNull
                          TaskModuleDescriptor taskDescriptor,
                          @Nullable
                          java.lang.String userDescription,
                          boolean isEnabled,
                          @NotNull
                          java.util.Map<java.lang.String,java.lang.String> configuration)
                          throws java.lang.IllegalArgumentException
Create a new task in the environment

Parameters:
environmentId - environment task belongs to
taskDescriptor - of the task type
userDescription - of the configured task
isEnabled - is the Task Enabled
configuration - map of all data to be saved for the task.
Returns:
created taskDefinition
Throws:
java.lang.IllegalArgumentException - if no environment with environmentId can be found

editTask

TaskDefinition editTask(long environmentId,
                        long taskId,
                        java.lang.String userDescription,
                        boolean isEnabled,
                        java.util.Map<java.lang.String,java.lang.String> taskConfigurationMap)
Edit an existing task in the environment

Parameters:
environmentId - environment task belongs to
taskId - of the task being edited
userDescription - user defined description of the configured task
isEnabled - is the Task Enabled
taskConfigurationMap - map of all data to be saved for the task.
Returns:
taskDefinition with changes applied

deleteTask

void deleteTask(long environmentId,
                long taskId)
Delete a task from the environment

Parameters:
environmentId - environment task belongs to
taskId - task to delete

moveTask

void moveTask(long environmentId,
              long taskId,
              long beforeId,
              long afterId,
              boolean isFinal)
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:
environmentId - the environment 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 environment does not exist, 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.

moveFinalBar

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

Parameters:
environmentId - - the environment 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 environment does not exist
java.lang.IllegalStateException - if task list has changed since move requested

updateRepositoryIdsInTasks

void updateRepositoryIdsInTasks(@NotNull
                                Environment environment,
                                java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)


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