Class S3ArtifactHandlerConfigurator
- java.lang.Object
-
- com.atlassian.bamboo.build.artifact.handlers.AbstractArtifactHandlerConfigurator
-
- com.atlassian.bamboo.build.artifact.S3ArtifactHandlerConfigurator
-
- All Implemented Interfaces:
ArtifactHandlerConfigurator
,InitablePluginModule<ArtifactHandlerModuleDescriptor>
,BambooPluginModule
public class S3ArtifactHandlerConfigurator extends AbstractArtifactHandlerConfigurator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
S3ArtifactHandlerConfigurator.AwsCredentialsSource
S3 artifact handler can use EC2 AWS credentials or use its own set.
-
Field Summary
Fields Modifier and Type Field Description static String
CONF_ACCESS_KEY_ID
static String
CONF_BUCKET_NAME
static String
CONF_BUCKET_PATH
static String
CONF_CREDENTIALS_SOURCE
static String
CONF_CREDENTIALS_SOURCE_OPTIONS
static String
CONF_MAX_ARTIFACT_FILE_COUNT
static String
CONF_REGION
static String
CONF_SECRET_ACCESS_KEY
static String
EC2_PROFILE_CONFIGURED
static String
S3_STORAGE_PROPERTIES_PREFIX
static String
SKIP_BUCKET_VALIDATION
-
Fields inherited from class com.atlassian.bamboo.build.artifact.handlers.AbstractArtifactHandlerConfigurator
NON_SHARED_ARTIFACT_OPTION_NAME, SHARED_ARTIFACT_OPTION_NAME
-
-
Constructor Summary
Constructors Constructor Description S3ArtifactHandlerConfigurator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageCollection
beforeSave(Map<String,String> artifactHandlersConfigurationBeforeSave, Map<String,String> existingArtifactHandlersConfiguration)
Pre save action handler, allows to gather feedback from configurator before artifact handler configuration saving.void
decorateConfigurationForRuntime(@NotNull Map<String,String> artifactHandlersConfiguration)
Decorate artifact handlers configuration for runtime.protected com.amazonaws.services.s3.AmazonS3
getAmazonS3(@Nullable com.amazonaws.regions.Region region, @NotNull com.amazonaws.auth.AWSCredentials awsCredentials)
Map<String,String>
getArtifactHandlerConfiguration(@NotNull Map<String,String> configuration)
Filter out the current configuration of the artifact handler from the given map.Map<String,String>
getEncryptedArtifactHandlerConfiguration(@NotNull Map<String,String> configuration)
Filter out configuration of the artifact handler from the given map and encrypt sensitive field values.boolean
isConfigurationComplete(@NotNull Map<String,String> artifactHandlersConfiguration)
Validate if configuration of the artifact handler is completevoid
populateContextForEdit(@NotNull Map<String,Object> context)
void
postProcessConfiguration(ActionParametersMap actionParametersMap)
Any configuration adjustments that need to happen before configuration is saved should be done here.void
validateConfiguration(@NotNull Map<String,String> newArtifactHandlersConfiguration, @NotNull Map<String,String> oldArtifactHandlersConfiguration, @NotNull ErrorCollection errorCollection)
Validate configuration.-
Methods inherited from class com.atlassian.bamboo.build.artifact.handlers.AbstractArtifactHandlerConfigurator
getConfigurationKey, init
-
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.build.artifact.handlers.ArtifactHandlerConfigurator
getRawArtifactHandlerConfigurationData
-
-
-
-
Field Detail
-
S3_STORAGE_PROPERTIES_PREFIX
public static final String S3_STORAGE_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
CONF_ACCESS_KEY_ID
public static final String CONF_ACCESS_KEY_ID
- See Also:
- Constant Field Values
-
CONF_SECRET_ACCESS_KEY
public static final String CONF_SECRET_ACCESS_KEY
- See Also:
- Constant Field Values
-
CONF_BUCKET_NAME
public static final String CONF_BUCKET_NAME
- See Also:
- Constant Field Values
-
CONF_BUCKET_PATH
public static final String CONF_BUCKET_PATH
- See Also:
- Constant Field Values
-
CONF_REGION
public static final String CONF_REGION
- See Also:
- Constant Field Values
-
CONF_CREDENTIALS_SOURCE
public static final String CONF_CREDENTIALS_SOURCE
- See Also:
- Constant Field Values
-
CONF_CREDENTIALS_SOURCE_OPTIONS
public static final String CONF_CREDENTIALS_SOURCE_OPTIONS
- See Also:
- Constant Field Values
-
CONF_MAX_ARTIFACT_FILE_COUNT
public static final String CONF_MAX_ARTIFACT_FILE_COUNT
- See Also:
- Constant Field Values
-
EC2_PROFILE_CONFIGURED
public static final String EC2_PROFILE_CONFIGURED
- See Also:
- Constant Field Values
-
SKIP_BUCKET_VALIDATION
public static final String SKIP_BUCKET_VALIDATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String,Object> context)
- Specified by:
populateContextForEdit
in interfaceArtifactHandlerConfigurator
- Overrides:
populateContextForEdit
in classAbstractArtifactHandlerConfigurator
-
postProcessConfiguration
public void postProcessConfiguration(ActionParametersMap actionParametersMap)
Description copied from interface:ArtifactHandlerConfigurator
Any configuration adjustments that need to happen before configuration is saved should be done here.- Specified by:
postProcessConfiguration
in interfaceArtifactHandlerConfigurator
- Overrides:
postProcessConfiguration
in classAbstractArtifactHandlerConfigurator
-
decorateConfigurationForRuntime
public void decorateConfigurationForRuntime(@NotNull @NotNull Map<String,String> artifactHandlersConfiguration)
Description copied from interface:ArtifactHandlerConfigurator
Decorate artifact handlers configuration for runtime. Implement this method to append any necessary properties which were not persisted in handler configuration.- Specified by:
decorateConfigurationForRuntime
in interfaceArtifactHandlerConfigurator
- Overrides:
decorateConfigurationForRuntime
in classAbstractArtifactHandlerConfigurator
- Parameters:
artifactHandlersConfiguration
- artifact handlers configuration map
-
validateConfiguration
public void validateConfiguration(@NotNull @NotNull Map<String,String> newArtifactHandlersConfiguration, @NotNull @NotNull Map<String,String> oldArtifactHandlersConfiguration, @NotNull @NotNull ErrorCollection errorCollection)
Description copied from interface:ArtifactHandlerConfigurator
Validate configuration.- Specified by:
validateConfiguration
in interfaceArtifactHandlerConfigurator
- Overrides:
validateConfiguration
in classAbstractArtifactHandlerConfigurator
- Parameters:
newArtifactHandlersConfiguration
- new configuration to be validatedoldArtifactHandlersConfiguration
- existing configurationerrorCollection
- error collection to be set on validation failure
-
isConfigurationComplete
public boolean isConfigurationComplete(@NotNull @NotNull Map<String,String> artifactHandlersConfiguration)
Description copied from interface:ArtifactHandlerConfigurator
Validate if configuration of the artifact handler is complete- Specified by:
isConfigurationComplete
in interfaceArtifactHandlerConfigurator
- Overrides:
isConfigurationComplete
in classAbstractArtifactHandlerConfigurator
- Parameters:
artifactHandlersConfiguration
- configuration to be validated
-
getArtifactHandlerConfiguration
public Map<String,String> getArtifactHandlerConfiguration(@NotNull @NotNull Map<String,String> configuration)
Description copied from interface:ArtifactHandlerConfigurator
Filter out the current configuration of the artifact handler from the given map. Don't include data that are not currently used- Specified by:
getArtifactHandlerConfiguration
in interfaceArtifactHandlerConfigurator
- Overrides:
getArtifactHandlerConfiguration
in classAbstractArtifactHandlerConfigurator
- Parameters:
configuration
- - artifact handlers configuration data- Returns:
- Subset of given configuration that is only relevant to this artifact handler's current configuration
-
getEncryptedArtifactHandlerConfiguration
public Map<String,String> getEncryptedArtifactHandlerConfiguration(@NotNull @NotNull Map<String,String> configuration)
Description copied from interface:ArtifactHandlerConfigurator
Filter out configuration of the artifact handler from the given map and encrypt sensitive field values.- Specified by:
getEncryptedArtifactHandlerConfiguration
in interfaceArtifactHandlerConfigurator
- Overrides:
getEncryptedArtifactHandlerConfiguration
in classAbstractArtifactHandlerConfigurator
- Parameters:
configuration
- - artifact handlers configuration data- Returns:
- Subset of given configuration that is only relevant to this artifact handler
-
beforeSave
public MessageCollection beforeSave(Map<String,String> artifactHandlersConfigurationBeforeSave, Map<String,String> existingArtifactHandlersConfiguration)
Description copied from interface:ArtifactHandlerConfigurator
Pre save action handler, allows to gather feedback from configurator before artifact handler configuration saving.- Specified by:
beforeSave
in interfaceArtifactHandlerConfigurator
- Overrides:
beforeSave
in classAbstractArtifactHandlerConfigurator
- Parameters:
artifactHandlersConfigurationBeforeSave
- updated configurationexistingArtifactHandlersConfiguration
- existing configuration- Returns:
- collection of messages which should be shown to user after configuration saving
-
getAmazonS3
protected com.amazonaws.services.s3.AmazonS3 getAmazonS3(@Nullable @Nullable com.amazonaws.regions.Region region, @NotNull @NotNull com.amazonaws.auth.AWSCredentials awsCredentials)
-
-