Class GitHubServerConfigurator
java.lang.Object
com.atlassian.bamboo.plugins.github.configurator.GitHubServerConfigurator
- All Implemented Interfaces:
VcsLocationConfigurator
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubServerConfigurator(com.atlassian.sal.api.message.I18nResolver i18nResolver, CredentialsAccessor credentialsAccessor, AdministrationConfigurationAccessor administrationConfigurationAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultsForAdvancedOptions(@NotNull Map<String, String> cfgMap) In Plan creation screen advanced options' UI is not displayed.generateConfigMap(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition) @NotNull StringgetLocationIdentifier(@NotNull VcsLocationDefinition vcsLocationDefinition) A string representing the location of the repository.getLocationIndexKey(@NotNull VcsLocationDefinition vcsLocationDefinition) Provides indexing key for this location.getScmType(@NotNull VcsLocationDefinition vcsLocationDefinition) Return the type of vcs system used by a repository.@NotNull StringgetServerHost(@NotNull VcsLocationDefinition vcsLocationDefinition) What's the repository server host.getSharedCredentialsIds(@NotNull VcsLocationDefinition vcsLocationDefinition) Returns a list of shared credential ids used by a repository.booleanisWebhookEnabled(VcsRepositoryData vcsRepositoryData) Determines whether the specified repository data has the webhook option enabled.static booleanisWebhookEnabledForRepository(@NotNull VcsRepositoryData vcsRepositoryData) voidpopulateContextForCreate(@NotNull Map<String, Object> context) voidpopulateContextForEdit(@NotNull Map<String, Object> context, @NotNull VcsLocationDefinition vcsLocationDefinition) voidpopulateContextForView(@NotNull Map<String, Object> context, @NotNull VcsLocationDefinition vcsLocationDefinition) voidvalidate(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull ErrorCollection errorCollection) voidvalidateForConnectionTesting(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition, @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, waitMethods inherited from interface com.atlassian.bamboo.vcs.configurator.VcsLocationConfigurator
setVcsLocationDataInConfig
-
Constructor Details
-
GitHubServerConfigurator
@Inject public GitHubServerConfigurator(com.atlassian.sal.api.message.I18nResolver i18nResolver, CredentialsAccessor credentialsAccessor, AdministrationConfigurationAccessor administrationConfigurationAccessor)
-
-
Method Details
-
populateContextForCreate
- Specified by:
populateContextForCreatein interfaceVcsLocationConfigurator
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String, Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition) - Specified by:
populateContextForEditin interfaceVcsLocationConfigurator
-
populateContextForView
public void populateContextForView(@NotNull @NotNull Map<String, Object> context, @NotNull @NotNull VcsLocationDefinition vcsLocationDefinition) - Specified by:
populateContextForViewin interfaceVcsLocationConfigurator
-
validateForConnectionTesting
public void validateForConnectionTesting(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull @NotNull ErrorCollection errorCollection) Description copied from interface:VcsLocationConfiguratorA 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:
validateForConnectionTestingin interfaceVcsLocationConfigurator
-
validate
public void validate(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull @NotNull ErrorCollection errorCollection) - Specified by:
validatein interfaceVcsLocationConfigurator
-
generateConfigMap
@NotNull public @NotNull Map<String,String> generateConfigMap(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition) - Specified by:
generateConfigMapin interfaceVcsLocationConfigurator
-
addDefaultsForAdvancedOptions
Description copied from interface:VcsLocationConfiguratorIn Plan creation screen advanced options' UI is not displayed. In that case the defaults for those options need to be provided.- Specified by:
addDefaultsForAdvancedOptionsin interfaceVcsLocationConfigurator- Parameters:
cfgMap-
-
getServerHost
@NotNull public @NotNull String getServerHost(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition) Description copied from interface:VcsLocationConfiguratorWhat's the repository server host. It's OK to return an empty string.- Specified by:
getServerHostin interfaceVcsLocationConfigurator
-
getLocationIdentifier
@NotNull public @NotNull String getLocationIdentifier(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition) Description copied from interface:VcsLocationConfiguratorA string representing the location of the repository. Usually simply the content of url (or equivalent) field.- Specified by:
getLocationIdentifierin interfaceVcsLocationConfigurator
-
getScmType
Description copied from interface:VcsLocationConfiguratorReturn 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:
getScmTypein interfaceVcsLocationConfigurator- Parameters:
vcsLocationDefinition-- Returns:
- vcs type
-
isWebhookEnabled
Description copied from interface:VcsLocationConfiguratorDetermines whether the specified repository data has the webhook option enabled.- Specified by:
isWebhookEnabledin interfaceVcsLocationConfigurator- Returns:
- true if webhooks is enabled, false otherwise
-
isWebhookEnabledForRepository
public static boolean isWebhookEnabledForRepository(@NotNull @NotNull VcsRepositoryData vcsRepositoryData) -
getLocationIndexKey
public Optional<VcsLocationIndexKey> getLocationIndexKey(@NotNull @NotNull VcsLocationDefinition vcsLocationDefinition) Description copied from interface:VcsLocationConfiguratorProvides indexing key for this location.- Specified by:
getLocationIndexKeyin interfaceVcsLocationConfigurator
-