Class GitServerConfigurator
- java.lang.Object
-
- com.atlassian.bamboo.plugins.git.v2.configurator.GitServerConfigurator
-
- All Implemented Interfaces:
VcsLocationConfigurator
public class GitServerConfigurator extends Object implements VcsLocationConfigurator
-
-
Constructor Summary
Constructors Constructor Description GitServerConfigurator(com.atlassian.sal.api.message.I18nResolver i18nResolver, CustomVariableContext customVariableContext, CredentialsAccessor credentialsAccessor, SecretEncryptionService secretEncryptionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultsForAdvancedOptions(Map<String,String> cfgMap)
In Plan creation screen advanced options' UI is not displayed.@NotNull Map<String,String>
generateConfigMap(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition)
@NotNull String
getLocationIdentifier(@NotNull VcsLocationDefinition vcsLocationDefinition)
A string representing the location of the repository.Optional<VcsType>
getScmType(@NotNull VcsLocationDefinition vcsLocationDefinition)
Return the type of vcs system used by a repository.@NotNull String
getServerHost(@NotNull VcsLocationDefinition vcsLocationDefinition)
What's the repository server host.@NotNull Iterable<Long>
getSharedCredentialsIds(@NotNull VcsLocationDefinition vcsLocationDefinition)
Returns a list of shared credential ids used by a repository.List<NameValuePair>
getSshCredentialsSources()
void
populateContextForCreate(@NotNull Map<String,Object> context)
void
populateContextForEdit(@NotNull Map<String,Object> context, @NotNull VcsLocationDefinition vcsLocationDefinition)
void
populateContextForView(@NotNull Map<String,Object> context, @NotNull VcsLocationDefinition vcsLocationDefinition)
void
validate(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousDefinition, @NotNull ErrorCollection errorCollection)
void
validateForConnectionTesting(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousDefinition, @NotNull ErrorCollection errorCollection)
A method similar toVcsLocationConfigurator.validate(ActionParametersMap, VcsLocationDefinition, ErrorCollection)
used to validate repository configuration before connection testing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.vcs.configurator.VcsLocationConfigurator
isWebhookEnabled, setVcsLocationDataInConfig
-
-
-
-
Constructor Detail
-
GitServerConfigurator
@Inject public GitServerConfigurator(com.atlassian.sal.api.message.I18nResolver i18nResolver, CustomVariableContext customVariableContext, CredentialsAccessor credentialsAccessor, SecretEncryptionService secretEncryptionService)
-
-
Method Detail
-
populateContextForCreate
public void populateContextForCreate(@NotNull @NotNull Map<String,Object> context)
- Specified by:
populateContextForCreate
in interfaceVcsLocationConfigurator
-
getSshCredentialsSources
public List<NameValuePair> getSshCredentialsSources()
-
getSharedCredentialsIds
@NotNull public @NotNull Iterable<Long> getSharedCredentialsIds(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
Description copied from interface:VcsLocationConfigurator
Returns a list of shared credential ids used by a repository.- Specified by:
getSharedCredentialsIds
in interfaceVcsLocationConfigurator
- Returns:
- the list of shared credential ids used by a repository.
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
- Specified by:
populateContextForEdit
in interfaceVcsLocationConfigurator
-
populateContextForView
public void populateContextForView(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
- Specified by:
populateContextForView
in interfaceVcsLocationConfigurator
-
validate
public void validate(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousDefinition, @NotNull @NotNull ErrorCollection errorCollection)
- Specified by:
validate
in interfaceVcsLocationConfigurator
-
validateForConnectionTesting
@NotNull public void validateForConnectionTesting(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousDefinition, @NotNull @NotNull ErrorCollection errorCollection)
Description copied from interface:VcsLocationConfigurator
A method similar toVcsLocationConfigurator.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).- Specified by:
validateForConnectionTesting
in interfaceVcsLocationConfigurator
-
generateConfigMap
@NotNull public @NotNull Map<String,String> generateConfigMap(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition)
- Specified by:
generateConfigMap
in interfaceVcsLocationConfigurator
-
addDefaultsForAdvancedOptions
public void addDefaultsForAdvancedOptions(Map<String,String> cfgMap)
Description copied from interface:VcsLocationConfigurator
In Plan creation screen advanced options' UI is not displayed. In that case the defaults for those options need to be provided.- Specified by:
addDefaultsForAdvancedOptions
in interfaceVcsLocationConfigurator
-
getLocationIdentifier
@NotNull public @NotNull String getLocationIdentifier(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
Description copied from interface:VcsLocationConfigurator
A string representing the location of the repository. Usually simply the content of url (or equivalent) field.- Specified by:
getLocationIdentifier
in interfaceVcsLocationConfigurator
-
getServerHost
@NotNull public @NotNull String getServerHost(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
Description copied from interface:VcsLocationConfigurator
What's the repository server host. It's OK to return an empty string.- Specified by:
getServerHost
in interfaceVcsLocationConfigurator
-
getScmType
public Optional<VcsType> getScmType(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition)
Description copied from interface:VcsLocationConfigurator
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 typeVcsType.GIT
- Specified by:
getScmType
in interfaceVcsLocationConfigurator
- Returns:
- vcs type
-
-