Class GenericFileDeleteProcessStrategy<T>
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport<T>
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy<T>
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,GenericFileProcessStrategy<T>
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
-
Field Summary
Fields inherited from class org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport
camelContext, exclusiveReadLockStrategy
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
begin
(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) Called when work is about to begin on this file.void
commit
(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) Releases any file locks and possibly deletes or moves the file after successful processingvoid
rollback
(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) Releases any file locks and possibly deletes or moves the file after unsuccessful processingvoid
setBeginRenamer
(GenericFileRenamer<T> beginRenamer) void
setFailureRenamer
(GenericFileRenamer<T> failureRenamer) Methods inherited from class org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport
abort, deleteLocalWorkFile, doShutdown, doStart, doStop, getCamelContext, getExclusiveReadLockStrategy, prepareOnStartup, renameFile, setCamelContext, setExclusiveReadLockStrategy
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
GenericFileDeleteProcessStrategy
public GenericFileDeleteProcessStrategy()
-
-
Method Details
-
begin
public boolean begin(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception Description copied from interface:GenericFileProcessStrategy
Called when work is about to begin on this file. This method may attempt to acquire some file lock before returning true; returning false if the file lock could not be obtained so that the file should be ignored.- Specified by:
begin
in interfaceGenericFileProcessStrategy<T>
- Overrides:
begin
in classGenericFileProcessStrategySupport<T>
- Parameters:
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the file- Returns:
- true if the file can be processed (such as if a file lock could be obtained)
- Throws:
Exception
- can be thrown in case of errors
-
commit
public void commit(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception Description copied from interface:GenericFileProcessStrategy
Releases any file locks and possibly deletes or moves the file after successful processing- Specified by:
commit
in interfaceGenericFileProcessStrategy<T>
- Overrides:
commit
in classGenericFileProcessStrategySupport<T>
- Parameters:
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the file- Throws:
Exception
- can be thrown in case of errors
-
rollback
public void rollback(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange exchange, GenericFile<T> file) throws Exception Description copied from interface:GenericFileProcessStrategy
Releases any file locks and possibly deletes or moves the file after unsuccessful processing- Specified by:
rollback
in interfaceGenericFileProcessStrategy<T>
- Overrides:
rollback
in classGenericFileProcessStrategySupport<T>
- Parameters:
operations
- file operationsendpoint
- the endpointexchange
- the exchangefile
- the file- Throws:
Exception
- can be thrown in case of errors
-
getFailureRenamer
-
setFailureRenamer
-
getBeginRenamer
-
setBeginRenamer
-