Interface VcsLocationConfigurator

All Known Implementing Classes:
BitbucketCloudServerConfigurator, BitbucketServerServerConfigurator, GitHubServerConfigurator, GitServerConfigurator, LegacyRepositoryConfigurationExporter, LegacyVcsLocationConfigurator, SvnServerConfigurator

public interface VcsLocationConfigurator
Class providing UI to configure vcs server.
Since:
5.14
  • Method Details

    • populateContextForCreate

      void populateContextForCreate(@NotNull @NotNull Map<String,Object> context)
    • populateContextForEdit

      void populateContextForEdit(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
    • populateContextForView

      void populateContextForView(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
    • validate

      void validate(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull @NotNull ErrorCollection errorCollection)
    • validateForConnectionTesting

      default void validateForConnectionTesting(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull @NotNull ErrorCollection errorCollection)
      A method similar to validate(ActionParametersMap, VcsLocationDefinition, ErrorCollection) used to validate repository configuration before connection testing. This method may be more relaxed than normal validation. Additionally, different error messages may be displayed (e.g. related to impossibility of transferring files).
    • generateConfigMap

      @NotNull @NotNull Map<String,String> generateConfigMap(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition)
    • addDefaultsForAdvancedOptions

      void addDefaultsForAdvancedOptions(@NotNull @NotNull Map<String,String> cfgMap)
      In Plan creation screen advanced options' UI is not displayed. In that case the defaults for those options need to be provided.
      Parameters:
      cfgMap -
    • getServerHost

      @NotNull @NotNull String getServerHost(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
      What's the repository server host. It's OK to return an empty string.
    • getLocationIdentifier

      @NotNull @NotNull String getLocationIdentifier(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
      A string representing the location of the repository. Usually simply the content of url (or equivalent) field.
    • getSharedCredentialsIds

      @NotNull default @NotNull Iterable<Long> getSharedCredentialsIds(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
      Returns a list of shared credential ids used by a repository.
      Parameters:
      vcsLocationDefinition -
      Returns:
      the list of shared credential ids used by a repository.
    • getScmType

      default Optional<VcsType> getScmType(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
      Return the type of vcs system used by a repository. If the vcs system is a product build around some other vcs system (e.g. Bitbucket, GitHub), the type of that other system should be returned. For example, Bitbucket repositories are of type VcsType.GIT
      Parameters:
      vcsLocationDefinition -
      Returns:
      vcs type
    • setVcsLocationDataInConfig

      @NotNull default @NotNull Map<String,String> setVcsLocationDataInConfig(@NotNull @NotNull Map<String,String> configMap, @Nullable @Nullable String vcsLocationParentIdentifier, @Nullable @Nullable String vcsLocationRepositoryIdentifier)
      Modify config map by setting repository location data. The default implementation does not modify anything. The method should be overridden in pull request related implementations.
      Parameters:
      configMap -
      vcsLocationParentIdentifier -
      vcsLocationRepositoryIdentifier -
      Returns:
      modified map
    • isWebhookEnabled

      default boolean isWebhookEnabled(VcsRepositoryData vcsRepositoryData)
      Determines whether the specified repository data has the webhook option enabled.
      Returns:
      true if webhooks is enabled, false otherwise