Class BitbucketCloudServerConfigurator
java.lang.Object
com.atlassian.bamboo.plugins.bitbucket.v2.configurator.BitbucketCloudServerConfigurator
- All Implemented Interfaces:
VcsLocationConfigurator
-
Constructor Summary
ConstructorsConstructorDescriptionBitbucketCloudServerConfigurator
(com.atlassian.sal.api.message.I18nResolver i18nResolver, CredentialsAccessor credentialsAccessor, BitbucketApiService bitbucketApiService, SecretEncryptionService secretEncryptionService, AdministrationConfigurationAccessor administrationConfigurationAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDefaultsForAdvancedOptions
(@NotNull Map<String, String> cfgMap) In Plan creation screen advanced options' UI is not displayed.generateConfigMap
(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition) @NotNull String
getLocationIdentifier
(@NotNull VcsLocationDefinition vcsLocationDefinition) A string representing the location of the repository.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.getSharedCredentialsIds
(@NotNull VcsLocationDefinition vcsLocationDefinition) Returns a list of shared credential ids used by a repository.boolean
isWebhookEnabled
(@NotNull VcsRepositoryData vcsRepositoryData) Determines whether the specified repository data has the webhook option enabled.static boolean
isWebhookEnabledForRepository
(@NotNull VcsRepositoryData vcsRepositoryData) 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) setVcsLocationDataInConfig
(@NotNull Map<String, String> configMap, @Nullable String vcsLocationParentIdentifier, @Nullable String vcsLocationRepositoryIdentifier) Modify config map by setting repository location data.void
validate
(@NotNull ActionParametersMap actionParametersMap, @Nullable VcsLocationDefinition previousVcsLocationDefinition, @NotNull ErrorCollection errorCollection) void
validateForConnectionTesting
(@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.
-
Constructor Details
-
BitbucketCloudServerConfigurator
@Inject public BitbucketCloudServerConfigurator(com.atlassian.sal.api.message.I18nResolver i18nResolver, CredentialsAccessor credentialsAccessor, BitbucketApiService bitbucketApiService, SecretEncryptionService secretEncryptionService, AdministrationConfigurationAccessor administrationConfigurationAccessor)
-
-
Method Details
-
populateContextForCreate
- Specified by:
populateContextForCreate
in interfaceVcsLocationConfigurator
-
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 previousVcsLocationDefinition, @NotNull @NotNull ErrorCollection errorCollection) - Specified by:
validate
in interfaceVcsLocationConfigurator
-
validateForConnectionTesting
public void validateForConnectionTesting(@NotNull @NotNull ActionParametersMap actionParametersMap, @Nullable @Nullable VcsLocationDefinition previousVcsLocationDefinition, @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
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
-
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
-
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
-
getScmType
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
-
setVcsLocationDataInConfig
@NotNull public @NotNull Map<String,String> setVcsLocationDataInConfig(@NotNull @NotNull Map<String, String> configMap, @Nullable @Nullable String vcsLocationParentIdentifier, @Nullable @Nullable String vcsLocationRepositoryIdentifier) Description copied from interface:VcsLocationConfigurator
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.- Specified by:
setVcsLocationDataInConfig
in interfaceVcsLocationConfigurator
- Returns:
- modified map
-
isWebhookEnabled
Description copied from interface:VcsLocationConfigurator
Determines whether the specified repository data has the webhook option enabled.- Specified by:
isWebhookEnabled
in interfaceVcsLocationConfigurator
- Returns:
- true if webhooks is enabled, false otherwise
-
isWebhookEnabledForRepository
public static boolean isWebhookEnabledForRepository(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
-