Package org.apache.camel.component.file
Class GenericFileOnCompletion<T>
java.lang.Object
org.apache.camel.component.file.GenericFileOnCompletion<T>
- All Implemented Interfaces:
org.apache.camel.spi.Synchronization
public class GenericFileOnCompletion<T>
extends Object
implements org.apache.camel.spi.Synchronization
On completion strategy that performs the required work after the
Exchange has been processed.
The work is for example to move the processed file into a backup folder, delete the file or in case of processing
failure do a rollback.-
Constructor Summary
ConstructorsConstructorDescriptionGenericFileOnCompletion(GenericFileEndpoint<T> endpoint, GenericFileOperations<T> operations, GenericFileProcessStrategy processStrategy, GenericFile<T> file, String absoluteFileName) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.spi.ExceptionHandlerprotected voidhandleDoneFile(org.apache.camel.Exchange exchange) protected voidhandleException(String message, org.apache.camel.Exchange exchange, Throwable t) voidonComplete(org.apache.camel.Exchange exchange) protected voidonCompletion(org.apache.camel.Exchange exchange) voidonFailure(org.apache.camel.Exchange exchange) protected voidprocessStrategyCommit(GenericFileProcessStrategy<T> processStrategy, org.apache.camel.Exchange exchange, GenericFile<T> file) Strategy when the file was processed and a commit should be executed.protected voidprocessStrategyRollback(GenericFileProcessStrategy<T> processStrategy, org.apache.camel.Exchange exchange, GenericFile<T> file) Strategy when the file was not processed and a rollback should be executed.voidsetExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.spi.Synchronization
getRouteSynchronization
-
Constructor Details
-
GenericFileOnCompletion
public GenericFileOnCompletion(GenericFileEndpoint<T> endpoint, GenericFileOperations<T> operations, GenericFileProcessStrategy processStrategy, GenericFile<T> file, String absoluteFileName)
-
-
Method Details
-
onComplete
public void onComplete(org.apache.camel.Exchange exchange) - Specified by:
onCompletein interfaceorg.apache.camel.spi.Synchronization
-
onFailure
public void onFailure(org.apache.camel.Exchange exchange) - Specified by:
onFailurein interfaceorg.apache.camel.spi.Synchronization
-
getExceptionHandler
public org.apache.camel.spi.ExceptionHandler getExceptionHandler() -
setExceptionHandler
public void setExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler) -
onCompletion
protected void onCompletion(org.apache.camel.Exchange exchange) -
processStrategyCommit
protected void processStrategyCommit(GenericFileProcessStrategy<T> processStrategy, org.apache.camel.Exchange exchange, GenericFile<T> file) Strategy when the file was processed and a commit should be executed.- Parameters:
processStrategy- the strategy to perform the commitexchange- the exchangefile- the file processed
-
processStrategyRollback
protected void processStrategyRollback(GenericFileProcessStrategy<T> processStrategy, org.apache.camel.Exchange exchange, GenericFile<T> file) Strategy when the file was not processed and a rollback should be executed.- Parameters:
processStrategy- the strategy to perform the commitexchange- the exchangefile- the file processed
-
handleDoneFile
protected void handleDoneFile(org.apache.camel.Exchange exchange) -
handleException
-
toString
-