|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.ServiceSupport org.apache.camel.impl.DefaultEndpoint org.apache.camel.impl.ScheduledPollEndpoint org.apache.camel.component.file.GenericFileEndpoint<T>
public abstract class GenericFileEndpoint<T>
Base class for file endpoints
Fields inherited from class org.apache.camel.support.ServiceSupport |
---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
Constructor Summary | |
---|---|
GenericFileEndpoint()
|
|
GenericFileEndpoint(String endpointUri,
Component component)
|
Method Summary | |
---|---|
void |
configureExchange(Exchange exchange)
Set up the exchange properties with the options of the file endpoint |
void |
configureMessage(GenericFile<T> file,
Message message)
Configures the given message with the file which sets the body to the file object. |
protected String |
configureMoveOrPreMoveExpression(String expression)
Strategy to configure the move or premove option based on a String input. |
abstract GenericFileConsumer<T> |
createConsumer(Processor processor)
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor |
protected String |
createDoneFileName(String fileName)
Creates the associated name of the done file based on the given file name. |
abstract Exchange |
createExchange(GenericFile<T> file)
|
protected GenericFileProcessStrategy<T> |
createGenericFileStrategy()
A strategy method to lazily create the file strategy |
abstract GenericFileProducer<T> |
createProducer()
Creates a new producer which is used send messages into the endpoint |
protected void |
doStart()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
int |
getBufferSize()
|
String |
getCharset()
|
GenericFileConfiguration |
getConfiguration()
|
String |
getDoneFileName()
|
List<Exchange> |
getExchanges()
This implementation will not load the file content. |
String |
getExclude()
|
GenericFileExclusiveReadLockStrategy<T> |
getExclusiveReadLockStrategy()
|
GenericFileExist |
getFileExist()
|
Expression |
getFileName()
|
abstract char |
getFileSeparator()
|
GenericFileFilter<T> |
getFilter()
|
String |
getGeneratedFileName(Message message)
Return the file name that will be auto-generated for the given message if none is provided |
GenericFileProcessStrategy<T> |
getGenericFileProcessStrategy()
|
IdempotentRepository<String> |
getIdempotentRepository()
|
String |
getInclude()
|
IdempotentRepository<String> |
getInProgressRepository()
|
String |
getLocalWorkDirectory()
|
int |
getMaxDepth()
|
int |
getMaxMessagesPerPoll()
|
int |
getMinDepth()
|
Expression |
getMove()
|
Expression |
getMoveFailed()
|
protected Map<String,Object> |
getParamsAsMap()
|
Expression |
getPreMove()
|
GenericFileProcessStrategy<T> |
getProcessStrategy()
|
String |
getReadLock()
|
long |
getReadLockCheckInterval()
|
long |
getReadLockTimeout()
|
abstract String |
getScheme()
|
Comparator<Exchange> |
getSortBy()
|
Comparator<GenericFile<T>> |
getSorter()
|
Expression |
getTempFileName()
|
String |
getTempPrefix()
|
abstract boolean |
isAbsolute(String name)
|
boolean |
isAutoCreate()
|
boolean |
isDelete()
|
boolean |
isDirectoryMustExist()
|
protected boolean |
isDoneFile(String fileName)
Is the given file a done file? This method should only be invoked if a done filename property has been set on this endpoint. |
boolean |
isEagerDeleteTargetFile()
|
boolean |
isFlatten()
|
Boolean |
isIdempotent()
|
boolean |
isKeepLastModified()
|
boolean |
isNoop()
|
boolean |
isRecursive()
|
boolean |
isSingleton()
Whether this class supports being singleton or not. |
boolean |
isStartingDirectoryMustExist()
|
void |
setAutoCreate(boolean autoCreate)
|
void |
setBufferSize(int bufferSize)
|
void |
setCharset(String charset)
|
void |
setConfiguration(GenericFileConfiguration configuration)
|
void |
setDelete(boolean delete)
|
void |
setDirectoryMustExist(boolean directoryMustExist)
|
void |
setDoneFileName(String doneFileName)
Sets the done file name. |
void |
setEagerDeleteTargetFile(boolean eagerDeleteTargetFile)
|
void |
setExclude(String exclude)
|
void |
setExclusiveReadLockStrategy(GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy)
|
void |
setFileExist(GenericFileExist fileExist)
|
void |
setFileName(Expression fileName)
|
void |
setFileName(String fileLanguageExpression)
Sets the file expression based on SimpleLanguage |
void |
setFilter(GenericFileFilter<T> filter)
|
void |
setFlatten(boolean flatten)
|
void |
setIdempotent(Boolean idempotent)
|
void |
setIdempotentRepository(IdempotentRepository<String> idempotentRepository)
|
void |
setInclude(String include)
|
void |
setInProgressRepository(IdempotentRepository<String> inProgressRepository)
|
void |
setKeepLastModified(boolean keepLastModified)
|
void |
setLocalWorkDirectory(String localWorkDirectory)
|
void |
setMaxDepth(int maxDepth)
|
void |
setMaxMessagesPerPoll(int maxMessagesPerPoll)
|
void |
setMinDepth(int minDepth)
|
void |
setMove(Expression move)
|
void |
setMove(String fileLanguageExpression)
Sets the move expression based on SimpleLanguage |
void |
setMoveFailed(Expression moveFailed)
|
void |
setMoveFailed(String fileLanguageExpression)
Sets the move failure expression based on SimpleLanguage |
void |
setNoop(boolean noop)
|
void |
setPreMove(Expression preMove)
|
void |
setPreMove(String fileLanguageExpression)
Sets the pre move expression based on SimpleLanguage |
void |
setProcessStrategy(GenericFileProcessStrategy<T> processStrategy)
|
void |
setReadLock(String readLock)
|
void |
setReadLockCheckInterval(long readLockCheckInterval)
|
void |
setReadLockTimeout(long readLockTimeout)
|
void |
setRecursive(boolean recursive)
|
void |
setSortBy(Comparator<Exchange> sortBy)
|
void |
setSortBy(String expression)
|
void |
setSortBy(String expression,
boolean reverse)
|
void |
setSorter(Comparator<GenericFile<T>> sorter)
|
void |
setStartingDirectoryMustExist(boolean startingDirectoryMustExist)
|
void |
setTempFileName(Expression tempFileName)
|
void |
setTempFileName(String tempFileNameExpression)
|
void |
setTempPrefix(String tempPrefix)
Enables and uses temporary prefix when writing files, after write it will be renamed to the correct name. |
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint |
---|
configureConsumer, configureProperties, getConsumerProperties, setConsumerProperties |
Methods inherited from class org.apache.camel.impl.DefaultEndpoint |
---|
createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString |
Methods inherited from class org.apache.camel.support.ServiceSupport |
---|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.camel.Endpoint |
---|
configureProperties, createExchange, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointConfiguration, getEndpointKey, getEndpointUri, isLenientProperties, setCamelContext |
Methods inherited from interface org.apache.camel.Service |
---|
start, stop |
Field Detail |
---|
protected static final transient String DEFAULT_STRATEGYFACTORY_CLASS
protected static final transient int DEFAULT_IDEMPOTENT_CACHE_SIZE
protected final transient org.slf4j.Logger log
protected GenericFileProcessStrategy<T> processStrategy
protected GenericFileConfiguration configuration
protected IdempotentRepository<String> inProgressRepository
protected String localWorkDirectory
protected boolean autoCreate
protected boolean startingDirectoryMustExist
protected boolean directoryMustExist
protected int bufferSize
protected GenericFileExist fileExist
protected boolean noop
protected boolean recursive
protected boolean delete
protected boolean flatten
protected int maxMessagesPerPoll
protected int maxDepth
protected int minDepth
protected String tempPrefix
protected Expression tempFileName
protected boolean eagerDeleteTargetFile
protected String include
protected String exclude
protected String charset
protected Expression fileName
protected Expression move
protected Expression moveFailed
protected Expression preMove
protected Boolean idempotent
protected IdempotentRepository<String> idempotentRepository
protected GenericFileFilter<T> filter
protected Comparator<GenericFile<T>> sorter
protected Comparator<Exchange> sortBy
protected String readLock
protected long readLockCheckInterval
protected long readLockTimeout
protected GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy
protected boolean keepLastModified
protected String doneFileName
Constructor Detail |
---|
public GenericFileEndpoint()
public GenericFileEndpoint(String endpointUri, Component component)
Method Detail |
---|
public boolean isSingleton()
IsSingleton
isSingleton
in interface IsSingleton
public abstract GenericFileConsumer<T> createConsumer(Processor processor) throws Exception
Endpoint
createConsumer
in interface Endpoint
processor
- the given processor
Exception
- can be thrownpublic abstract GenericFileProducer<T> createProducer() throws Exception
Endpoint
createProducer
in interface Endpoint
Exception
- can be thrownpublic abstract Exchange createExchange(GenericFile<T> file)
public abstract String getScheme()
public abstract char getFileSeparator()
public abstract boolean isAbsolute(String name)
public String getGeneratedFileName(Message message)
public GenericFileProcessStrategy<T> getGenericFileProcessStrategy()
public List<Exchange> getExchanges()
getExchanges
in interface BrowsableEndpoint
protected GenericFileProcessStrategy<T> createGenericFileStrategy()
public boolean isNoop()
public void setNoop(boolean noop)
public boolean isRecursive()
public void setRecursive(boolean recursive)
public String getInclude()
public void setInclude(String include)
public String getExclude()
public void setExclude(String exclude)
public boolean isDelete()
public void setDelete(boolean delete)
public boolean isFlatten()
public void setFlatten(boolean flatten)
public Expression getMove()
public void setMove(Expression move)
public void setMoveFailed(String fileLanguageExpression)
SimpleLanguage
public Expression getMoveFailed()
public void setMoveFailed(Expression moveFailed)
public void setMove(String fileLanguageExpression)
SimpleLanguage
public Expression getPreMove()
public void setPreMove(Expression preMove)
public void setPreMove(String fileLanguageExpression)
SimpleLanguage
public Expression getFileName()
public void setFileName(Expression fileName)
public void setFileName(String fileLanguageExpression)
SimpleLanguage
public String getDoneFileName()
public void setDoneFileName(String doneFileName)
public Boolean isIdempotent()
public String getCharset()
public void setCharset(String charset)
public void setIdempotent(Boolean idempotent)
public IdempotentRepository<String> getIdempotentRepository()
public void setIdempotentRepository(IdempotentRepository<String> idempotentRepository)
public GenericFileFilter<T> getFilter()
public void setFilter(GenericFileFilter<T> filter)
public Comparator<GenericFile<T>> getSorter()
public void setSorter(Comparator<GenericFile<T>> sorter)
public Comparator<Exchange> getSortBy()
public void setSortBy(Comparator<Exchange> sortBy)
public void setSortBy(String expression)
public void setSortBy(String expression, boolean reverse)
public String getTempPrefix()
public void setTempPrefix(String tempPrefix)
public Expression getTempFileName()
public void setTempFileName(Expression tempFileName)
public void setTempFileName(String tempFileNameExpression)
public boolean isEagerDeleteTargetFile()
public void setEagerDeleteTargetFile(boolean eagerDeleteTargetFile)
public GenericFileConfiguration getConfiguration()
public void setConfiguration(GenericFileConfiguration configuration)
public GenericFileExclusiveReadLockStrategy<T> getExclusiveReadLockStrategy()
public void setExclusiveReadLockStrategy(GenericFileExclusiveReadLockStrategy<T> exclusiveReadLockStrategy)
public String getReadLock()
public void setReadLock(String readLock)
public long getReadLockCheckInterval()
public void setReadLockCheckInterval(long readLockCheckInterval)
public long getReadLockTimeout()
public void setReadLockTimeout(long readLockTimeout)
public int getBufferSize()
public void setBufferSize(int bufferSize)
public GenericFileExist getFileExist()
public void setFileExist(GenericFileExist fileExist)
public boolean isAutoCreate()
public void setAutoCreate(boolean autoCreate)
public boolean isStartingDirectoryMustExist()
public void setStartingDirectoryMustExist(boolean startingDirectoryMustExist)
public boolean isDirectoryMustExist()
public void setDirectoryMustExist(boolean directoryMustExist)
public GenericFileProcessStrategy<T> getProcessStrategy()
public void setProcessStrategy(GenericFileProcessStrategy<T> processStrategy)
public String getLocalWorkDirectory()
public void setLocalWorkDirectory(String localWorkDirectory)
public int getMaxMessagesPerPoll()
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
public int getMaxDepth()
public void setMaxDepth(int maxDepth)
public int getMinDepth()
public void setMinDepth(int minDepth)
public IdempotentRepository<String> getInProgressRepository()
public void setInProgressRepository(IdempotentRepository<String> inProgressRepository)
public boolean isKeepLastModified()
public void setKeepLastModified(boolean keepLastModified)
public void configureMessage(GenericFile<T> file, Message message)
public void configureExchange(Exchange exchange)
exchange
- protected String configureMoveOrPreMoveExpression(String expression)
expression
- the original string input
protected Map<String,Object> getParamsAsMap()
protected String createDoneFileName(String fileName)
fileName
- the file name
protected boolean isDoneFile(String fileName)
fileName
- the file name
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.
doStart
in class DefaultEndpoint
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.
doStop
in class DefaultEndpoint
Exception
ServiceSupport.doStart()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |