Class AbstractS3Processor
- java.lang.Object
-
- org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.aws.AbstractS3Processor
-
- All Implemented Interfaces:
DeploymentProcessor
,InitializableByConfigBean
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
S3DeploymentEventsProcessor
,S3SyncProcessor
public abstract class AbstractS3Processor extends AbstractMainDeploymentProcessor
Base implementation ofAbstractMainDeploymentProcessor
for processors that use AWS S3. Can be configured with the following YAML properties:- url: AWS S3 bucket URL to upload files
- Since:
- 3.1.8
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected AwsClientBuilderConfigurer
builderConfigurer
Helper class the configures credentials and other properties for aAmazonS3
client.protected static String
CONFIG_KEY_URL
protected static String
DELIMITER
protected org.slf4j.Logger
logger
protected static String
MACRO_SITENAME
protected com.amazonaws.services.s3.AmazonS3URI
s3Url
AWS S3 bucket URLprotected org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
threadPoolTaskExecutor
Thread pool to use forTransferManager
instances-
Fields inherited from class org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
FAIL_DEPLOYMENT_CONFIG_KEY, failDeploymentOnFailure
-
Fields inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
alwaysRun, env, excludeFiles, includeFiles, JUMPING_TO_PARAM_NAME, jumpTo, label, name, siteName, targetId
-
-
Constructor Summary
Constructors Constructor Description AbstractS3Processor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.amazonaws.services.s3.AmazonS3
buildClient()
Builds theAmazonS3
client.protected com.amazonaws.services.s3.transfer.TransferManager
buildTransferManager(com.amazonaws.services.s3.AmazonS3 client)
Builds theTransferManager
using the sharedExecutorService
protected void
doDestroy()
Allows extending classes perform any custom cleanupprotected void
doInit(org.apache.commons.configuration2.Configuration config)
Allows extending classes perform any custom initializationprotected String
getS3BaseKey()
Returns the base key from the S3 URL, making sure to replace the{siteName}
macro instancesprotected String
getS3Key(String file)
Builds the AWS S3 key for the given file-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
doExecute, doMainProcess, failDeploymentOnProcessorFailure, init, shouldExecute
-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
destroy, execute, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTo, supportsMode
-
-
-
-
Field Detail
-
CONFIG_KEY_URL
protected static final String CONFIG_KEY_URL
- See Also:
- Constant Field Values
-
MACRO_SITENAME
protected static final String MACRO_SITENAME
- See Also:
- Constant Field Values
-
DELIMITER
protected static final String DELIMITER
- See Also:
- Constant Field Values
-
logger
protected org.slf4j.Logger logger
-
builderConfigurer
protected AwsClientBuilderConfigurer builderConfigurer
Helper class the configures credentials and other properties for aAmazonS3
client.
-
s3Url
protected com.amazonaws.services.s3.AmazonS3URI s3Url
AWS S3 bucket URL
-
threadPoolTaskExecutor
protected org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor
Thread pool to use forTransferManager
instances
-
-
Method Detail
-
doInit
protected void doInit(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException
Allows extending classes perform any custom initialization- Specified by:
doInit
in classAbstractDeploymentProcessor
- Parameters:
config
- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException
- if there's configuration related exception
-
getS3BaseKey
protected String getS3BaseKey()
Returns the base key from the S3 URL, making sure to replace the{siteName}
macro instances
-
getS3Key
protected String getS3Key(String file)
Builds the AWS S3 key for the given file- Parameters:
file
- relative path of the file- Returns:
- the full S3 key
-
buildClient
protected com.amazonaws.services.s3.AmazonS3 buildClient()
Builds theAmazonS3
client.
-
buildTransferManager
protected com.amazonaws.services.s3.transfer.TransferManager buildTransferManager(com.amazonaws.services.s3.AmazonS3 client)
Builds theTransferManager
using the sharedExecutorService
-
doDestroy
protected void doDestroy() throws DeployerException
Allows extending classes perform any custom cleanup- Specified by:
doDestroy
in classAbstractDeploymentProcessor
- Throws:
DeployerException
- if an error occurs
-
-