|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.file.GenericFileConsumer<T>
public abstract class GenericFileConsumer<T>
Base class for remote file consumers.
| Field Summary | |
|---|---|
protected GenericFileEndpoint<T> |
endpoint
|
protected String |
fileExpressionResult
|
protected org.apache.commons.logging.Log |
log
|
protected boolean |
loggedIn
|
protected GenericFileOperations<T> |
operations
|
| Constructor Summary | |
|---|---|
GenericFileConsumer(GenericFileEndpoint<T> endpoint,
Processor processor,
GenericFileOperations<T> operations)
|
|
| Method Summary | |
|---|---|
protected boolean |
isMatched(GenericFile<T> file,
boolean isDirectory)
Strategy to perform file matching based on endpoint configuration. |
protected boolean |
isValidFile(GenericFile<T> file,
boolean isDirectory)
Strategy for validating if the given remote file should be included or not |
protected void |
poll()
Poll for files |
protected abstract void |
pollDirectory(String fileName,
List<GenericFile<T>> fileList)
Polls the given directory for files to process |
protected boolean |
prePollCheck()
Override if required. |
protected void |
processExchange(GenericFileExchange<T> exchange)
Processes the exchange |
protected void |
processStrategyCommit(GenericFileProcessStrategy<T> processStrategy,
GenericFileExchange<T> exchange,
GenericFile<T> file)
Strategy when the file was processed and a commit should be executed. |
protected void |
processStrategyRollback(GenericFileProcessStrategy<T> processStrategy,
GenericFileExchange<T> exchange,
GenericFile<T> file)
Strategy when the file was not processed and a rollback should be executed. |
| Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
|---|
doStart, doStop, getDelay, getInitialDelay, getTimeUnit, isUseFixedDelay, run, setDelay, setInitialDelay, setTimeUnit, setUseFixedDelay |
| Methods inherited from class org.apache.camel.impl.DefaultConsumer |
|---|
getAsyncProcessor, getEndpoint, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, getStatus, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, notStarting, removeChildService, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Field Detail |
|---|
protected final transient org.apache.commons.logging.Log log
protected GenericFileEndpoint<T> endpoint
protected GenericFileOperations<T> operations
protected boolean loggedIn
protected String fileExpressionResult
| Constructor Detail |
|---|
public GenericFileConsumer(GenericFileEndpoint<T> endpoint,
Processor processor,
GenericFileOperations<T> operations)
| Method Detail |
|---|
protected void poll()
throws Exception
poll in class ScheduledPollConsumerException - can be thrown if an exception occurred during polling
protected boolean prePollCheck()
throws Exception
Exception
protected abstract void pollDirectory(String fileName,
List<GenericFile<T>> fileList)
fileName - current directory or filefileList - current list of files gatheredprotected void processExchange(GenericFileExchange<T> exchange)
exchange - the exchange
protected void processStrategyCommit(GenericFileProcessStrategy<T> processStrategy,
GenericFileExchange<T> exchange,
GenericFile<T> file)
processStrategy - the strategy to perform the commitexchange - the exchangefile - the file processed
protected void processStrategyRollback(GenericFileProcessStrategy<T> processStrategy,
GenericFileExchange<T> exchange,
GenericFile<T> file)
processStrategy - the strategy to perform the commitexchange - the exchangefile - the file processed
protected boolean isValidFile(GenericFile<T> file,
boolean isDirectory)
file - the remote fileisDirectory - wether the file is a directory or a file
protected boolean isMatched(GenericFile<T> file,
boolean isDirectory)
file - the remote fileisDirectory - wether the file is a directory or a file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||