Class AbstractVcsTaskConfigurator
- java.lang.Object
-
- com.atlassian.bamboo.task.AbstractTaskConfigurator
-
- com.atlassian.bamboo.task.repository.AbstractRepositoryAwareTaskConfigurator
-
- com.atlassian.bamboo.plugins.vcs.task.configuration.AbstractVcsTaskConfigurator
-
- All Implemented Interfaces:
DeploymentTaskRequirementSupport
,RepositoryAwareDeploymentTaskConfigurator
,BuildTaskRequirementSupport
,RepositoryAwareTaskConfigurator
,TaskConfigurator
- Direct Known Subclasses:
VcsBranchTaskConfigurator
,VcsCommitTaskConfigurator
,VcsPushTaskConfigurator
,VcsTagTaskConfigurator
public abstract class AbstractVcsTaskConfigurator extends AbstractRepositoryAwareTaskConfigurator implements RepositoryAwareTaskConfigurator
-
-
Field Summary
Fields Modifier and Type Field Description static String
CFG_AVAILABLE_REPOSITORIES
static String
CFG_DEFAULT_REPOSITORY_KEY
static String
CFG_DEFAULT_REPOSITORY_NAME
static String
CFG_SUPPORTED_REPOSITORIES
-
Fields inherited from class com.atlassian.bamboo.task.repository.AbstractRepositoryAwareTaskConfigurator
environmentService, repositoryDefinitionManager, repositoryManager, textProvider, vcsRepositoryManager
-
Fields inherited from class com.atlassian.bamboo.task.AbstractTaskConfigurator
bambooAuthenticationContext, taskConfiguratorHelper
-
-
Constructor Summary
Constructors Constructor Description AbstractVcsTaskConfigurator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
additionalValidate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
Additional validation required by this task.@NotNull Map<String,String>
generateTaskConfigMap(@NotNull ActionParametersMap params, @Nullable TaskDefinition previousTaskDefinition)
Convert the params from the ui into a config map to be stored in the database for the taskDefinition.protected abstract @NotNull List<String>
getAdditionalFieldsToCopy()
Additional fields to persist to the database.protected abstract @NotNull Map<String,Object>
getDefaultFieldValues()
Default values for specified fields.protected abstract boolean
isRepositoryModuleSupported(@NotNull VcsRepositoryModuleDescriptor repositoryModuleDescriptor)
Whether the given repository type is eligible for this task.void
populateContextForCreate(@NotNull Map<String,Object> context)
Provide any required context to be used when rendering the freemarker template for creating a task definition.void
populateContextForEdit(@NotNull Map<String,Object> context, @NotNull TaskDefinition taskDefinition)
Provide any required context to be used when rendering the freemarker template for view editing a task definitionvoid
validate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
Validate the params submitted from the UI for this task definition-
Methods inherited from class com.atlassian.bamboo.task.repository.AbstractRepositoryAwareTaskConfigurator
calculateRequirements, calculateRequirements, getPlanRepositoriesUsedByTask, getPlanRepositoriesUsedByTask, getRepositoriesUsedByTask, getRepositoriesUsedByTask, handleRepositoryIdChanged, setEnvironmentService, setRepositoryDefinitionManager, setRepositoryManager, setTextProvider, setVcsRepositoryManager
-
Methods inherited from class com.atlassian.bamboo.task.AbstractTaskConfigurator
calculateRequirements, getI18nBean, populateContextForView, setAuthenticationContext, setTaskConfiguratorHelper
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.task.BuildTaskRequirementSupport
calculateRequirements
-
Methods inherited from interface com.atlassian.bamboo.task.repository.RepositoryAwareTaskConfigurator
getPlanRepositoriesUsedByTask, getRepositoriesUsedByTask, handleRepositoryIdChanged
-
-
-
-
Field Detail
-
CFG_AVAILABLE_REPOSITORIES
public static final String CFG_AVAILABLE_REPOSITORIES
- See Also:
- Constant Field Values
-
CFG_SUPPORTED_REPOSITORIES
public static final String CFG_SUPPORTED_REPOSITORIES
- See Also:
- Constant Field Values
-
CFG_DEFAULT_REPOSITORY_KEY
public static final String CFG_DEFAULT_REPOSITORY_KEY
- See Also:
- Constant Field Values
-
CFG_DEFAULT_REPOSITORY_NAME
public static final String CFG_DEFAULT_REPOSITORY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isRepositoryModuleSupported
protected abstract boolean isRepositoryModuleSupported(@NotNull @NotNull VcsRepositoryModuleDescriptor repositoryModuleDescriptor)
Whether the given repository type is eligible for this task.
-
getAdditionalFieldsToCopy
@NotNull protected abstract @NotNull List<String> getAdditionalFieldsToCopy()
Additional fields to persist to the database.TaskConfigConstants.CFG_WORKING_SUB_DIRECTORY
andRepositoryTaskHelper.CFG_SELECTED_REPOSITORY
are always persisted, so they needn't be returned by this method. Return an empty list if no additional fields are needed.
-
getDefaultFieldValues
@NotNull protected abstract @NotNull Map<String,Object> getDefaultFieldValues()
Default values for specified fields. Return an empty map if no defaults are needed.
-
additionalValidate
protected abstract void additionalValidate(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection)
Additional validation required by this task. Lack ofTaskConfigConstants.CFG_WORKING_SUB_DIRECTORY
is always validated.
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull TaskDefinition taskDefinition)
Description copied from interface:TaskConfigurator
Provide any required context to be used when rendering the freemarker template for view editing a task definition- Specified by:
populateContextForEdit
in interfaceTaskConfigurator
- Overrides:
populateContextForEdit
in classAbstractTaskConfigurator
- Parameters:
context
- map to put your context in.taskDefinition
- existing task definition
-
populateContextForCreate
public final void populateContextForCreate(@NotNull @NotNull Map<String,Object> context)
Description copied from interface:TaskConfigurator
Provide any required context to be used when rendering the freemarker template for creating a task definition. Allows you to add any default values for initial creation- Specified by:
populateContextForCreate
in interfaceTaskConfigurator
- Overrides:
populateContextForCreate
in classAbstractTaskConfigurator
- Parameters:
context
- map to put your context in.
-
validate
public final void validate(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection)
Description copied from interface:TaskConfigurator
Validate the params submitted from the UI for this task definition- Specified by:
validate
in interfaceTaskConfigurator
- Overrides:
validate
in classAbstractTaskConfigurator
- Parameters:
params
- - request paramaterserrorCollection
- - collection to put any errors in.
-
generateTaskConfigMap
@NotNull public final @NotNull Map<String,String> generateTaskConfigMap(@NotNull @NotNull ActionParametersMap params, @Nullable @Nullable TaskDefinition previousTaskDefinition)
Description copied from interface:TaskConfigurator
Convert the params from the ui into a config map to be stored in the database for the taskDefinition. Can assume validation has occurred in the #validate method- Specified by:
generateTaskConfigMap
in interfaceTaskConfigurator
- Overrides:
generateTaskConfigMap
in classAbstractTaskConfigurator
- Parameters:
params
- - request paramaterspreviousTaskDefinition
- - the previous immutableTaskDefinition
before saving or null if Task is being created- Returns:
- the configuration map to be stored in the database
-
-