Class FtpRecursiveConsumer
- java.lang.Object
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,StateManagedComponent
@ComponentProfile(summary="Pickup messages from an FTP or SFTP server", tag="consumer,ftp,ftps,sftp,recursive", metadata={"originalname","fsFileSize","fsConsumeDir","_interlokMessageConsumedFrom"}, recommended=FileTransferConnection.class) public class FtpRecursiveConsumer extends FtpConsumer
FTP implementation of the AdaptrisMessageConsumer interface.The connection type for this consumer should always be a concrete implementation of
FileTransferConnection
.The destination should be in the form in the URL form dictated by the
FileTransferConnection
flavour or simply the IP Address/DNS name of the target Server. If the URL form is used, then it is possible to override the username, password, and port settings of the server, in all other cases the configuration specified in theFileTransferConnection
object will be used.In the event the proc-directory is not configured, then after processing the file, it is deleted. If proc-directory is configured, then the remote file will be renamed to this directory
The configuration of this consumer closely mirrors that of the FsConsumer though it does not, at the moment, share any common hierarchy with a key difference; although multiple file-filters can be configured only filters that work with the filepath will work. Other filter implementations (such as those based on size /last modified) may not work.
Unlike the original FTP consumer, this will recurse into any directories found.
- See Also:
FtpConnection
,FtpConsumer
,FileTransferConnection
In the adapter configuration file this class is aliased as ftp-recursive-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.AdaptrisPollingConsumer
AdaptrisPollingConsumer.LockOperator
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ftp.FtpConsumerImpl
DEFAULT_FILE_FILTER_IMPL, DEFAULT_OLDER_THAN, fileFilter, ftpClient
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description FtpRecursiveConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AdaptrisMessage
addStandardMetadata(AdaptrisMessage msg, java.lang.String filename, java.lang.String dir)
protected int
processMessages()
Implemented by protocol-specific sub-classes.-
Methods inherited from class com.adaptris.core.ftp.FtpConsumer
accept, configureWorkDir, fetchAndProcess, getProcDirectory, getWipSuffix, getWorkDirectory, init, setProcDirectory, setWipSuffix, setWorkDirectory
-
Methods inherited from class com.adaptris.core.ftp.FtpConsumerImpl
additionalDebug, consumeLocationKey, fileFilterImp, filterExpression, ftpURL, getFileFilterImp, getFilterExpression, getFtpEndpoint, getQuietInterval, handle, oldEnough, olderThanMs, prepareConsumer, setFileFilterImp, setFilterExpression, setFtpEndpoint, setQuietInterval
-
Methods inherited from class com.adaptris.core.AdaptrisPollingConsumer
close, continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages, start, stop
-
Methods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, newThreadName, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
-
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
-
-
-
Method Detail
-
processMessages
protected int processMessages()
Description copied from class:AdaptrisPollingConsumer
Implemented by protocol-specific sub-classes.
- Overrides:
processMessages
in classFtpConsumerImpl
-
addStandardMetadata
protected AdaptrisMessage addStandardMetadata(AdaptrisMessage msg, java.lang.String filename, java.lang.String dir)
- Overrides:
addStandardMetadata
in classFtpConsumerImpl
-
-