Package com.atlassian.bamboo.task.export
Class AbstractRepositoryAwareTaskExporter
java.lang.Object
com.atlassian.bamboo.task.export.AbstractRepositoryAwareTaskExporter
- All Implemented Interfaces:
TaskDefinitionExporter
- Direct Known Subclasses:
AbstractVcsTaskExporter,WarningsTaskExporter
public abstract class AbstractRepositoryAwareTaskExporter
extends Object
implements TaskDefinitionExporter
Base class for various repository related task exporters that provides some basic utilities like finding referenced repository
amongst available repositories.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRepositoryAwareTaskExporter(@NotNull RepositoryDefinitionManager repositoryDefinitionManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifiergetNonDefaultRepositoryRef(@NotNull String repositoryString) Get a repository reference Specs entity for a non-default repository.@NotNull com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifiergetNonDefaultRepositoryRef(@NotNull String repositorySelector, @NotNull Map<String, String> configuration) Get a Specs repository reference for a non-default repository.protected @NotNull StringgetRepositoryIdString(@NotNull com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryIdentifierProperties repository, @NotNull TaskContainer taskContainer) Get database ID of a repository based on the passed identifier and task container.@NotNull List<? extends VcsRepositoryData>getRepositoryListForTaskContainer(@NotNull TaskContainer taskContainer) protected booleanisDefaultRepositoryRef(@NotNull String repositoryString) Whether the given repository identifier points to a default repository of a plan.Methods 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
-
repositoryDefinitionManager
-
-
Constructor Details
-
AbstractRepositoryAwareTaskExporter
public AbstractRepositoryAwareTaskExporter(@NotNull @NotNull RepositoryDefinitionManager repositoryDefinitionManager)
-
-
Method Details
-
isDefaultRepositoryRef
Whether the given repository identifier points to a default repository of a plan.- Parameters:
repositoryString- repository identifier string from the task configuration- Returns:
- true if the repository identifier points to a default plan's repository
-
getNonDefaultRepositoryRef
@NotNull public @NotNull com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier getNonDefaultRepositoryRef(@NotNull @NotNull String repositorySelector, @NotNull @NotNull Map<String, String> configuration) Get a Specs repository reference for a non-default repository.- Parameters:
repositorySelector- key to select repository identifier from the configurationconfiguration- task configuration- Returns:
- VCS repository identifier
- Throws:
IllegalArgumentException- if the repository selector points to a default repositoryIllegalStateException- if the repository does not exist
-
getNonDefaultRepositoryRef
@NotNull public @NotNull com.atlassian.bamboo.specs.api.builders.repository.VcsRepositoryIdentifier getNonDefaultRepositoryRef(@NotNull @NotNull String repositoryString) Get a repository reference Specs entity for a non-default repository.- Parameters:
repositoryString- repository identifier string from the task configuration- Returns:
- VCS repository identifier
- Throws:
IllegalArgumentException- if the repository selector points to a default repositoryIllegalStateException- if the repository does not exist
-
getRepositoryIdString
@NotNull protected @NotNull String getRepositoryIdString(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryIdentifierProperties repository, @NotNull @NotNull TaskContainer taskContainer) Get database ID of a repository based on the passed identifier and task container.- Parameters:
repository- Specs repository identifiertaskContainer- task container- Returns:
- ID of the repository as String
- Throws:
IllegalArgumentException- if repository can't be found
-
getRepositoryListForTaskContainer
@NotNull public @NotNull List<? extends VcsRepositoryData> getRepositoryListForTaskContainer(@NotNull @NotNull TaskContainer taskContainer)
-