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
ConstructorDescriptionVcsConfigurationHelperImpl
(VcsViewerUIConfigBean vcsViewerUIConfigBean, com.atlassian.struts.TextProvider textProvider, BambooPermissionManager bambooPermissionManager, RepositoryDefinitionManager repositoryDefinitionManager, VcsRepositoryConfigurationService vcsRepositoryConfigurationService, VcsBambooSpecsConfigurator vcsBambooSpecsConfigurator) -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull PartialVcsRepositoryData
getNewPartialVcsConfigurationFromActionData
(@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 PartialVcsRepositoryData
reconfigureRepositoryWithMavenData
(@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 PartialVcsRepositoryData
temporaryVcsDataFromActionParams
(@NotNull ActionParametersMap apm, @NotNull VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable PartialVcsRepositoryData existingData, @NotNull Set<VcsConfigurationHelper.Overrides> overrides) Extracts repository configuration from action's parameters.@Nullable RepositoryDataEntity
validateRepositoryExistenceAndPermissions
(long repositoryId, com.atlassian.struts.ValidationAware validationAware) Checks if a repository exists in the DB.@NotNull ErrorCollection
validateSharedRepositoryName
(String repositoryName) Check if new shared repository name is valid.void
validateSharedRepositoryName
(String repositoryName, com.atlassian.struts.ValidationAware validationAware) Check if new shared repository name is valid.void
validateVcsConfiguration
(@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.void
validateVcsConfigurationForConnectionTesting
(@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, com.atlassian.struts.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:VcsConfigurationHelper
Run repository configuration validation(s) on action's data.- Specified by:
validateVcsConfiguration
in interfaceVcsConfigurationHelper
-
validateVcsConfigurationForConnectionTesting
public void validateVcsConfigurationForConnectionTesting(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable @Nullable PartialVcsRepositoryData previousVcsData, @NotNull @NotNull ErrorCollection errorCollection) Description copied from interface:VcsConfigurationHelper
Run repository configuration validation(s) on action's data before testing the connection.- Specified by:
validateVcsConfigurationForConnectionTesting
in interfaceVcsConfigurationHelper
-
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:VcsConfigurationHelper
Creates new repository configuration according to data found in a maven pom.xml.- Specified by:
reconfigureRepositoryWithMavenData
in 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:VcsConfigurationHelper
Extracts repository configuration from action's parameters for saving in DB.- Specified by:
getNewPartialVcsConfigurationFromActionData
in interfaceVcsConfigurationHelper
- 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:VcsConfigurationHelper
Extracts 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:
temporaryVcsDataFromActionParams
in interfaceVcsConfigurationHelper
- Returns:
-
validateRepositoryExistenceAndPermissions
@Nullable public @Nullable RepositoryDataEntity validateRepositoryExistenceAndPermissions(long repositoryId, com.atlassian.struts.ValidationAware validationAware) Description copied from interface:VcsConfigurationHelper
Checks if a repository exists in the DB.- Specified by:
validateRepositoryExistenceAndPermissions
in interfaceVcsConfigurationHelper
validationAware
- caller- Returns:
- repository database object if exists, null if it doesn't
-