public class AggregatingFsConsumer extends AggregatingConsumerImpl<AggregatingFsConsumeService>
AggregatingConsumer
implementation that allows you to read a separate message from
the filesystem that is correlated in some way to the current message.
You need to configure a ConsumeDestinationGenerator
implementation; which is subsequently used to generate the fully
qualified URL to the destination message e.g. file:///C:/path/to/correlated/message
. If the file does not exist, is
inaccessible or not a file, then an exception is thrown.
If a filter-expression of the generated ConsumeDestination
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.
log
Constructor and Description |
---|
AggregatingFsConsumer() |
AggregatingFsConsumer(ConsumeDestinationGenerator d) |
Modifier and Type | Method and Description |
---|---|
void |
aggregateMessages(AdaptrisMessage msg,
AggregatingFsConsumeService service)
Perform the aggregation.
|
java.lang.Boolean |
getDeleteAggregatedFiles() |
AdaptrisMessageEncoder |
getEncoder() |
java.lang.String |
getFileFilterImp() |
java.lang.String |
getWipSuffix() |
void |
setDeleteAggregatedFiles(java.lang.Boolean deleteAggregatedFiles)
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.
|
void |
setWipSuffix(java.lang.String suffix)
Sets the work-in-progress suffix to use.
|
close, getDestination, getMessageAggregator, init, rethrowServiceException, setDestination, setMessageAggregator, start, start, stop, stop
public AggregatingFsConsumer()
public AggregatingFsConsumer(ConsumeDestinationGenerator d)
public void aggregateMessages(AdaptrisMessage msg, AggregatingFsConsumeService service) throws ServiceException
AggregatingConsumer
msg
- the current message being processed.service
- the service that relates to this consumer implementation.ServiceException
public java.lang.String getFileFilterImp()
public void setFileFilterImp(java.lang.String classname)
classname
- the fileFilterImp to set, defaults topublic AdaptrisMessageEncoder getEncoder()
public void setEncoder(AdaptrisMessageEncoder ame)
ame
- the encoder to setpublic java.lang.String getWipSuffix()
public void setWipSuffix(java.lang.String suffix)
This suffix is added to the original file name while the file is being processed.
suffix
- the wipSuffix to set, if not explicitly configured defaults to '_wip'public java.lang.Boolean getDeleteAggregatedFiles()
public void setDeleteAggregatedFiles(java.lang.Boolean deleteAggregatedFiles)
deleteAggregatedFiles
- defaults to true.