Package com.adaptris.core.fs
Class AggregatingFsConsumer
java.lang.Object
com.adaptris.core.services.aggregator.AggregatingConsumerImpl<AggregatingFsConsumeService>
com.adaptris.core.fs.AggregatingFsConsumer
- All Implemented Interfaces:
ComponentLifecycle
,AggregatingConsumer<AggregatingFsConsumeService>
AggregatingConsumer
implementation that allows you to read a separate message from
the filesystem that is correlated in some way to the current message.
If a filter-expression 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 in a directory 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-fs-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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
aggregateMessages
(AdaptrisMessage msg, AggregatingFsConsumeService service) Perform the aggregation.void
setDeleteAggregatedFiles
(Boolean deleteAggregatedFiles) Set whether to delete aggregated files.void
Set the encoder to use when reading files.void
setFileFilterImp
(String classname) Set the file filter implementation that will be used.void
setWipSuffix
(String suffix) Sets the work-in-progress suffix to use.Methods inherited from class com.adaptris.core.services.aggregator.AggregatingConsumerImpl
close, getEndpoint, getFilterExpression, getMessageAggregator, init, rethrowServiceException, setEndpoint, setFilterExpression, setMessageAggregator, start, start, stop, stop
-
Constructor Details
-
AggregatingFsConsumer
public AggregatingFsConsumer()
-
-
Method Details
-
aggregateMessages
public void aggregateMessages(AdaptrisMessage msg, AggregatingFsConsumeService 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
- Returns:
- the fileFilterImp
-
setFileFilterImp
Set the file filter implementation that will be used.- Parameters:
classname
- the fileFilterImp to set, defaults to
-
getEncoder
- Returns:
- the encoder
-
setEncoder
Set the encoder to use when reading files.- Parameters:
ame
- the encoder to set
-
getWipSuffix
- Returns:
- the wipSuffix
-
setWipSuffix
Sets the work-in-progress suffix to use.This suffix is added to the original file name while the file is being processed.
- Parameters:
suffix
- the wipSuffix to set, if not explicitly configured defaults to '_wip'
-
getDeleteAggregatedFiles
- Returns:
- the deleteAggregatedFiles
-
setDeleteAggregatedFiles
Set whether to delete aggregated files.- Parameters:
deleteAggregatedFiles
- defaults to true.
-