Class VcsConfigurationHelperImpl
java.lang.Object
com.atlassian.bamboo.configuration.repository.VcsConfigurationHelperImpl
- All Implemented Interfaces:
VcsConfigurationHelper
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.vcs.configuration.service.VcsConfigurationHelper
VcsConfigurationHelper.Overrides -
Field Summary
Fields inherited from interface com.atlassian.bamboo.vcs.configuration.service.VcsConfigurationHelper
BAMBOO_TEST_CONNECTION, OVERRIDE_ALL, OVERRIDE_NOTHING -
Constructor Summary
ConstructorsConstructorDescriptionVcsConfigurationHelperImpl(VcsViewerUIConfigBean vcsViewerUIConfigBean, org.apache.struts2.text.TextProvider textProvider, BambooPermissionManager bambooPermissionManager, RepositoryDefinitionManager repositoryDefinitionManager, VcsRepositoryConfigurationService vcsRepositoryConfigurationService, VcsBambooSpecsConfigurator vcsBambooSpecsConfigurator) -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull PartialVcsRepositoryDatagetNewPartialVcsConfigurationFromActionData(@NotNull ActionParametersMap apm, @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @NotNull String repositoryName, @Nullable String userDescription, @Nullable Long projectId, @Nullable PartialVcsRepositoryData previousVcsDefinition, boolean unused, @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Extracts repository configuration from action's parameters for saving in DB.@NotNull PartialVcsRepositoryDatareconfigureRepositoryWithMavenData(@NotNull VcsRepositoryModuleDescriptor oldModuleDescriptor, @NotNull PartialVcsRepositoryData oldData, @Nullable VcsRepositoryModuleDescriptor newModuleDescriptor, @NotNull Map<String, String> newServerConfiguration, @Nullable VcsBranch vcsBranch, @Nullable String webRepositoryUrl) Creates new repository configuration according to data found in a maven pom.xml.@NotNull PartialVcsRepositoryDatatemporaryVcsDataFromActionParams(@NotNull ActionParametersMap apm, @NotNull VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable PartialVcsRepositoryData existingData, @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Extracts repository configuration from action's parameters.@Nullable RepositoryDataEntityvalidateRepositoryExistenceAndPermissions(long repositoryId, org.apache.struts2.interceptor.ValidationAware validationAware) Checks if a repository exists in the DB.@NotNull ErrorCollectionvalidateSharedRepositoryName(String repositoryName) Check if new shared repository name is valid.voidvalidateSharedRepositoryName(String repositoryName, org.apache.struts2.interceptor.ValidationAware validationAware) Check if new shared repository name is valid.voidvalidateVcsConfiguration(@NotNull ActionParametersMap apm, @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable PartialVcsRepositoryData previousVcsData, @NotNull ErrorCollection errorCollection, @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Run repository configuration validation(s) on action's data.voidvalidateVcsConfigurationForConnectionTesting(@NotNull ActionParametersMap apm, @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable PartialVcsRepositoryData previousVcsData, @NotNull ErrorCollection errorCollection) Run repository configuration validation(s) on action's data before testing the connection.
-
Constructor Details
-
VcsConfigurationHelperImpl
public VcsConfigurationHelperImpl(VcsViewerUIConfigBean vcsViewerUIConfigBean, org.apache.struts2.text.TextProvider textProvider, BambooPermissionManager bambooPermissionManager, RepositoryDefinitionManager repositoryDefinitionManager, VcsRepositoryConfigurationService vcsRepositoryConfigurationService, VcsBambooSpecsConfigurator vcsBambooSpecsConfigurator)
-
-
Method Details
-
validateVcsConfiguration
public void validateVcsConfiguration(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable @Nullable PartialVcsRepositoryData previousVcsData, @NotNull @NotNull ErrorCollection errorCollection, @NotNull @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Description copied from interface:VcsConfigurationHelperRun repository configuration validation(s) on action's data.- Specified by:
validateVcsConfigurationin interfaceVcsConfigurationHelper- Parameters:
apm-vcsDescriptor-previousVcsData-errorCollection-
-
validateVcsConfigurationForConnectionTesting
public void validateVcsConfigurationForConnectionTesting(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable @Nullable PartialVcsRepositoryData previousVcsData, @NotNull @NotNull ErrorCollection errorCollection) Description copied from interface:VcsConfigurationHelperRun repository configuration validation(s) on action's data before testing the connection.- Specified by:
validateVcsConfigurationForConnectionTestingin interfaceVcsConfigurationHelper- Parameters:
apm-vcsDescriptor-previousVcsData-errorCollection-
-
reconfigureRepositoryWithMavenData
@NotNull public @NotNull PartialVcsRepositoryData reconfigureRepositoryWithMavenData(@NotNull @NotNull VcsRepositoryModuleDescriptor oldModuleDescriptor, @NotNull @NotNull PartialVcsRepositoryData oldData, @Nullable @Nullable VcsRepositoryModuleDescriptor newModuleDescriptor, @NotNull @NotNull Map<String, String> newServerConfiguration, @Nullable @Nullable VcsBranch vcsBranch, @Nullable @Nullable String webRepositoryUrl) Description copied from interface:VcsConfigurationHelperCreates new repository configuration according to data found in a maven pom.xml.- Specified by:
reconfigureRepositoryWithMavenDatain interfaceVcsConfigurationHelper- Parameters:
oldModuleDescriptor- descriptor of the plugin which was used to check out maven pomoldData- repository data used to check out maven pomnewModuleDescriptor- descriptor of the repository plugin according to repository url found in pom.xmlnewServerConfiguration- server configuration as extracted byVcsMavenPomAccessor.parseMavenScmUrlToVcsLocation(String, VcsRepositoryData)vcsBranch- vcs branch as extracted byVcsMavenPomAccessor.parseMavenScmUrlToVcsBranch(String, VcsRepositoryData)webRepositoryUrl- url to be used by web repository viewer
-
getNewPartialVcsConfigurationFromActionData
@NotNull public @NotNull PartialVcsRepositoryData getNewPartialVcsConfigurationFromActionData(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @NotNull @NotNull String repositoryName, @Nullable @Nullable String userDescription, @Nullable @Nullable Long projectId, @Nullable @Nullable PartialVcsRepositoryData previousVcsDefinition, boolean unused, @NotNull @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Description copied from interface:VcsConfigurationHelperExtracts repository configuration from action's parameters for saving in DB.- Specified by:
getNewPartialVcsConfigurationFromActionDatain interfaceVcsConfigurationHelper- Parameters:
apm-vcsDescriptor-repositoryName-userDescription-projectId-previousVcsDefinition-unused-- Returns:
-
temporaryVcsDataFromActionParams
@NotNull public @NotNull PartialVcsRepositoryData temporaryVcsDataFromActionParams(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable @Nullable PartialVcsRepositoryData existingData, @NotNull @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Description copied from interface:VcsConfigurationHelperExtracts repository configuration from action's parameters. Used if action requires to be able to perform some vcs ops without actually creating a proper repository object in DB (e.g. test connection, checkout for maven import)- Specified by:
temporaryVcsDataFromActionParamsin interfaceVcsConfigurationHelper- Parameters:
apm-moduleDescriptor-existingData-- Returns:
-
validateRepositoryExistenceAndPermissions
@Nullable public @Nullable RepositoryDataEntity validateRepositoryExistenceAndPermissions(long repositoryId, org.apache.struts2.interceptor.ValidationAware validationAware) Description copied from interface:VcsConfigurationHelperChecks if a repository exists in the DB.- Specified by:
validateRepositoryExistenceAndPermissionsin interfaceVcsConfigurationHelper- Parameters:
repositoryId-validationAware- caller- Returns:
- repository database object if exists, null if it doesn't
-