Interface VcsConfigurationHelper

All Known Implementing Classes:
VcsConfigurationHelperImpl

@Internal public interface VcsConfigurationHelper
Bunch of common operations used in repository related actions.
  • Field Details

  • Method Details

    • validateVcsConfiguration

      void validateVcsConfiguration(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable @Nullable PartialVcsRepositoryData previousVcsDefinition, @NotNull @NotNull ErrorCollection errorCollection, @NotNull @NotNull Set<VcsConfigurationHelper.Overrides> overrides)
      Run repository configuration validation(s) on action's data.
      Parameters:
      apm -
      vcsDescriptor -
      previousVcsDefinition -
      errorCollection -
    • validateVcsConfigurationForConnectionTesting

      void validateVcsConfigurationForConnectionTesting(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor vcsDescriptor, @Nullable @Nullable PartialVcsRepositoryData previousVcsDefinition, @NotNull @NotNull ErrorCollection errorCollection)
      Run repository configuration validation(s) on action's data before testing the connection.
      Parameters:
      apm -
      vcsDescriptor -
      previousVcsDefinition -
      errorCollection -
    • reconfigureRepositoryWithMavenData

      @NotNull @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)
      Creates new repository configuration according to data found in a maven pom.xml.
      Parameters:
      oldModuleDescriptor - descriptor of the plugin which was used to check out maven pom
      oldData - repository data used to check out maven pom
      newModuleDescriptor - descriptor of the repository plugin according to repository url found in pom.xml
      newServerConfiguration - server configuration as extracted by VcsMavenPomAccessor.parseMavenScmUrlToVcsLocation(String, VcsRepositoryData)
      vcsBranch - vcs branch as extracted by VcsMavenPomAccessor.parseMavenScmUrlToVcsBranch(String, VcsRepositoryData)
      webRepositoryUrl - url to be used by web repository viewer
    • getNewPartialVcsConfigurationFromActionData

      @NotNull @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)
      Extracts repository configuration from action's parameters for saving in DB.
      Parameters:
      apm -
      vcsDescriptor -
      repositoryName -
      userDescription -
      projectId -
      previousVcsDefinition -
      unused -
      Returns:
    • temporaryVcsDataFromActionParams

      @NotNull @NotNull PartialVcsRepositoryData temporaryVcsDataFromActionParams(@NotNull @NotNull ActionParametersMap apm, @NotNull @NotNull VcsRepositoryModuleDescriptor moduleDescriptor, @Nullable @Nullable PartialVcsRepositoryData existingData, @NotNull @NotNull Set<VcsConfigurationHelper.Overrides> overrides)
      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)
      Parameters:
      apm -
      moduleDescriptor -
      existingData -
      Returns:
    • validateSharedRepositoryName

      void validateSharedRepositoryName(String repositoryName, com.atlassian.struts.ValidationAware validationAware)
      Check if new shared repository name is valid.
      Parameters:
      repositoryName - name
      validationAware - caller
    • validateSharedRepositoryName

      @NotNull @NotNull ErrorCollection validateSharedRepositoryName(String repositoryName)
      Check if new shared repository name is valid.
      Parameters:
      repositoryName - name
    • currentUserHasPermissionToCreateSharedRepository

      boolean currentUserHasPermissionToCreateSharedRepository()
      Returns:
      true if creation of a repository is allowed
    • validateRepositoryExistenceAndPermissions

      @Nullable @Nullable RepositoryDataEntity validateRepositoryExistenceAndPermissions(long repositoryId, com.atlassian.struts.ValidationAware validationAware)
      Checks if a repository exists in the DB.
      Parameters:
      repositoryId -
      validationAware - caller
      Returns:
      repository database object if exists, null if it doesn't