Class EnvironmentTaskServiceImpl
java.lang.Object
com.atlassian.bamboo.deployments.environments.service.EnvironmentTaskServiceImpl
- All Implemented Interfaces:
EnvironmentTaskService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull TaskDefinition
createTask
(long environmentId, @NotNull TaskModuleDescriptor taskDescriptor, @Nullable String userDescription, boolean isEnabled, @NotNull List<TaskConditionConfig> conditions, @NotNull Map<String, String> configuration) Create a new task in the environment@NotNull TaskDefinition
createTask
(long environmentId, @NotNull TaskModuleDescriptor taskDescriptor, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String, String> configuration) Create a new task in the environmentvoid
deleteTask
(long environmentId, long taskId) Delete a task from the environmenteditTask
(long environmentId, long taskId, String userDescription, boolean isEnabled, @NotNull List<TaskConditionConfig> conditions, Map<String, String> taskConfigurationMap) Edit an existing task in the environmenteditTask
(long environmentId, long taskId, String userDescription, boolean isEnabled, Map<String, String> taskConfigurationMap) Edit an existing task in the environmentprotected @Nullable TaskDefinition
getTaskById
(@NotNull List<TaskDefinition> tasks, long id) 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
(@NotNull Environment environment, Map<Long, Long> repositoryIdsChanges)
-
Constructor Details
-
EnvironmentTaskServiceImpl
public EnvironmentTaskServiceImpl()
-
-
Method Details
-
createTask
@NotNull public @NotNull TaskDefinition createTask(long environmentId, @NotNull @NotNull TaskModuleDescriptor taskDescriptor, @Nullable @Nullable String userDescription, boolean isEnabled, @NotNull @NotNull Map<String, String> configuration) throws IllegalArgumentExceptionDescription copied from interface:EnvironmentTaskService
Create a new task in the environment- Specified by:
createTask
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- environment task belongs totaskDescriptor
- of the task typeuserDescription
- of the configured taskisEnabled
- is the Task Enabledconfiguration
- map of all data to be saved for the task.- Returns:
- created taskDefinition
- Throws:
IllegalArgumentException
- if no environment with environmentId can be found
-
createTask
@NotNull public @NotNull TaskDefinition createTask(long environmentId, @NotNull @NotNull TaskModuleDescriptor taskDescriptor, @Nullable @Nullable String userDescription, boolean isEnabled, @NotNull @NotNull List<TaskConditionConfig> conditions, @NotNull @NotNull Map<String, String> configuration) throws IllegalArgumentExceptionDescription copied from interface:EnvironmentTaskService
Create a new task in the environment- Specified by:
createTask
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- environment task belongs totaskDescriptor
- of the task typeuserDescription
- of the configured taskisEnabled
- is the Task Enabledconditions
- task conditionsconfiguration
- map of all data to be saved for the task.- Returns:
- created taskDefinition
- Throws:
IllegalArgumentException
- if no environment with environmentId can be found
-
editTask
public TaskDefinition editTask(long environmentId, long taskId, String userDescription, boolean isEnabled, Map<String, String> taskConfigurationMap) Description copied from interface:EnvironmentTaskService
Edit an existing task in the environment- Specified by:
editTask
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- environment task belongs totaskId
- of the task being editeduserDescription
- user defined description of the configured taskisEnabled
- is the Task EnabledtaskConfigurationMap
- map of all data to be saved for the task.- Returns:
- taskDefinition with changes applied
-
editTask
public TaskDefinition editTask(long environmentId, long taskId, String userDescription, boolean isEnabled, @NotNull @NotNull List<TaskConditionConfig> conditions, Map<String, String> taskConfigurationMap) Description copied from interface:EnvironmentTaskService
Edit an existing task in the environment- Specified by:
editTask
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- environment task belongs totaskId
- of the task being editeduserDescription
- user defined description of the configured taskisEnabled
- is the Task EnabledtaskConfigurationMap
- map of all data to be saved for the task.- Returns:
- taskDefinition with changes applied
-
deleteTask
public void deleteTask(long environmentId, long taskId) Description copied from interface:EnvironmentTaskService
Delete a task from the environment- Specified by:
deleteTask
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- environment task belongs totaskId
- task to delete
-
moveTask
public void moveTask(long environmentId, long taskId, long beforeId, long afterId, boolean isFinal) Description copied from interface:EnvironmentTaskService
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 interfaceEnvironmentTaskService
- Parameters:
environmentId
- the environment the taskDefinition is intaskId
- ID of the TaskDefinition to movebeforeId
- ID of the taskDefinition that will be before the moving Task, -1 if the beginning of the listafterId
- ID of the taskDefinition that will be after the moving Task, -1 if the end of the listisFinal
- whether the task being moved is finalising or not, may or may not require changing.
-
moveFinalBar
public void moveFinalBar(long environmentId, long beforeId, long afterId) throws IllegalArgumentException, IllegalStateException Description copied from interface:EnvironmentTaskService
Moves the final Bar to a specific location in the list.- Specified by:
moveFinalBar
in interfaceEnvironmentTaskService
- Parameters:
environmentId
- - the environment the task list belongs tobeforeId
- - the id of the task we want before the bar, -1 if beginning of listafterId
- - the id of the task we want after the bar, -1 if end of list- Throws:
IllegalArgumentException
- if environment does not existIllegalStateException
- if task list has changed since move requested
-
updateRepositoryIdsInTasks
public void updateRepositoryIdsInTasks(@NotNull @NotNull Environment environment, Map<Long, Long> repositoryIdsChanges) - Specified by:
updateRepositoryIdsInTasks
in interfaceEnvironmentTaskService
-
getTaskById
@Nullable protected @Nullable TaskDefinition getTaskById(@NotNull @NotNull List<TaskDefinition> tasks, long id)
-