Package com.adaptris.core.ftp
Class AggregatingFtpConsumer
- java.lang.Object
-
- com.adaptris.core.services.aggregator.AggregatingConsumerImpl<AggregatingFtpConsumeService>
-
- com.adaptris.core.ftp.AggregatingFtpConsumer
-
- All Implemented Interfaces:
ComponentLifecycle
,AggregatingConsumer<AggregatingFtpConsumeService>
public class AggregatingFtpConsumer extends AggregatingConsumerImpl<AggregatingFtpConsumeService>
AggregatingConsumer
implementation that allows you to read a separate message from an FTP filesystem that is correlated in some way to the current message.If a filter-expression of the generated is available, then this works as a true aggregator; it will trigger the use of a FileFilter, and ultimately cause multiple files to be read and passed to the configured message aggregator. Note that no decision is made about the resulting size of the message, all messages that match the filter-expression will be aggregated; if there a 2000 files sitting on the filesystem that match the filter-expression, then that is how many will be picked up.
In the adapter configuration file this class is aliased as aggregating-ftp-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.aggregator.AggregatingConsumerImpl
log
-
-
Constructor Summary
Constructors Constructor Description AggregatingFtpConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aggregateMessages(AdaptrisMessage msg, AggregatingFtpConsumeService service)
Perform the aggregation.java.lang.Boolean
getDeleteAggregatedFiles()
AdaptrisMessageEncoder
getEncoder()
java.lang.String
getFileFilterImp()
void
setDeleteAggregatedFiles(java.lang.Boolean b)
Set whether to delete aggregated files.void
setEncoder(AdaptrisMessageEncoder ame)
Set the encoder to use when reading files.void
setFileFilterImp(java.lang.String classname)
Set the file filter implementation that will be used.-
Methods inherited from class com.adaptris.core.services.aggregator.AggregatingConsumerImpl
close, getEndpoint, getFilterExpression, getMessageAggregator, init, rethrowServiceException, setEndpoint, setFilterExpression, setMessageAggregator, start, start, stop, stop
-
-
-
-
Method Detail
-
aggregateMessages
public void aggregateMessages(AdaptrisMessage msg, AggregatingFtpConsumeService service) throws ServiceException
Description copied from interface:AggregatingConsumer
Perform the aggregation.- Parameters:
msg
- the current message being processed.service
- the service that relates to this consumer implementation.- Throws:
ServiceException
-
getFileFilterImp
public java.lang.String getFileFilterImp()
- Returns:
- the fileFilterImp
-
setFileFilterImp
public void setFileFilterImp(java.lang.String classname)
Set the file filter implementation that will be used.- Parameters:
classname
- the fileFilterImp to set, defaults to
-
getEncoder
public AdaptrisMessageEncoder getEncoder()
- Returns:
- the encoder
-
setEncoder
public void setEncoder(AdaptrisMessageEncoder ame)
Set the encoder to use when reading files.- Parameters:
ame
- the encoder to set
-
getDeleteAggregatedFiles
public java.lang.Boolean getDeleteAggregatedFiles()
- Returns:
- the deleteAggregatedFiles
-
setDeleteAggregatedFiles
public void setDeleteAggregatedFiles(java.lang.Boolean b)
Set whether to delete aggregated files.- Parameters:
b
- defaults to true.
-
-