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 Details

  • Constructor Details

  • 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 configuration
      configuration - 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 of TaskDefinitionExporter.toTaskConfiguration(TaskContainer, TaskProperties) for exporters of BaseVcsTaskProperties.
    • baseVcsTaskToSpecsEntity

      @NotNull protected <P extends com.atlassian.bamboo.specs.model.task.BaseVcsTaskProperties, B extends com.atlassian.bamboo.specs.builders.task.BaseVcsTask<B, P>> B baseVcsTaskToSpecsEntity(@NotNull @NotNull TaskDefinition taskDefinition, @NotNull B specsEntity)
      Implementation of TaskDefinitionExporter.toSpecsEntity(TaskDefinition) for exporters of BaseVcsTaskProperties.
    • 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 of TaskDefinitionExporter.validate(TaskValidationContext, TaskProperties) for exporters of BaseVcsTaskProperties.
    • 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 properly
      expectedClass - expected class of the task properties
      Returns:
      typed task properties
      Throws:
      IllegalStateException - if the task properties are of an incorrect, unsupported type