Class ArtifactHandlersServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.build.artifact.handlers.ArtifactHandlersServiceImpl
-
- All Implemented Interfaces:
ArtifactHandlersService
public class ArtifactHandlersServiceImpl extends Object implements ArtifactHandlersService
-
-
Field Summary
Fields Modifier and Type Field Description static String
BANDANA_KEY
static String
ENABLED_FOR_NON_SHARED
static String
ENABLED_FOR_SHARED
-
Constructor Summary
Constructors Constructor Description ArtifactHandlersServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getArtifactHandlerConfigurationWithoutPrefix(@NotNull String artifactHandlerKey)
Get configuration a specific artifact handler.@NotNull List<ArtifactHandlerConfigurator>
getArtifactHandlerConfigurators()
Get configurators for enabled artifact handlers@NotNull List<ArtifactHandlerModuleDescriptor>
getArtifactHandlerModuleDescriptors()
Get list of module descriptors for enabled artifact handlers.@NotNull List<ArtifactHandlerModuleDescriptor>
getArtifactHandlerModuleDescriptorsAccessibleForUsers()
Get the list of configurable by users module descriptors for enabled artifact handlers.static @NotNull Predicate<com.atlassian.plugin.ModuleDescriptor<ArtifactHandler>>
getArtifactHandlersForUsersPredicate()
@NotNull Map<String,String>
getConfiguration()
Get artifact handlers configuration@NotNull Set<String>
getEnabledArtifactHandlerKeys()
Selected artifact handler stores in configuration as artifactHandler.getConfigurationPrefix + ":enabledForShared" key with "true" value*Map<String,String>
getEncryptedArtifactHandlerConfigurationWithoutPrefix(@NotNull String artifactHandlerKey)
Get configuration a specific artifact handler.@NotNull Map<String,String>
getRuntimeConfiguration()
Get artifact handlers configuration for runtime.static boolean
isArtifactHandlerEnabled(@NotNull ArtifactHandlerConfigurator configurator, @NotNull Map<String,String> configuration)
MessageCollection
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.ErrorCollection
validateConfiguration(@NotNull Map<String,String> artifactHandlerConfigurationToSave)
Validate configuration of all handlersErrorCollection
validateConfiguration(@NotNull Map<String,String> artifactHandlerConfigurationToSave, @NotNull ArtifactHandlerModuleDescriptor descriptor)
Validate configuration of a single handler
-
-
-
Field Detail
-
BANDANA_KEY
public static final String BANDANA_KEY
- See Also:
- Constant Field Values
-
ENABLED_FOR_SHARED
public static final String ENABLED_FOR_SHARED
-
ENABLED_FOR_NON_SHARED
public static final String ENABLED_FOR_NON_SHARED
-
-
Method Detail
-
getConfiguration
@NotNull public @NotNull Map<String,String> getConfiguration()
Description copied from interface:ArtifactHandlersService
Get artifact handlers configuration- Specified by:
getConfiguration
in interfaceArtifactHandlersService
- Returns:
- copy of artifact handlers configuration
-
getRuntimeConfiguration
@NotNull public @NotNull Map<String,String> 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
@NotNull public @NotNull Set<String> getEnabledArtifactHandlerKeys()
Selected artifact handler stores in configuration as artifactHandler.getConfigurationPrefix + ":enabledForShared" key with "true" value*- Specified by:
getEnabledArtifactHandlerKeys
in interfaceArtifactHandlersService
-
saveConfiguration
public MessageCollection saveConfiguration(@NotNull @NotNull Map<String,String> configuration)
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 WebValidationException
Description 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
@NotNull public @NotNull List<ArtifactHandlerConfigurator> 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)
-
-