Package com.atlassian.bamboo.task
Class TaskManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.task.TaskManagerImpl
-
- All Implemented Interfaces:
TaskManager
@Internal public class TaskManagerImpl extends Object implements TaskManager
-
-
Field Summary
Fields Modifier and Type Field Description static Requirement
DOCKERBOX_REQUIREMENT
Referential DockerBox requirement
-
Constructor Summary
Constructors Constructor Description TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor, CapabilitySetManager capabilitySetManager, ElasticAccountBean elasticAccountBean, VcsRepositoryManager vcsRepositoryManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateRequirementsForTaskDefinition(@NotNull Job job, @NotNull TaskDefinition taskDefinition)
Attempts to addRequirement
s to the specifiedBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculatedvoid
calculateRequirementsForTaskDefinition(@NotNull Job job, @NotNull TaskDefinition taskDefinition, boolean dockerPipelinesEnabled)
Attempts to addRequirement
s to the specifiedBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculatedvoid
calculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier)
Attempts to addRequirement
s to the specifiedRequirementSet
.void
calculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier, boolean dockerPipelinesEnabled)
Attempts to addRequirement
s to the specifiedRequirementSet
.@NotNull List<TaskModuleDescriptor>
getAvailableBuildTaskDescriptors()
@NotNull List<TaskModuleDescriptor>
getAvailableDeploymentTaskDescriptors()
@NotNull List<TaskModuleDescriptor>
getAvailableTaskDescriptors()
Set<String>
getCapabilitiesWithExecutables(@NotNull Set<String> interestingExecutableTypes)
Returns a set of capabilities that have executable types defined for them in the system.Map<String,String>
getExecutableLabelTypeMap()
Returns a map of currently available "configured" executables - uniquely identified by a label.@NotNull com.google.common.collect.Multimap<String,String>
getExecutableLabelTypesMap()
Returns a map of currently available "configured" executables - identified by a label.@Nullable TaskModuleDescriptor
getTaskDescriptor(@Nullable String pluginKey)
Get the task type descriptor matching a particular plugin key.@NotNull Collection<Requirement>
getTasksRequirements(@NotNull Job job)
ReturnRequirement
s for all tasks ofBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
void
recalculateRequirementsForJob(Job job, boolean dockerPipelinesEnabled)
Recalculates requirements for job with given docker pipelines flag.void
removeRequirementsForTaskDefinition(@NotNull Buildable buildable, @NotNull TaskDefinition taskDefinition)
Removes all theRequirement
s that belong to theTaskDefinition
void
removeRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition)
Removes all theRequirement
s that belong to theTaskDefinition
boolean
taskProducesTestResults(@NotNull TaskDefinition taskDefinition)
Return true iff task defined inTaskDefinition
is configured to produce test results.void
updateRepositoryIdsInTask(@NotNull TaskDefinition taskDefinition, @NotNull Map<Long,Long> repositoryIdChanges)
Updates task configurations affected by repository edition.void
updateWorkingDirSelectors(@NotNull ImmutableBuildable job, @NotNull BuildDefinition buildDefinition, @NotNull Map<Long,Long> repositoryIdsChanges)
Calculates id of the repository that defines working directory after repository or task edition.
-
-
-
Field Detail
-
DOCKERBOX_REQUIREMENT
public static final Requirement DOCKERBOX_REQUIREMENT
Referential DockerBox requirement
-
-
Constructor Detail
-
TaskManagerImpl
public TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor, CapabilitySetManager capabilitySetManager, ElasticAccountBean elasticAccountBean, VcsRepositoryManager vcsRepositoryManager)
-
-
Method Detail
-
getTaskDescriptor
@Nullable public @Nullable TaskModuleDescriptor getTaskDescriptor(@Nullable @Nullable String pluginKey)
Description copied from interface:TaskManager
Get the task type descriptor matching a particular plugin key.- Specified by:
getTaskDescriptor
in interfaceTaskManager
- 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 @NotNull List<TaskModuleDescriptor> getAvailableTaskDescriptors()
- Specified by:
getAvailableTaskDescriptors
in interfaceTaskManager
- Returns:
- Provides a list of available tasks types. Returns both Build Tasks and DeploymentTasks
-
getAvailableBuildTaskDescriptors
@NotNull public @NotNull List<TaskModuleDescriptor> getAvailableBuildTaskDescriptors()
- Specified by:
getAvailableBuildTaskDescriptors
in interfaceTaskManager
- Returns:
- Provides a list of available build task types.
-
getAvailableDeploymentTaskDescriptors
@NotNull public @NotNull List<TaskModuleDescriptor> getAvailableDeploymentTaskDescriptors()
- Specified by:
getAvailableDeploymentTaskDescriptors
in interfaceTaskManager
- Returns:
- Provides a list of available deployment task types.
-
calculateRequirementsForTaskDefinition
public void calculateRequirementsForTaskDefinition(@NotNull @NotNull Job job, @NotNull @NotNull TaskDefinition taskDefinition, boolean dockerPipelinesEnabled)
Description copied from interface:TaskManager
Attempts to addRequirement
s to the specifiedBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculated- Specified by:
calculateRequirementsForTaskDefinition
in interfaceTaskManager
-
calculateRequirementsForTaskDefinition
public void calculateRequirementsForTaskDefinition(@NotNull @NotNull Job job, @NotNull @NotNull TaskDefinition taskDefinition)
Description copied from interface:TaskManager
Attempts to addRequirement
s to the specifiedBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculated- Specified by:
calculateRequirementsForTaskDefinition
in interfaceTaskManager
-
calculateRequirementsForTaskDefinition
public void calculateRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier)
Description copied from interface:TaskManager
Attempts to addRequirement
s to the specifiedRequirementSet
. How to get the requirements from the task Definition is determined by the supplier. If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculated- Specified by:
calculateRequirementsForTaskDefinition
in interfaceTaskManager
- Parameters:
requirementSet
- to add requirements update requirements intaskDefinition
- to calculate requirements from
-
calculateRequirementsForTaskDefinition
public void calculateRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier, boolean dockerPipelinesEnabled)
Description copied from interface:TaskManager
Attempts to addRequirement
s to the specifiedRequirementSet
. How to get the requirements from the task Definition is determined by the supplier. If requirements are already present for the specifiedTaskDefinition
they will be removed and recalculated. If docker pipelines is enabled than requirements from requirementSupplier won't be added toRequirementSet
, instead of this docker requirement will be added.- Specified by:
calculateRequirementsForTaskDefinition
in interfaceTaskManager
- Parameters:
requirementSet
- to add requirements update requirements intaskDefinition
- to calculate requirements fromdockerPipelinesEnabled
- flag for docker pipelines
-
removeRequirementsForTaskDefinition
public void removeRequirementsForTaskDefinition(@NotNull @NotNull Buildable buildable, @NotNull @NotNull TaskDefinition taskDefinition)
Description copied from interface:TaskManager
Removes all theRequirement
s that belong to theTaskDefinition
- Specified by:
removeRequirementsForTaskDefinition
in interfaceTaskManager
- Parameters:
buildable
- to remove requirements fromtaskDefinition
- that was removed
-
removeRequirementsForTaskDefinition
public void removeRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition)
Description copied from interface:TaskManager
Removes all theRequirement
s that belong to theTaskDefinition
- Specified by:
removeRequirementsForTaskDefinition
in interfaceTaskManager
- Parameters:
requirementSet
- to remove requirements fromtaskDefinition
- that was removed
-
updateRepositoryIdsInTask
public void updateRepositoryIdsInTask(@NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull Map<Long,Long> repositoryIdChanges)
Description copied from interface:TaskManager
Updates task configurations affected by repository edition.- Specified by:
updateRepositoryIdsInTask
in interfaceTaskManager
repositoryIdChanges
- mapping between old and new repositories ids
-
updateWorkingDirSelectors
public void updateWorkingDirSelectors(@NotNull @NotNull ImmutableBuildable job, @NotNull @NotNull BuildDefinition buildDefinition, @NotNull @NotNull Map<Long,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 interfaceTaskManager
- Parameters:
job
- affected jobrepositoryIdsChanges
- mapping between old and new repositories ids
-
getTasksRequirements
@NotNull public @NotNull Collection<Requirement> getTasksRequirements(@NotNull @NotNull Job job)
Description copied from interface:TaskManager
ReturnRequirement
s for all tasks ofBuildable
if theTaskConfigurator
is an implementor ofBuildTaskRequirementSupport
- Specified by:
getTasksRequirements
in interfaceTaskManager
- Returns:
- requirements
-
taskProducesTestResults
public boolean taskProducesTestResults(@NotNull @NotNull TaskDefinition taskDefinition)
Description copied from interface:TaskManager
Return true iff task defined inTaskDefinition
is configured to produce test results.- Specified by:
taskProducesTestResults
in interfaceTaskManager
- Returns:
- producesTestResults
-
getExecutableLabelTypeMap
public Map<String,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 interfaceTaskManager
- Returns:
- executableTypeLabelMaps
-
getExecutableLabelTypesMap
@NotNull public @NotNull com.google.common.collect.Multimap<String,String> getExecutableLabelTypesMap()
Description copied from interface:TaskManager
Returns a map of currently available "configured" executables - identified by a label.Maps label -> collection of taskExecutableType.getExecutableKey().
The executables are backed by available capabilities system wide, filtered by executables which are actually activated in the plugin system.
- Specified by:
getExecutableLabelTypesMap
in interfaceTaskManager
- Returns:
- executableTypeLabelMultiMaps
-
getCapabilitiesWithExecutables
public Set<String> getCapabilitiesWithExecutables(@NotNull @NotNull Set<String> interestingExecutableTypes)
Description copied from interface:TaskManager
Returns a set of capabilities that have executable types defined for them in the system.- Specified by:
getCapabilitiesWithExecutables
in interfaceTaskManager
-
recalculateRequirementsForJob
public void recalculateRequirementsForJob(Job job, boolean dockerPipelinesEnabled)
Description copied from interface:TaskManager
Recalculates requirements for job with given docker pipelines flag.- Specified by:
recalculateRequirementsForJob
in interfaceTaskManager
-
-