Class VcsBranchTaskExporter
java.lang.Object
com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
com.atlassian.bamboo.plugins.vcs.task.export.AbstractVcsTaskExporter
com.atlassian.bamboo.plugins.vcs.task.export.VcsBranchTaskExporter
- All Implemented Interfaces:
TaskDefinitionExporter
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plugins.vcs.task.export.AbstractVcsTaskExporter
projectManager, vcsRepositoryManagerFields inherited from class com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
repositoryDefinitionManager -
Constructor Summary
ConstructorsConstructorDescriptionVcsBranchTaskExporter(@NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull ProjectManager projectManager) -
Method Summary
Modifier and TypeMethodDescription@Nullable com.atlassian.bamboo.specs.builders.task.VcsBranchTaskfromYaml(@NotNull Node node, @NotNull TaskValidationContext context) Parse YAML node to Task Specs builder.protected @NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContextGet validation context for this task type.protected booleanisRepositoryTypeSupported(@NotNull VcsRepositoryModuleDescriptor moduleDescriptor) Returns true if the given repository type is supported by this task type.@NotNull com.atlassian.bamboo.specs.builders.task.VcsBranchTasktoSpecsEntity(@NotNull TaskDefinition taskDefinition) Create Bamboo Specs object representing this task.toTaskConfiguration(@NotNull TaskContainer taskContainer, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Converts properties to Bamboo task configuration.<T extends com.atlassian.bamboo.specs.api.model.task.TaskProperties>
@Nullable NodetoYaml(T taskProperties) Convert task definition to YAML node.@NotNull List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> validate(@NotNull TaskValidationContext taskValidationContext, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Validates task properties in context of enclosing plan or deployment properties.Methods inherited from class com.atlassian.bamboo.plugins.vcs.task.export.AbstractVcsTaskExporter
baseVcsTaskToConfiguration, baseVcsTaskToSpecsEntity, baseVcsTaskValidate, getTypedTaskProperties, isDefaultRepositoryRef, readCommonVcsTaskProperties, setCommonVcsTaskPropertiesMethods inherited from class com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
getNonDefaultRepositoryRef, getNonDefaultRepositoryRef, getRepositoryIdString, getRepositoryListForTaskContainer, isDefaultRepositoryRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.task.export.TaskDefinitionExporter
toSpecsEntity, toTaskConfiguration, toTaskConfiguration
-
Constructor Details
-
VcsBranchTaskExporter
@Inject public VcsBranchTaskExporter(@NotNull @NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull @NotNull ProjectManager projectManager)
-
-
Method Details
-
getValidationContext
@NotNull protected @NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext getValidationContext()Description copied from class:AbstractVcsTaskExporterGet validation context for this task type.- Specified by:
getValidationContextin classAbstractVcsTaskExporter
-
isRepositoryTypeSupported
protected boolean isRepositoryTypeSupported(@NotNull @NotNull VcsRepositoryModuleDescriptor moduleDescriptor) Description copied from class:AbstractVcsTaskExporterReturns true if the given repository type is supported by this task type.- Specified by:
isRepositoryTypeSupportedin classAbstractVcsTaskExporter
-
toTaskConfiguration
@NotNull public @NotNull Map<String,String> toTaskConfiguration(@NotNull @NotNull TaskContainer taskContainer, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Description copied from interface:TaskDefinitionExporterConverts properties to Bamboo task configuration. Can use all Bamboo server side services and can access DB if necessary. Should throw a runtime exception if conversion fails.- Parameters:
taskContainer- current task container (a job or an environment for instance)taskProperties- the current task- Returns:
- task configuration
-
toSpecsEntity
@NotNull public @NotNull com.atlassian.bamboo.specs.builders.task.VcsBranchTask toSpecsEntity(@NotNull @NotNull TaskDefinition taskDefinition) Description copied from interface:TaskDefinitionExporterCreate Bamboo Specs object representing this task. Implementors don't need to handle common task properties like e.g. enabled/disabled, but must task specific configuration. -
validate
@NotNull public @NotNull List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> validate(@NotNull @NotNull TaskValidationContext taskValidationContext, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Description copied from interface:TaskDefinitionExporterValidates task properties in context of enclosing plan or deployment properties. Should check for any inconsistencies between task definition and the rest of plan or deployment content, as it is provided in the validation context. Returns list of validation errors or empty if everything is ok.Should check RSS permissions if necessary.
-
toYaml
@Nullable public <T extends com.atlassian.bamboo.specs.api.model.task.TaskProperties> @Nullable Node toYaml(@NotNull T taskProperties) Description copied from interface:TaskDefinitionExporterConvert task definition to YAML node. Bamboo might modify returned node to add information about task conditions or other general task settings. To make it compatible with future versions returned value should be StringNode or MapNode (String, Map). Structure MapNode (String, String) can't be enriched with additional elements and cause runtime failures for some cases.- Returns:
- YAML representation of the task.
-
fromYaml
@Nullable public @Nullable com.atlassian.bamboo.specs.builders.task.VcsBranchTask fromYaml(@NotNull @NotNull Node node, @NotNull @NotNull TaskValidationContext context) throws YamlSpecsValidationException Description copied from interface:TaskDefinitionExporterParse YAML node to Task Specs builder.- Parameters:
node- YAML node from user input. In general case it's same node generated byTaskDefinitionExporter.toYaml(TaskProperties)method, but in some cases it might contain additional general task elements, like conditions. These elements should be ignored by method implementation and will be handled by Bamboo code. In such case MapNode handler should be implemented even ifTaskDefinitionExporter.toYaml(TaskProperties)produces StringNode.context- task validation context- Throws:
YamlSpecsValidationException
-