org.apache.camel.component.file.strategy
Class FileRenameProcessStrategy<T>

java.lang.Object
  extended by org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport<T>
      extended by org.apache.camel.component.file.strategy.FileRenameProcessStrategy<T>
All Implemented Interfaces:
GenericFileProcessStrategy<T>

public class FileRenameProcessStrategy<T>
extends GenericFileProcessStrategySupport<T>


Field Summary
 
Fields inherited from class org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport
exclusiveReadLockStrategy, log
 
Constructor Summary
FileRenameProcessStrategy()
           
 
Method Summary
 boolean begin(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, GenericFileExchange<T> exchange, GenericFile<T> file)
          Called when work is about to begin on this file.
 void commit(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, GenericFileExchange<T> exchange, GenericFile<T> file)
          Releases any file locks and possibly deletes or moves the file after successful processing
 GenericFileRenamer<T> getBeginRenamer()
           
 GenericFileRenamer<T> getCommitRenamer()
           
 void setBeginRenamer(GenericFileRenamer<T> beginRenamer)
           
 void setCommitRenamer(GenericFileRenamer<T> commitRenamer)
           
 
Methods inherited from class org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport
getExclusiveReadLockStrategy, rollback, setExclusiveReadLockStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRenameProcessStrategy

public FileRenameProcessStrategy()
Method Detail

begin

public boolean begin(GenericFileOperations<T> operations,
                     GenericFileEndpoint<T> endpoint,
                     GenericFileExchange<T> 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 interface GenericFileProcessStrategy<T>
Overrides:
begin in class GenericFileProcessStrategySupport<T>
Parameters:
operations - ftp operations
endpoint - the endpoint
exchange - the exchange
file - the remote 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,
                   GenericFileExchange<T> 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 interface GenericFileProcessStrategy<T>
Overrides:
commit in class GenericFileProcessStrategySupport<T>
Parameters:
operations - ftp operations
endpoint - the endpoint
exchange - the exchange
file - the remote file
Throws:
Exception - can be thrown in case of errors

getBeginRenamer

public GenericFileRenamer<T> getBeginRenamer()

setBeginRenamer

public void setBeginRenamer(GenericFileRenamer<T> beginRenamer)

getCommitRenamer

public GenericFileRenamer<T> getCommitRenamer()

setCommitRenamer

public void setCommitRenamer(GenericFileRenamer<T> commitRenamer)


Copyright © 2009 Apache Software Foundation. All Rights Reserved.