public class TaskConfiguratorHelperImpl extends Object implements TaskConfiguratorHelper
Constructor and Description |
---|
TaskConfiguratorHelperImpl(BuildDefinitionManager buildDefinitionManager,
EnvironmentService environmentService,
com.opensymphony.xwork2.TextProvider textProvider) |
Modifier and Type | Method and Description |
---|---|
void |
addJdkRequirement(Set<Requirement> requirements,
TaskDefinition taskDefinition,
String cfgJdkLabel)
Add JDK requirement if JDK was defined in task configuration
|
void |
addSystemRequirementFromConfiguration(Set<Requirement> requirements,
TaskDefinition taskDefinition,
String cfgKey,
String requirementPrefix)
Add Executable requirement if Executable was defined in task configuration
|
Requirement |
createRequirementFromConfiguration(TaskDefinition taskDefinition,
String cfgKey)
Creates a new Executable requirement if Executable was defined in task configuration
|
Optional<TaskDefinition> |
extractTaskDefinition(ActionParametersMap params)
Get the task definition for the task defined in the parameter map.
|
com.atlassian.fugue.Option<TaskDefinition> |
getTaskDefinition(ActionParametersMap params)
Get the task definition for the task defined in the parameter map.
|
List<TaskDefinition> |
getTaskDefinitions(ActionParametersMap params)
Get all the task definitions for the job or environment defined in the parameter map.
|
void |
populateContextWithConfiguration(Map<String,Object> context,
TaskDefinition taskDefinition,
Iterable<String> keys)
Populate Freemarker context with selected data from task configuration.
|
void |
populateTaskConfigMapWithActionParameters(Map<String,String> config,
ActionParametersMap params,
Iterable<String> keys)
Populate task configuration with selected data from action parameters.
|
void |
validateBuilderLabel(ActionParametersMap params,
ErrorCollection errorCollection)
Validate builder definition in action parameters
|
void |
validateJdk(ActionParametersMap params,
ErrorCollection errorCollection)
Validate JDK definition in action parameters
|
void |
validateTestResultsFilePattern(ActionParametersMap params,
ErrorCollection errorCollection)
Validate test results file pattern in action parameters
|
void |
validateTestResultsFilePatternIfCustomPatternSelected(ActionParametersMap params,
ErrorCollection errorCollection,
String cfgTestResultsFilePatternOptionCustom)
Validate test results file pattern in action parameters when manual pattern is enabled by an option
|
public TaskConfiguratorHelperImpl(BuildDefinitionManager buildDefinitionManager, EnvironmentService environmentService, com.opensymphony.xwork2.TextProvider textProvider)
public void populateContextWithConfiguration(@NotNull Map<String,Object> context, @NotNull TaskDefinition taskDefinition, @NotNull Iterable<String> keys)
TaskConfiguratorHelper
populateContextWithConfiguration
in interface TaskConfiguratorHelper
context
- Freemarker contexttaskDefinition
- source of task configurationkeys
- keys for which values has to be copiedpublic void populateTaskConfigMapWithActionParameters(@NotNull Map<String,String> config, @NotNull ActionParametersMap params, @NotNull Iterable<String> keys)
TaskConfiguratorHelper
populateTaskConfigMapWithActionParameters
in interface TaskConfiguratorHelper
config
- task configurationparams
- action parameterskeys
- keys for which values has to be copiedpublic void addJdkRequirement(@NotNull Set<Requirement> requirements, @NotNull TaskDefinition taskDefinition, @NotNull String cfgJdkLabel)
TaskConfiguratorHelper
addJdkRequirement
in interface TaskConfiguratorHelper
requirements
- requirements to be modifiedtaskDefinition
- task definitioncfgJdkLabel
- name of configuration key that specifies JDK labelpublic void addSystemRequirementFromConfiguration(@NotNull Set<Requirement> requirements, @NotNull TaskDefinition taskDefinition, @NotNull String cfgKey, @NotNull String requirementPrefix)
TaskConfiguratorHelper
addSystemRequirementFromConfiguration
in interface TaskConfiguratorHelper
requirements
- requirements to be modifiedtaskDefinition
- task definitioncfgKey
- name of configuration key that specifies label of system requirement to be addedrequirementPrefix
- prefix of the system requirement@Nullable public Requirement createRequirementFromConfiguration(@NotNull TaskDefinition taskDefinition, @NotNull String cfgKey)
TaskConfiguratorHelper
createRequirementFromConfiguration
in interface TaskConfiguratorHelper
taskDefinition
- task definitioncfgKey
- name of configuration key that specifies the system requirementpublic void validateJdk(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
TaskConfiguratorHelper
validateJdk
in interface TaskConfiguratorHelper
params
- action parameterserrorCollection
- target for adding validation errorspublic void validateBuilderLabel(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
TaskConfiguratorHelper
validateBuilderLabel
in interface TaskConfiguratorHelper
params
- action parameterserrorCollection
- target for adding validation errorspublic void validateTestResultsFilePattern(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
TaskConfiguratorHelper
validateTestResultsFilePattern
in interface TaskConfiguratorHelper
params
- action parameterserrorCollection
- target for adding validation errorspublic void validateTestResultsFilePatternIfCustomPatternSelected(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection, @NotNull String cfgTestResultsFilePatternOptionCustom)
TaskConfiguratorHelper
validateTestResultsFilePatternIfCustomPatternSelected
in interface TaskConfiguratorHelper
params
- action parameterserrorCollection
- target for adding validation errorscfgTestResultsFilePatternOptionCustom
- value of an option that enables test results file pattern@NotNull public com.atlassian.fugue.Option<TaskDefinition> getTaskDefinition(@NotNull ActionParametersMap params)
TaskConfiguratorHelper
getTaskDefinition
in interface TaskConfiguratorHelper
params
- The parameter map from the task.Option
containing the existing task definition or empty if this is a new task.@NotNull public Optional<TaskDefinition> extractTaskDefinition(@NotNull ActionParametersMap params)
TaskConfiguratorHelper
extractTaskDefinition
in interface TaskConfiguratorHelper
params
- The parameter map from the task.Option
containing the existing task definition or empty if this is a new task.@NotNull public List<TaskDefinition> getTaskDefinitions(ActionParametersMap params)
TaskConfiguratorHelper
getTaskDefinitions
in interface TaskConfiguratorHelper
params
- The parameter map from a task in the job or environment.TaskDefinition
s for all the tasks in the job or environment.Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.