@Internal public class TaskConfigurationServiceImpl extends Object implements TaskConfigurationService
| Constructor and Description |
|---|
TaskConfigurationServiceImpl(BuildDefinitionManager buildDefinitionManager,
TaskManager taskManager,
BuildDefinitionConverter buildDefinitionConverter,
com.opensymphony.xwork2.TextProvider textProvider,
PlanManager planManager,
AuditLogService auditLogService,
ScopedExclusionService scopedExclusionService) |
| Modifier and Type | Method and Description |
|---|---|
TaskDefinition |
createTask(PlanKey planKey,
TaskModuleDescriptor taskDescriptor,
String userDescription,
boolean isEnabled,
Map<String,String> configuration,
TaskRootDirectorySelector taskRootDirectorySelector)
Create a task Definition and save it against the plan
|
void |
createTaskList(PlanKey planKey,
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,
String userDescription,
boolean isEnabled,
Map<String,String> taskConfigurationMap,
TaskRootDirectorySelector taskRootDirectorySelector)
Update the details of specific taskDefinition
|
List<TaskDefinition> |
getRelevantTasksForRepositoryId(ImmutableJob job,
long repositoryId)
Return relevant
TaskDefinition for given Job and repositoryId |
protected TaskDefinition |
getTaskById(List<TaskDefinition> tasks,
long id) |
Collection<Requirement> |
getTasksRequirements(PlanKey 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 disabled)
Update the disable state of specific taskDefinition
|
void |
updateRepositoryIdsInJobsTasks(Job job,
Map<Long,Long> repositoryIdsChanges)
Updates task configurations affected by repository edition.
|
public TaskConfigurationServiceImpl(BuildDefinitionManager buildDefinitionManager, TaskManager taskManager, BuildDefinitionConverter buildDefinitionConverter, com.opensymphony.xwork2.TextProvider textProvider, PlanManager planManager, AuditLogService auditLogService, ScopedExclusionService scopedExclusionService)
public TaskDefinition createTask(@NotNull PlanKey planKey, @NotNull TaskModuleDescriptor taskDescriptor, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> configuration, @NotNull TaskRootDirectorySelector taskRootDirectorySelector)
TaskConfigurationServicecreateTask in interface TaskConfigurationServiceplanKey - of the plan to add the taskDefinition to, plan should be BuildabletaskDescriptor - for the taskDefinition to be addeduserDescription - description the user has specified for this taskDefinitionisEnabled - - set enabled/disabled state of the newly created taskconfiguration - configuration from the plugin for this taskDefinitiontaskRootDirectorySelector - - data defining root of working directory of taskTaskDefinition createdpublic void createTaskList(PlanKey planKey, @NotNull List<TaskDefinition> taskDefinitions)
TaskConfigurationServicecreateTaskList in interface TaskConfigurationServiceplanKey - - the plan the task list belongs totaskDefinitions - - list of the tasks to be addedpublic void moveTask(@NotNull
PlanKey planKey,
long taskId,
long beforeId,
long afterId,
boolean isFinal)
TaskConfigurationServicemoveTask in interface TaskConfigurationServiceplanKey - the plan 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.public void deleteTask(@NotNull
PlanKey planKey,
long taskId)
TaskConfigurationServicedeleteTask in interface TaskConfigurationServiceplanKey - for the plan to delete the TaskDefinition fromtaskId - of the TaskDefinition to delete.public TaskDefinition editTask(@NotNull PlanKey planKey, long taskId, @Nullable String userDescription, boolean isEnabled, @NotNull Map<String,String> taskConfigurationMap, @NotNull TaskRootDirectorySelector taskRootDirectorySelector) throws IllegalArgumentException
TaskConfigurationServiceeditTask in interface TaskConfigurationServiceplanKey - - the plan the taskDefintion belongs to, must be buildabletaskId - - the taskDefinition to edituserDescription - - new user descriptionisEnabled - - set new enabled/disabled statetaskConfigurationMap - - new task ConfigurationtaskRootDirectorySelector - - data defining root of working directory of taskTaskDefinition with updates.IllegalArgumentException - if planKey or taskId is invalid.public TaskDefinition setTaskState(@NotNull PlanKey planKey, long taskId, boolean disabled) throws IllegalArgumentException
TaskConfigurationServicesetTaskState in interface TaskConfigurationServiceplanKey - - the plan the taskDefintion belongs to, must be buildabletaskId - - the taskDefinition to editdisabled - - set new enabled/disabled stateTaskDefinition with updates.IllegalArgumentException - if planKey or taskId is invalid.public List<TaskDefinition> getRelevantTasksForRepositoryId(@NotNull ImmutableJob job, long repositoryId)
TaskConfigurationServiceTaskDefinition for given Job and repositoryIdgetRelevantTasksForRepositoryId in interface TaskConfigurationServicepublic void updateRepositoryIdsInJobsTasks(@NotNull
Job job,
Map<Long,Long> repositoryIdsChanges)
TaskConfigurationServiceupdateRepositoryIdsInJobsTasks in interface TaskConfigurationServicerepositoryIdsChanges - mapping between old and new repositories ids@NotNull public Collection<Requirement> getTasksRequirements(@NotNull PlanKey planKey)
TaskConfigurationServicegetTasksRequirements in interface TaskConfigurationServiceJobs TaskTypespublic void moveFinalBar(PlanKey planKey, long beforeId, long afterId) throws IllegalArgumentException, IllegalStateException
TaskConfigurationServicemoveFinalBar in interface TaskConfigurationServiceplanKey - - the plan 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 listIllegalArgumentException - if plan does not existIllegalStateException - if task list has changed since move requested@Nullable protected TaskDefinition getTaskById(@NotNull List<TaskDefinition> tasks, long id)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.