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
Base implementation of
AbstractMainDeploymentProcessor
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
Modifier and TypeFieldDescriptionprotected AwsClientBuilderConfigurer
Helper class the configures credentials and other properties for aAmazonS3
client.protected static final String
protected static final String
protected org.slf4j.Logger
protected static final String
protected com.amazonaws.services.s3.AmazonS3URI
AWS S3 bucket URLprotected org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Thread pool to use forTransferManager
instancesFields 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
ConstructorDescriptionAbstractS3Processor
(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.amazonaws.services.s3.AmazonS3
Builds theAmazonS3
client.protected com.amazonaws.services.s3.transfer.TransferManager
buildTransferManager
(com.amazonaws.services.s3.AmazonS3 client) Builds theTransferManager
using the sharedExecutorService
protected void
Allows extending classes perform any custom cleanupprotected void
doInit
(org.apache.commons.configuration2.Configuration config) Allows extending classes perform any custom initializationprotected String
Returns the base key from the S3 URL, making sure to replace the{siteName}
macro instancesprotected String
Builds the AWS S3 key for the given fileMethods 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 Details
-
CONFIG_KEY_URL
- See Also:
-
MACRO_SITENAME
- See Also:
-
DELIMITER
- See Also:
-
logger
protected org.slf4j.Logger logger -
builderConfigurer
Helper class the configures credentials and other properties for aAmazonS3
client. -
s3Url
protected com.amazonaws.services.s3.AmazonS3URI s3UrlAWS S3 bucket URL -
threadPoolTaskExecutor
protected org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutorThread pool to use forTransferManager
instances
-
-
Constructor Details
-
AbstractS3Processor
public AbstractS3Processor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor)
-
-
Method Details
-
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
Returns the base key from the S3 URL, making sure to replace the{siteName}
macro instances -
getS3Key
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
Allows extending classes perform any custom cleanup- Specified by:
doDestroy
in classAbstractDeploymentProcessor
- Throws:
DeployerException
- if an error occurs
-