Class AbstractMainDeploymentProcessor
java.lang.Object
org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
- All Implemented Interfaces:
DeploymentProcessor
,InitializableByConfigBean
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractRemoteGitRepoAwareProcessor
,AbstractS3Processor
,AbstractSearchIndexingProcessor
,CloudFrontInvalidationProcessor
,CommandLineProcessor
,DelayProcessor
,FileBasedDeploymentEventProcessor
,FindAndReplaceProcessor
,GitDiffProcessor
,GitUpdateCommitIdProcessor
,HttpMethodCallProcessor
,ScriptProcessor
Base class for
DeploymentProcessor
s that are executed during the main
deployment phase, which is the phase where the change set is retrieved and the files are processed.- Author:
- avasquez
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected ChangeSet
doExecute
(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) Triggers the execution of the processor for the givenDeployment
andChangeSet
protected abstract ChangeSet
doMainProcess
(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) protected boolean
Indicates if the deployment should be marked as failed if this processor throws an errorvoid
init
(org.apache.commons.configuration2.Configuration config) Initializes the bean using the specified configuration.protected boolean
shouldExecute
(Deployment deployment, ChangeSet filteredChangeSet) Indicates if the processor should be executed for the givenDeployment
andChangeSet
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
destroy, doDestroy, doInit, execute, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTo, supportsMode
-
Field Details
-
FAIL_DEPLOYMENT_CONFIG_KEY
- See Also:
-
failDeploymentOnFailure
protected boolean failDeploymentOnFailure
-
-
Constructor Details
-
AbstractMainDeploymentProcessor
public AbstractMainDeploymentProcessor()
-
-
Method Details
-
init
public void init(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException, DeployerException Initializes the bean using the specified configuration.- Specified by:
init
in interfaceInitializableByConfigBean
- Overrides:
init
in classAbstractDeploymentProcessor
- Parameters:
config
- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException
- if there's configuration related exceptionDeployerException
- if there's a general exception on init
-
doExecute
protected ChangeSet doExecute(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws Exception Triggers the execution of the processor for the givenDeployment
andChangeSet
- Specified by:
doExecute
in classAbstractDeploymentProcessor
- Parameters:
deployment
- the current deploymentfilteredChangeSet
- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet)
)originalChangeSet
- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSet
or null - Throws:
Exception
- if there is any error processing theChangeSet
-
shouldExecute
Indicates if the processor should be executed for the givenDeployment
andChangeSet
- Specified by:
shouldExecute
in classAbstractDeploymentProcessor
- Parameters:
deployment
- theDeployment
to checkfilteredChangeSet
- theChangeSet
to check- Returns:
- true if the processor should be executed
-
doMainProcess
protected abstract ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException Performs the actual work of processing the files in theChangeSet
, it is also possible to return a newChangeSet
to be used for the following processors in the pipeline- Parameters:
deployment
- the current deploymentexecution
- the current executionfilteredChangeSet
- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet)
)originalChangeSet
- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSet
or null - Throws:
DeployerException
- if there is any error processing theChangeSet
-
failDeploymentOnProcessorFailure
protected boolean failDeploymentOnProcessorFailure()Indicates if the deployment should be marked as failed if this processor throws an error
-