Class ArtifactHandlersServiceImpl
java.lang.Object
com.atlassian.bamboo.build.artifact.handlers.ArtifactHandlersServiceImpl
- All Implemented Interfaces:
ArtifactHandlersService
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetArtifactHandlerConfigurationWithoutPrefix
(@NotNull String artifactHandlerKey) Get configuration a specific artifact handler.@NotNull List<ArtifactHandlerConfigurator>
Get configurators for enabled artifact handlers@NotNull List<ArtifactHandlerModuleDescriptor>
Get list of module descriptors for enabled artifact handlers.@NotNull List<ArtifactHandlerModuleDescriptor>
Get the list of configurable by users module descriptors for enabled artifact handlers.static @NotNull Predicate<com.atlassian.plugin.ModuleDescriptor<ArtifactHandler>>
Get artifact handlers configurationSelected artifact handler stores in configuration as artifactHandler.getConfigurationPrefix + ":enabledForShared" key with "true" value*getEncryptedArtifactHandlerConfigurationWithoutPrefix
(@NotNull String artifactHandlerKey) Get configuration a specific artifact handler.Get artifact handlers configuration for runtime.static boolean
isArtifactHandlerEnabled
(@NotNull ArtifactHandlerConfigurator configurator, @NotNull Map<String, String> configuration) saveConfiguration
(@NotNull Map<String, String> configuration) Persist artifact handlers configurationvoid
updateArtifactHandlerConfiguration
(@NotNull String artifactHandlerKey, @NotNull Map<String, String> configuration) Update configuration of the given artifact handler.validateConfiguration
(@NotNull Map<String, String> artifactHandlerConfigurationToSave) Validate configuration of all handlersvalidateConfiguration
(@NotNull Map<String, String> artifactHandlerConfigurationToSave, @NotNull ArtifactHandlerModuleDescriptor descriptor) Validate configuration of a single handler
-
Field Details
-
BANDANA_KEY
- See Also:
-
ENABLED_FOR_SHARED
-
ENABLED_FOR_NON_SHARED
-
-
Constructor Details
-
ArtifactHandlersServiceImpl
public ArtifactHandlersServiceImpl()
-
-
Method Details
-
getConfiguration
Description copied from interface:ArtifactHandlersService
Get artifact handlers configuration- Specified by:
getConfiguration
in interfaceArtifactHandlersService
- Returns:
- copy of artifact handlers configuration
-
getRuntimeConfiguration
Description copied from interface:ArtifactHandlersService
Get artifact handlers configuration for runtime.Runtime configuration might be different from standard
configuration
. EachArtifactHandler
can have the configuration decorated by it's configurator implementation ofArtifactHandlerConfigurator.decorateConfigurationForRuntime(Map)
.- Specified by:
getRuntimeConfiguration
in interfaceArtifactHandlersService
- Returns:
- runtime artifact handlers configuration
-
getEnabledArtifactHandlerKeys
Selected artifact handler stores in configuration as artifactHandler.getConfigurationPrefix + ":enabledForShared" key with "true" value*- Specified by:
getEnabledArtifactHandlerKeys
in interfaceArtifactHandlersService
-
saveConfiguration
Description copied from interface:ArtifactHandlersService
Persist artifact handlers configuration- Specified by:
saveConfiguration
in interfaceArtifactHandlersService
- Returns:
- message collection with feedback from Artifact Handlers
-
validateConfiguration
public ErrorCollection validateConfiguration(@NotNull @NotNull Map<String, String> artifactHandlerConfigurationToSave) Description copied from interface:ArtifactHandlersService
Validate configuration of all handlers- Specified by:
validateConfiguration
in interfaceArtifactHandlersService
-
validateConfiguration
public ErrorCollection validateConfiguration(@NotNull @NotNull Map<String, String> artifactHandlerConfigurationToSave, @NotNull @NotNull ArtifactHandlerModuleDescriptor descriptor) Description copied from interface:ArtifactHandlersService
Validate configuration of a single handler- Specified by:
validateConfiguration
in interfaceArtifactHandlersService
-
getEncryptedArtifactHandlerConfigurationWithoutPrefix
public Map<String,String> getEncryptedArtifactHandlerConfigurationWithoutPrefix(@NotNull @NotNull String artifactHandlerKey) Description copied from interface:ArtifactHandlersService
Get configuration a specific artifact handler. Strip the arftifact handler prefix from the keys. E.g. instead of using custom.artifactHandlers.ServerLocalArtifactHandler.enabledForShared as key, use enabledForShared. Secret fields values will be encrypted.- Specified by:
getEncryptedArtifactHandlerConfigurationWithoutPrefix
in interfaceArtifactHandlersService
- Parameters:
artifactHandlerKey
- Key of the artifact handler to be retrieved- Returns:
- configuration of the given artifact handler
-
getArtifactHandlerConfigurationWithoutPrefix
public Map<String,String> getArtifactHandlerConfigurationWithoutPrefix(@NotNull @NotNull String artifactHandlerKey) Description copied from interface:ArtifactHandlersService
Get configuration a specific artifact handler. Strip the arftifact handler prefix from the keys. E.g. instead of using custom.artifactHandlers.ServerLocalArtifactHandler.enabledForShared as key, use enabledForShared. Secret fields will not be encrypted.- Specified by:
getArtifactHandlerConfigurationWithoutPrefix
in interfaceArtifactHandlersService
- Parameters:
artifactHandlerKey
- Key of the artifact handler to be retrieved- Returns:
- configuration of the given artifact handler
-
updateArtifactHandlerConfiguration
public void updateArtifactHandlerConfiguration(@NotNull @NotNull String artifactHandlerKey, @NotNull @NotNull Map<String, String> configuration) throws WebValidationExceptionDescription copied from interface:ArtifactHandlersService
Update configuration of the given artifact handler. Entries in parameterconfiguration
that are irrelevant to the givenartifactHandlerKey
will be ignored.- Specified by:
updateArtifactHandlerConfiguration
in interfaceArtifactHandlersService
- Parameters:
artifactHandlerKey
- Key of the artifact handler to be updatedconfiguration
- configuration of the artifact handler- Throws:
WebValidationException
-
getArtifactHandlerConfigurators
Description copied from interface:ArtifactHandlersService
Get configurators for enabled artifact handlers- Specified by:
getArtifactHandlerConfigurators
in interfaceArtifactHandlersService
-
getArtifactHandlerModuleDescriptors
@NotNull public @NotNull List<ArtifactHandlerModuleDescriptor> getArtifactHandlerModuleDescriptors()Description copied from interface:ArtifactHandlersService
Get list of module descriptors for enabled artifact handlers.- Specified by:
getArtifactHandlerModuleDescriptors
in interfaceArtifactHandlersService
-
getArtifactHandlerModuleDescriptorsAccessibleForUsers
@NotNull public @NotNull List<ArtifactHandlerModuleDescriptor> getArtifactHandlerModuleDescriptorsAccessibleForUsers()Description copied from interface:ArtifactHandlersService
Get the list of configurable by users module descriptors for enabled artifact handlers. This list does not contain handlers used internally by Bamboo, only the ones that can be selected by the user.- Specified by:
getArtifactHandlerModuleDescriptorsAccessibleForUsers
in interfaceArtifactHandlersService
-
getArtifactHandlersForUsersPredicate
@NotNull public static @NotNull Predicate<com.atlassian.plugin.ModuleDescriptor<ArtifactHandler>> getArtifactHandlersForUsersPredicate() -
isArtifactHandlerEnabled
public static boolean isArtifactHandlerEnabled(@NotNull @NotNull ArtifactHandlerConfigurator configurator, @NotNull @NotNull Map<String, String> configuration)
-