Class AbstractVcsTaskExporter
java.lang.Object
com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
com.atlassian.bamboo.plugins.vcs.task.export.AbstractVcsTaskExporter
- All Implemented Interfaces:
TaskDefinitionExporter
- Direct Known Subclasses:
VcsBranchTaskExporter,VcsCheckoutTaskExporter,VcsCommitTaskExporter,VcsPushTaskExporter,VcsTagTaskExporter
public abstract class AbstractVcsTaskExporter
extends AbstractRepositoryAwareTaskExporter
implements TaskDefinitionExporter
Abstract exporter for all VCS-related tasks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ProjectManagerprotected final VcsRepositoryManagerFields inherited from class com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
repositoryDefinitionManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVcsTaskExporter(@NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull ProjectManager projectManager) -
Method Summary
Modifier and TypeMethodDescriptionbaseVcsTaskToConfiguration(@NotNull TaskContainer taskContainer, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Implementation ofTaskDefinitionExporter.toTaskConfiguration(TaskContainer, TaskProperties)for exporters ofBaseVcsTaskProperties.protected <P extends com.atlassian.bamboo.specs.model.task.BaseVcsTaskProperties,B extends com.atlassian.bamboo.specs.builders.task.BaseVcsTask<B, P>>
BbaseVcsTaskToSpecsEntity(@NotNull TaskDefinition taskDefinition, B specsEntity) Implementation ofTaskDefinitionExporter.toSpecsEntity(TaskDefinition)for exporters ofBaseVcsTaskProperties.protected @NotNull List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> baseVcsTaskValidate(@NotNull TaskValidationContext taskValidationContext, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Implementation ofTaskDefinitionExporter.validate(TaskValidationContext, TaskProperties)for exporters ofBaseVcsTaskProperties.protected <T> TgetTypedTaskProperties(@NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties, @NotNull Class<T> expectedClass) Get task properties as an instance of the given class if possible.protected abstract @NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContextGet validation context for this task type.protected booleanisDefaultRepositoryRef(@NotNull String repositorySelector, @NotNull Map<String, String> configuration) Whether the given repository identifier points to a default repository of a plan.protected abstract booleanisRepositoryTypeSupported(@NotNull VcsRepositoryModuleDescriptor moduleDescriptor) Returns true if the given repository type is supported by this task type.protected static voidreadCommonVcsTaskProperties(MapNode mapNode, com.atlassian.bamboo.specs.builders.task.BaseVcsTask result) setCommonVcsTaskProperties(@NotNull com.atlassian.bamboo.specs.model.task.BaseVcsTaskProperties properties) Methods 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
fromYaml, toSpecsEntity, toSpecsEntity, toTaskConfiguration, toTaskConfiguration, toTaskConfiguration, toYaml, validate
-
Field Details
-
vcsRepositoryManager
-
projectManager
-
-
Constructor Details
-
AbstractVcsTaskExporter
public AbstractVcsTaskExporter(@NotNull @NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull @NotNull ProjectManager projectManager)
-
-
Method Details
-
getValidationContext
@NotNull protected abstract @NotNull com.atlassian.bamboo.specs.api.validators.common.ValidationContext getValidationContext()Get validation context for this task type. -
isRepositoryTypeSupported
protected abstract boolean isRepositoryTypeSupported(@NotNull @NotNull VcsRepositoryModuleDescriptor moduleDescriptor) Returns true if the given repository type is supported by this task type. -
isDefaultRepositoryRef
protected boolean isDefaultRepositoryRef(@NotNull @NotNull String repositorySelector, @NotNull @NotNull Map<String, String> configuration) Whether the given repository identifier points to a default repository of a plan.- Parameters:
repositorySelector- key to select repository identifier from the configurationconfiguration- task configuration- Returns:
- true if the repository identifier points to a default plan's repository
-
baseVcsTaskToConfiguration
@NotNull protected @NotNull Map<String,String> baseVcsTaskToConfiguration(@NotNull @NotNull TaskContainer taskContainer, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Implementation ofTaskDefinitionExporter.toTaskConfiguration(TaskContainer, TaskProperties)for exporters ofBaseVcsTaskProperties. -
baseVcsTaskToSpecsEntity
@NotNull protected <P extends com.atlassian.bamboo.specs.model.task.BaseVcsTaskProperties,B extends com.atlassian.bamboo.specs.builders.task.BaseVcsTask<B, B baseVcsTaskToSpecsEntityP>> (@NotNull @NotNull TaskDefinition taskDefinition, @NotNull B specsEntity) Implementation ofTaskDefinitionExporter.toSpecsEntity(TaskDefinition)for exporters ofBaseVcsTaskProperties. -
baseVcsTaskValidate
@NotNull protected @NotNull List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> baseVcsTaskValidate(@NotNull @NotNull TaskValidationContext taskValidationContext, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties) Implementation ofTaskDefinitionExporter.validate(TaskValidationContext, TaskProperties)for exporters ofBaseVcsTaskProperties. -
getTypedTaskProperties
@NotNull protected <T> T getTypedTaskProperties(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties, @NotNull @NotNull Class<T> expectedClass) Get task properties as an instance of the given class if possible.- Parameters:
taskProperties- generic task properties, not yet typed properlyexpectedClass- expected class of the task properties- Returns:
- typed task properties
- Throws:
IllegalStateException- if the task properties are of an incorrect, unsupported type
-
setCommonVcsTaskProperties
-
readCommonVcsTaskProperties
protected static void readCommonVcsTaskProperties(MapNode mapNode, com.atlassian.bamboo.specs.builders.task.BaseVcsTask result)
-