com.atlassian.bamboo.task
Class TaskManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.task.TaskManagerImpl
All Implemented Interfaces:
TaskManager

public class TaskManagerImpl
extends java.lang.Object
implements TaskManager


Constructor Summary
TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor, CapabilitySetManager capabilitySetManager, ElasticAccountBean elasticAccountBean)
           
 
Method Summary
 void calculateRequirementsForTaskDefinition(Job job, TaskDefinition taskDefinition)
          Attempts to add Requirements to the specified Buildable if the TaskConfigurator is an implementor of BuildTaskRequirementSupport If requirements are already present for the specified TaskDefinition they will be removed and recalculated
 void calculateRequirementsForTaskDefinition(RequirementSet requirementSet, TaskDefinition taskDefinition, com.google.common.base.Supplier<java.util.Set<Requirement>> requirementSupplier)
          Attempts to add Requirements to the specified RequirementSet.
 java.util.List<TaskModuleDescriptor> getAvailableBuildTaskDescriptors()
           
 java.util.List<TaskModuleDescriptor> getAvailableDeploymentTaskDescriptors()
           
 java.util.List<TaskModuleDescriptor> getAvailableTaskDescriptors()
           
 java.util.Map<java.lang.String,java.lang.String> getExecutableLabelTypeMap()
          Returns a map of currently available "configured" executables - uniquely identified by a label.
 TaskModuleDescriptor getTaskDescriptor(java.lang.String pluginKey)
          Get the task type descriptor matching a particular plugin key.
 java.util.Collection<Requirement> getTasksRequirements(Job job)
          Return Requirements for all tasks of Buildable if the TaskConfigurator is an implementor of BuildTaskRequirementSupport
 void removeRequirementsForTaskDefinition(Buildable buildable, TaskDefinition taskDefinition)
          Removes all the Requirements that belong to the TaskDefinition
 void removeRequirementsForTaskDefinition(RequirementSet requirementSet, TaskDefinition taskDefinition)
          Removes all the Requirements that belong to the TaskDefinition
 boolean taskProducesTestResults(TaskDefinition taskDefinition)
          Return true iff task defined in TaskDefinition is configured to produce test results.
 void updateRepositoryIdsInTask(Job job, TaskDefinition taskDefinition, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdChanges)
          Updates task configurations affected by repository edition.
 void updateRepositoryIdsInTask(TaskDefinition taskDefinition, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdChanges)
          Updates task configurations affected by repository edition.
 void updateWorkingDirSelectors(ImmutableBuildable job, BuildDefinition buildDefinition, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
          Calculates id of the repository that defines working directory after repository or task edition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskManagerImpl

public TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor,
                       CapabilitySetManager capabilitySetManager,
                       ElasticAccountBean elasticAccountBean)
Method Detail

getTaskDescriptor

@Nullable
public TaskModuleDescriptor getTaskDescriptor(@Nullable
                                                       java.lang.String pluginKey)
Description copied from interface: TaskManager
Get the task type descriptor matching a particular plugin key.

Specified by:
getTaskDescriptor in interface TaskManager
Parameters:
pluginKey - - key to match
Returns:
TaskModuleDescriptor matching the given key if it exists. Null if the plugin can not be found.

getAvailableTaskDescriptors

@NotNull
public java.util.List<TaskModuleDescriptor> getAvailableTaskDescriptors()
Specified by:
getAvailableTaskDescriptors in interface TaskManager
Returns:
Provides a list of available tasks types. Returns both Build Tasks and DeploymentTasks

getAvailableBuildTaskDescriptors

@NotNull
public java.util.List<TaskModuleDescriptor> getAvailableBuildTaskDescriptors()
Specified by:
getAvailableBuildTaskDescriptors in interface TaskManager
Returns:
Provides a list of available build task types.

getAvailableDeploymentTaskDescriptors

@NotNull
public java.util.List<TaskModuleDescriptor> getAvailableDeploymentTaskDescriptors()
Specified by:
getAvailableDeploymentTaskDescriptors in interface TaskManager
Returns:
Provides a list of available deployment task types.

calculateRequirementsForTaskDefinition

public void calculateRequirementsForTaskDefinition(@NotNull
                                                   Job job,
                                                   @NotNull
                                                   TaskDefinition taskDefinition)
Description copied from interface: TaskManager
Attempts to add Requirements to the specified Buildable if the TaskConfigurator is an implementor of BuildTaskRequirementSupport If requirements are already present for the specified TaskDefinition they will be removed and recalculated

Specified by:
calculateRequirementsForTaskDefinition in interface TaskManager

calculateRequirementsForTaskDefinition

public void calculateRequirementsForTaskDefinition(@NotNull
                                                   RequirementSet requirementSet,
                                                   @NotNull
                                                   TaskDefinition taskDefinition,
                                                   com.google.common.base.Supplier<java.util.Set<Requirement>> requirementSupplier)
Description copied from interface: TaskManager
Attempts to add Requirements to the specified RequirementSet. How to get the requirements from the task Definition is determined by the supplier. If requirements are already present for the specified TaskDefinition they will be removed and recalculated

Specified by:
calculateRequirementsForTaskDefinition in interface TaskManager
Parameters:
requirementSet - to add requirements update requirements in
taskDefinition - to calculate requirements from

removeRequirementsForTaskDefinition

public void removeRequirementsForTaskDefinition(@NotNull
                                                Buildable buildable,
                                                @NotNull
                                                TaskDefinition taskDefinition)
Description copied from interface: TaskManager
Removes all the Requirements that belong to the TaskDefinition

Specified by:
removeRequirementsForTaskDefinition in interface TaskManager
Parameters:
buildable - to remove requirements from
taskDefinition - that was removed

removeRequirementsForTaskDefinition

public void removeRequirementsForTaskDefinition(@NotNull
                                                RequirementSet requirementSet,
                                                @NotNull
                                                TaskDefinition taskDefinition)
Description copied from interface: TaskManager
Removes all the Requirements that belong to the TaskDefinition

Specified by:
removeRequirementsForTaskDefinition in interface TaskManager
Parameters:
requirementSet - to remove requirements from
taskDefinition - that was removed

updateRepositoryIdsInTask

public void updateRepositoryIdsInTask(@NotNull
                                      Job job,
                                      @NotNull
                                      TaskDefinition taskDefinition,
                                      @NotNull
                                      java.util.Map<java.lang.Long,java.lang.Long> repositoryIdChanges)
Description copied from interface: TaskManager
Updates task configurations affected by repository edition.

Specified by:
updateRepositoryIdsInTask in interface TaskManager
repositoryIdChanges - mapping between old and new repositories ids

updateRepositoryIdsInTask

public void updateRepositoryIdsInTask(@NotNull
                                      TaskDefinition taskDefinition,
                                      @NotNull
                                      java.util.Map<java.lang.Long,java.lang.Long> repositoryIdChanges)
Description copied from interface: TaskManager
Updates task configurations affected by repository edition.

Specified by:
updateRepositoryIdsInTask in interface TaskManager
repositoryIdChanges - mapping between old and new repositories ids

updateWorkingDirSelectors

public void updateWorkingDirSelectors(@NotNull
                                      ImmutableBuildable job,
                                      @NotNull
                                      BuildDefinition buildDefinition,
                                      @NotNull
                                      java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
Description copied from interface: TaskManager
Calculates id of the repository that defines working directory after repository or task edition.

Specified by:
updateWorkingDirSelectors in interface TaskManager
Parameters:
job - affected job
repositoryIdsChanges - mapping between old and new repositories ids

getTasksRequirements

@NotNull
public java.util.Collection<Requirement> getTasksRequirements(@NotNull
                                                                      Job job)
Description copied from interface: TaskManager
Return Requirements for all tasks of Buildable if the TaskConfigurator is an implementor of BuildTaskRequirementSupport

Specified by:
getTasksRequirements in interface TaskManager
Returns:
requirements

taskProducesTestResults

public boolean taskProducesTestResults(@NotNull
                                       TaskDefinition taskDefinition)
Description copied from interface: TaskManager
Return true iff task defined in TaskDefinition is configured to produce test results.

Specified by:
taskProducesTestResults in interface TaskManager
Returns:
producesTestResults

getExecutableLabelTypeMap

public java.util.Map<java.lang.String,java.lang.String> getExecutableLabelTypeMap()
Description copied from interface: TaskManager
Returns a map of currently available "configured" executables - uniquely identified by a label.

Maps label -> taskExecutableType.getExecutableKey().

The executables are backed by available capabilities system wide, filtered by executables which are actually activated in the plugin system.

Specified by:
getExecutableLabelTypeMap in interface TaskManager
Returns:
executableTypeLabelMaps


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