public abstract class AbstractVcsTaskExporter extends Object implements TaskDefinitionExporter
Modifier and Type | Field and Description |
---|---|
protected RepositoryDefinitionManager |
repositoryDefinitionManager |
protected VcsRepositoryManager |
vcsRepositoryManager |
Constructor and Description |
---|
AbstractVcsTaskExporter() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
baseVcsTaskToConfiguration(TaskContainer taskContainer,
com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties)
Implementation of
TaskDefinitionExporter.toTaskConfiguration(TaskContainer, TaskProperties) for exporters of
BaseVcsTaskProperties . |
protected <P extends com.atlassian.bamboo.specs.model.task.BaseVcsTaskProperties,B extends com.atlassian.bamboo.specs.builders.task.BaseVcsTask<B,P>> |
baseVcsTaskToSpecsEntity(TaskDefinition taskDefinition,
B specsEntity)
Implementation of
TaskDefinitionExporter.toSpecsEntity(TaskDefinition) for exporters of BaseVcsTaskProperties . |
protected List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> |
baseVcsTaskValidate(TaskValidationContext taskValidationContext,
com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties)
Implementation of
TaskDefinitionExporter.validate(TaskValidationContext, TaskProperties) for exporters of
BaseVcsTaskProperties . |
protected com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier |
getNonDefaultRepositoryRef(String repositoryString)
Get a repository reference Specs entity for a non-default repository.
|
protected com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier |
getNonDefaultRepositoryRef(String repositorySelector,
Map<String,String> configuration)
Get a Specs repository reference for a non-default repository.
|
protected String |
getRepositoryIdString(com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryIdentifierProperties repository,
TaskContainer taskContainer)
Get database ID of a repository based on the passed identifier and task container.
|
protected List<? extends VcsRepositoryData> |
getRepositoryListForTaskContainer(TaskContainer taskContainer) |
protected <T> T |
getTypedTaskProperties(com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties,
Class<T> expectedClass)
Get task properties as an instance of the given class if possible.
|
protected abstract com.atlassian.bamboo.specs.api.validators.common.ValidationContext |
getValidationContext()
Get validation context for this task type.
|
protected boolean |
isDefaultRepositoryRef(String repositoryString)
Whether the given repository identifier points to a default repository of a plan.
|
protected boolean |
isDefaultRepositoryRef(String repositorySelector,
Map<String,String> configuration)
Whether the given repository identifier points to a default repository of a plan.
|
protected abstract boolean |
isRepositoryTypeSupported(VcsRepositoryModuleDescriptor moduleDescriptor)
Returns true if the given repository type is supported by this task type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toSpecsEntity, toSpecsEntity, toTaskConfiguration, toTaskConfiguration, validate
@Autowired protected VcsRepositoryManager vcsRepositoryManager
@Autowired protected RepositoryDefinitionManager repositoryDefinitionManager
@NotNull protected abstract com.atlassian.bamboo.specs.api.validators.common.ValidationContext getValidationContext()
protected abstract boolean isRepositoryTypeSupported(@NotNull VcsRepositoryModuleDescriptor moduleDescriptor)
protected boolean isDefaultRepositoryRef(@NotNull String repositorySelector, @NotNull Map<String,String> configuration)
repositorySelector
- key to select repository identifier from the configurationconfiguration
- task configurationprotected boolean isDefaultRepositoryRef(@NotNull String repositoryString)
repositoryString
- repository identifier string from the task configuration@NotNull protected com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier getNonDefaultRepositoryRef(@NotNull String repositorySelector, @NotNull Map<String,String> configuration)
repositorySelector
- key to select repository identifier from the configurationconfiguration
- task configurationIllegalArgumentException
- if the repository selector points to a default repositoryIllegalStateException
- if the repository does not exist@NotNull protected com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier getNonDefaultRepositoryRef(@NotNull String repositoryString)
repositoryString
- repository identifier string from the task configurationIllegalArgumentException
- if the repository selector points to a default repositoryIllegalStateException
- if the repository does not exist@NotNull protected String getRepositoryIdString(@NotNull com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryIdentifierProperties repository, @NotNull TaskContainer taskContainer)
repository
- Specs repository identifiertaskContainer
- task containerIllegalArgumentException
- if repository can't be found@NotNull protected Map<String,String> baseVcsTaskToConfiguration(@NotNull TaskContainer taskContainer, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties)
TaskDefinitionExporter.toTaskConfiguration(TaskContainer, TaskProperties)
for exporters of
BaseVcsTaskProperties
.@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 TaskDefinition taskDefinition, @NotNull B specsEntity)
TaskDefinitionExporter.toSpecsEntity(TaskDefinition)
for exporters of BaseVcsTaskProperties
.@NotNull protected List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> baseVcsTaskValidate(@NotNull TaskValidationContext taskValidationContext, @NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties)
TaskDefinitionExporter.validate(TaskValidationContext, TaskProperties)
for exporters of
BaseVcsTaskProperties
.@NotNull protected <T> T getTypedTaskProperties(@NotNull com.atlassian.bamboo.specs.api.model.task.TaskProperties taskProperties, @NotNull Class<T> expectedClass)
taskProperties
- generic task properties, not yet typed properlyexpectedClass
- expected class of the task propertiesIllegalStateException
- if the task properties are of an incorrect, unsupported type@NotNull protected List<? extends VcsRepositoryData> getRepositoryListForTaskContainer(@NotNull TaskContainer taskContainer)
Copyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.