@ComponentProfile(summary="Pickup messages from an FTP/SFTP server without renaming the file first", metadata={"originalname","fsFileSize"}, tag="consumer,ftp,ftps,sftp", recommended=FileTransferConnection.class) public class RelaxedFtpConsumer extends FtpConsumerImpl
This differs from the standard FtpConsumer
in that it does not attempt to rename the file before attempting to process
the file. If you have multiple consumers reading the same directory with the same filter then it will be possible to process a
message twice (or twice partially) or any combination thereof. It is not recommended that you use this FtpConsumer unless
there are very specific reasons to; e.g. the remote FTP server does not support the RNFR and RNTO command. After
consuming the file, it is deleted.
The destination returned by the ConsumeDestination implementation should be in the form in the URL form dictated by the
FileTransferConnection
flavour including the directory from which you wish to consume from. Simply specifying the IP
Address or DNS name of the remote ftp server may cause files to be consumed without specifying a subdirectory (which if you are
not in an ftp chroot jail might be a very bad thing).
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.
FtpConnection
,
SftpConnection
,
FileTransferConnection
,
ConsumeDestination
In the adapter configuration file this class is aliased as relaxed-ftp-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
AdaptrisPollingConsumer.LockOperator
DEFAULT_FILE_FILTER_IMPL, DEFAULT_OLDER_THAN, fileFilter, ftpClient
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
RelaxedFtpConsumer()
Default Constructor with the following defaults.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
fetchAndProcess(java.lang.String fullPath) |
java.lang.Boolean |
getFailOnDeleteFailure() |
TimeInterval |
getOlderThan()
Deprecated.
since 3.5.0 use
FtpConsumerImpl.getQuietInterval() instead for consistency. |
protected long |
olderThanMs() |
void |
setFailOnDeleteFailure(java.lang.Boolean b)
Whether or not an attempt to delete the file after processing should result in an exception if it fails.
|
void |
setOlderThan(TimeInterval interval)
Deprecated.
since 3.5.0 use
FtpConsumerImpl.setQuietInterval(TimeInterval) instead for consistency. |
accept, additionalDebug, addStandardMetadata, configureWorkDir, fileFilterImp, getFileFilterImp, getQuietInterval, init, oldEnough, prepareConsumer, processMessages, setFileFilterImp, setQuietInterval
close, continueProcessingMessages, continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages, start, stop
changeState, getDestination, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState, setDestination
createName, createQualifier, decode, encode, getEncoder, getIsConfirmation, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isConfirmation, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsConfirmation, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isConfirmation, isTrackingEndpoint
public RelaxedFtpConsumer()
protected boolean fetchAndProcess(java.lang.String fullPath) throws java.lang.Exception
fetchAndProcess
in class FtpConsumerImpl
java.lang.Exception
protected long olderThanMs()
olderThanMs
in class FtpConsumerImpl
@Deprecated @Removal(version="3.9.0", message="Use #getQuietInterval()") public TimeInterval getOlderThan()
FtpConsumerImpl.getQuietInterval()
instead for consistency.@Deprecated @Removal(version="3.9.0", message="Use #setQuietInterval(TimeInterval)") public void setOlderThan(TimeInterval interval)
FtpConsumerImpl.setQuietInterval(TimeInterval)
instead for consistency.public java.lang.Boolean getFailOnDeleteFailure()
public void setFailOnDeleteFailure(java.lang.Boolean b)
By the time the delete attempt has been made; the file has been processed by the adapter. If the delete fails (for whatever reason), then it will still be possible for the adapter to re-process the file again if it exists upon the next poll trigger. Setting it to be true simply allows you to record an error in the adapter log file.
b
- the failOnDeleteFailure to set (default false)