Package com.atlassian.bamboo.task
Interface TaskManager
-
- All Known Implementing Classes:
TaskManagerImpl
@PublicApi public interface TaskManager- Since:
- 3.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidcalculateRequirementsForTaskDefinition(@NotNull Job job, @NotNull TaskDefinition taskDefinition)Attempts to addRequirements to the specifiedBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupportIf requirements are already present for the specifiedTaskDefinitionthey will be removed and recalculatedvoidcalculateRequirementsForTaskDefinition(@NotNull Job job, @NotNull TaskDefinition taskDefinition, boolean dockerPipelinesEnabled)Attempts to addRequirements to the specifiedBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupportIf requirements are already present for the specifiedTaskDefinitionthey will be removed and recalculatedvoidcalculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier)Deprecated.voidcalculateRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier, boolean dockerPipelinesEnabled)Attempts to addRequirements to the specifiedRequirementSet.@NotNull List<TaskModuleDescriptor>getAvailableBuildTaskDescriptors()@NotNull List<TaskModuleDescriptor>getAvailableDeploymentTaskDescriptors()@NotNull List<TaskModuleDescriptor>getAvailableTaskDescriptors()Set<String>getCapabilitiesWithExecutables(@NotNull Set<String> executableType)Returns a set of capabilities that have executable types defined for them in the system.@NotNull Map<String,String>getExecutableLabelTypeMap()Deprecated.since 8.0 labels are not unique across different executable types.@NotNull com.google.common.collect.Multimap<String,String>getExecutableLabelTypesMap()Returns a map of currently available "configured" executables - identified by a label.@Nullable TaskModuleDescriptorgetTaskDescriptor(@Nullable String pluginKey)Get the task type descriptor matching a particular plugin key.@NotNull Collection<Requirement>getTasksRequirements(@NotNull Job job)ReturnRequirements for all tasks ofBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupportvoidrecalculateRequirementsForJob(Job job, boolean dockerPipelinesEnabled)Recalculates requirements for job with given docker pipelines flag.voidremoveRequirementsForTaskDefinition(@NotNull Buildable buildable, @NotNull TaskDefinition taskDefinition)Removes all theRequirements that belong to theTaskDefinitionvoidremoveRequirementsForTaskDefinition(@NotNull RequirementSet requirementSet, @NotNull TaskDefinition taskDefinition)Removes all theRequirements that belong to theTaskDefinitionbooleantaskProducesTestResults(@NotNull TaskDefinition taskDefinition)Return true iff task defined inTaskDefinitionis configured to produce test results.voidupdateRepositoryIdsInTask(@NotNull TaskDefinition taskDefinition, @NotNull Map<Long,Long> repositoryIdChanges)Updates task configurations affected by repository edition.voidupdateWorkingDirSelectors(@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.
-
-
-
Method Detail
-
getAvailableTaskDescriptors
@NotNull @NotNull List<TaskModuleDescriptor> getAvailableTaskDescriptors()
- Returns:
- Provides a list of available tasks types. Returns both Build Tasks and DeploymentTasks
-
getAvailableBuildTaskDescriptors
@NotNull @NotNull List<TaskModuleDescriptor> getAvailableBuildTaskDescriptors()
- Returns:
- Provides a list of available build task types.
- Since:
- 5.0
-
getAvailableDeploymentTaskDescriptors
@NotNull @NotNull List<TaskModuleDescriptor> getAvailableDeploymentTaskDescriptors()
- Returns:
- Provides a list of available deployment task types.
- Since:
- 5.0
-
getTaskDescriptor
@Nullable @Nullable TaskModuleDescriptor getTaskDescriptor(@Nullable @Nullable String pluginKey)
Get the task type descriptor matching a particular plugin key.- Parameters:
pluginKey- - key to match- Returns:
- TaskModuleDescriptor matching the given key if it exists. Null if the plugin can not be found.
-
calculateRequirementsForTaskDefinition
void calculateRequirementsForTaskDefinition(@NotNull @NotNull Job job, @NotNull @NotNull TaskDefinition taskDefinition, boolean dockerPipelinesEnabled)Attempts to addRequirements to the specifiedBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupportIf requirements are already present for the specifiedTaskDefinitionthey will be removed and recalculated- Since:
- 9.3
-
calculateRequirementsForTaskDefinition
void calculateRequirementsForTaskDefinition(@NotNull @NotNull Job job, @NotNull @NotNull TaskDefinition taskDefinition)Attempts to addRequirements to the specifiedBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupportIf requirements are already present for the specifiedTaskDefinitionthey will be removed and recalculated- Parameters:
job-taskDefinition-
-
calculateRequirementsForTaskDefinition
@Deprecated void calculateRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier)
Deprecated.Attempts to addRequirements to the specifiedRequirementSet. How to get the requirements from the task Definition is determined by the supplier. If requirements are already present for the specifiedTaskDefinitionthey will be removed and recalculated- Parameters:
requirementSet- to add requirements update requirements intaskDefinition- to calculate requirements from
-
calculateRequirementsForTaskDefinition
void calculateRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition, Supplier<Set<Requirement>> requirementSupplier, boolean dockerPipelinesEnabled)Attempts to addRequirements to the specifiedRequirementSet. How to get the requirements from the task Definition is determined by the supplier. If requirements are already present for the specifiedTaskDefinitionthey 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.- Parameters:
requirementSet- to add requirements update requirements intaskDefinition- to calculate requirements fromdockerPipelinesEnabled- flag for docker pipelines
-
removeRequirementsForTaskDefinition
void removeRequirementsForTaskDefinition(@NotNull @NotNull Buildable buildable, @NotNull @NotNull TaskDefinition taskDefinition)Removes all theRequirements that belong to theTaskDefinition- Parameters:
buildable- to remove requirements fromtaskDefinition- that was removed
-
removeRequirementsForTaskDefinition
void removeRequirementsForTaskDefinition(@NotNull @NotNull RequirementSet requirementSet, @NotNull @NotNull TaskDefinition taskDefinition)Removes all theRequirements that belong to theTaskDefinition- Parameters:
requirementSet- to remove requirements fromtaskDefinition- that was removed
-
getTasksRequirements
@NotNull @NotNull Collection<Requirement> getTasksRequirements(@NotNull @NotNull Job job)
ReturnRequirements for all tasks ofBuildableif theTaskConfiguratoris an implementor ofBuildTaskRequirementSupport- Parameters:
job-- Returns:
- requirements
- Throws:
IllegalStateException
-
taskProducesTestResults
boolean taskProducesTestResults(@NotNull @NotNull TaskDefinition taskDefinition)Return true iff task defined inTaskDefinitionis configured to produce test results.- Parameters:
taskDefinition-- Returns:
- producesTestResults
-
getExecutableLabelTypeMap
@Deprecated @NotNull @NotNull Map<String,String> getExecutableLabelTypeMap()
Deprecated.since 8.0 labels are not unique across different executable types. Use {getExecutableLabelTypesMap()} instead.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.
- Returns:
- executableTypeLabelMaps
-
getExecutableLabelTypesMap
@NotNull @NotNull com.google.common.collect.Multimap<String,String> getExecutableLabelTypesMap()
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.
- Returns:
- executableTypeLabelMultiMaps
-
updateRepositoryIdsInTask
void updateRepositoryIdsInTask(@NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull Map<Long,Long> repositoryIdChanges)Updates task configurations affected by repository edition.- Parameters:
taskDefinition-repositoryIdChanges- mapping between old and new repositories ids- Since:
- 4.3
-
updateWorkingDirSelectors
void updateWorkingDirSelectors(@NotNull @NotNull ImmutableBuildable job, @NotNull @NotNull BuildDefinition buildDefinition, @NotNull @NotNull Map<Long,Long> repositoryIdsChanges)Calculates id of the repository that defines working directory after repository or task edition.- Parameters:
job- affected jobbuildDefinition-repositoryIdsChanges- mapping between old and new repositories ids
-
getCapabilitiesWithExecutables
Set<String> getCapabilitiesWithExecutables(@NotNull @NotNull Set<String> executableType)
Returns a set of capabilities that have executable types defined for them in the system.
-
recalculateRequirementsForJob
void recalculateRequirementsForJob(Job job, boolean dockerPipelinesEnabled)
Recalculates requirements for job with given docker pipelines flag.- Parameters:
job-dockerPipelinesEnabled-- Since:
- 6.4
-
-