@Internal public class TaskManagerImpl extends Object implements TaskManager
Modifier and Type | Field and Description |
---|---|
static Requirement |
DOCKERBOX_REQUIREMENT
Referential DockerBox requirement
|
Constructor and Description |
---|
TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor,
CapabilitySetManager capabilitySetManager,
ElasticAccountBean elasticAccountBean,
VcsRepositoryManager vcsRepositoryManager) |
Modifier and Type | Method and Description |
---|---|
void |
calculateRequirementsForTaskDefinition(Job job,
TaskDefinition taskDefinition)
Attempts to add
Requirement s 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,
Supplier<Set<Requirement>> requirementSupplier)
Attempts to add
Requirement s to the specified RequirementSet . |
void |
calculateRequirementsForTaskDefinition(RequirementSet requirementSet,
TaskDefinition taskDefinition,
Supplier<Set<Requirement>> requirementSupplier,
boolean dockerPipelinesEnabled)
Attempts to add
Requirement s to the specified RequirementSet . |
List<TaskModuleDescriptor> |
getAvailableBuildTaskDescriptors() |
List<TaskModuleDescriptor> |
getAvailableDeploymentTaskDescriptors() |
List<TaskModuleDescriptor> |
getAvailableTaskDescriptors() |
Set<String> |
getCapabilitiesWithExecutables(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.
|
com.google.common.collect.Multimap<String,String> |
getExecutableLabelTypesMap()
Returns a map of currently available "configured" executables - identified by a label.
|
TaskModuleDescriptor |
getTaskDescriptor(String pluginKey)
Get the task type descriptor matching a particular plugin key.
|
Collection<Requirement> |
getTasksRequirements(Job job)
Return
Requirement s for all tasks of Buildable if the TaskConfigurator is an implementor of BuildTaskRequirementSupport |
void |
recalculateRequirementsForJob(Job job,
boolean dockerPipelinesEnabled)
Recalculates requirements for job with given docker pipelines flag.
|
void |
removeRequirementsForTaskDefinition(Buildable buildable,
TaskDefinition taskDefinition)
Removes all the
Requirement s that belong to the TaskDefinition |
void |
removeRequirementsForTaskDefinition(RequirementSet requirementSet,
TaskDefinition taskDefinition)
Removes all the
Requirement s that belong to the TaskDefinition |
boolean |
taskProducesTestResults(TaskDefinition taskDefinition)
Return true iff task defined in
TaskDefinition is configured to produce test results. |
void |
updateRepositoryIdsInTask(TaskDefinition taskDefinition,
Map<Long,Long> repositoryIdChanges)
Updates task configurations affected by repository edition.
|
void |
updateWorkingDirSelectors(ImmutableBuildable job,
BuildDefinition buildDefinition,
Map<Long,Long> repositoryIdsChanges)
Calculates id of the repository that defines working directory after repository or task edition.
|
public static final Requirement DOCKERBOX_REQUIREMENT
public TaskManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor, CapabilitySetManager capabilitySetManager, ElasticAccountBean elasticAccountBean, VcsRepositoryManager vcsRepositoryManager)
@Nullable public TaskModuleDescriptor getTaskDescriptor(@Nullable String pluginKey)
TaskManager
getTaskDescriptor
in interface TaskManager
pluginKey
- - key to match@NotNull public List<TaskModuleDescriptor> getAvailableTaskDescriptors()
getAvailableTaskDescriptors
in interface TaskManager
@NotNull public List<TaskModuleDescriptor> getAvailableBuildTaskDescriptors()
getAvailableBuildTaskDescriptors
in interface TaskManager
@NotNull public List<TaskModuleDescriptor> getAvailableDeploymentTaskDescriptors()
getAvailableDeploymentTaskDescriptors
in interface TaskManager
public void calculateRequirementsForTaskDefinition(@NotNull Job job, @NotNull TaskDefinition taskDefinition)
TaskManager
Requirement
s 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 recalculatedcalculateRequirementsForTaskDefinition
in interface TaskManager
public void calculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier)
TaskManager
Requirement
s 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 recalculatedcalculateRequirementsForTaskDefinition
in interface TaskManager
requirementSet
- to add requirements update requirements intaskDefinition
- to calculate requirements frompublic void calculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier, boolean dockerPipelinesEnabled)
TaskManager
Requirement
s 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.
If docker pipelines is enabled than requirements from requirementSupplier won't be added to RequirementSet
, instead of this docker requirement will be added.calculateRequirementsForTaskDefinition
in interface TaskManager
requirementSet
- to add requirements update requirements intaskDefinition
- to calculate requirements fromdockerPipelinesEnabled
- flag for docker pipelinespublic void removeRequirementsForTaskDefinition(@NotNull Buildable buildable, @NotNull TaskDefinition taskDefinition)
TaskManager
Requirement
s that belong to the TaskDefinition
removeRequirementsForTaskDefinition
in interface TaskManager
buildable
- to remove requirements fromtaskDefinition
- that was removedpublic void removeRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition)
TaskManager
Requirement
s that belong to the TaskDefinition
removeRequirementsForTaskDefinition
in interface TaskManager
requirementSet
- to remove requirements fromtaskDefinition
- that was removedpublic void updateRepositoryIdsInTask(@NotNull TaskDefinition taskDefinition, @NotNull Map<Long,Long> repositoryIdChanges)
TaskManager
updateRepositoryIdsInTask
in interface TaskManager
repositoryIdChanges
- mapping between old and new repositories idspublic void updateWorkingDirSelectors(@NotNull ImmutableBuildable job, @NotNull BuildDefinition buildDefinition, @NotNull Map<Long,Long> repositoryIdsChanges)
TaskManager
updateWorkingDirSelectors
in interface TaskManager
job
- affected jobrepositoryIdsChanges
- mapping between old and new repositories ids@NotNull public Collection<Requirement> getTasksRequirements(@NotNull Job job)
TaskManager
Requirement
s for all tasks of Buildable
if the TaskConfigurator
is an implementor of BuildTaskRequirementSupport
getTasksRequirements
in interface TaskManager
public boolean taskProducesTestResults(@NotNull TaskDefinition taskDefinition)
TaskManager
TaskDefinition
is configured to produce test results.taskProducesTestResults
in interface TaskManager
public Map<String,String> getExecutableLabelTypeMap()
TaskManager
Maps label -> taskExecutableType.getExecutableKey().
The executables are backed by available capabilities system wide, filtered by executables which are actually activated in the plugin system.
getExecutableLabelTypeMap
in interface TaskManager
@NotNull public com.google.common.collect.Multimap<String,String> getExecutableLabelTypesMap()
TaskManager
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.
getExecutableLabelTypesMap
in interface TaskManager
public Set<String> getCapabilitiesWithExecutables(@NotNull Set<String> interestingExecutableTypes)
TaskManager
getCapabilitiesWithExecutables
in interface TaskManager
public void recalculateRequirementsForJob(Job job, boolean dockerPipelinesEnabled)
TaskManager
recalculateRequirementsForJob
in interface TaskManager
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.