Class ZipAggregator
- All Implemented Interfaces:
MessageAggregator
MessageAggregator
implementation that creates single zip using each message as a file in the zip.
Use setFilenameMetadata(String)
to change the key that contains the filename to be used in the zip,
default: filename.
Each message returned by the split needs to set a value of key returned by getFilenameMetadata()
, if the
a value is not set the message will be ignored. If the filenames are not unique an exception will be thrown.
In the adapter configuration file this class is aliased as zip-aggregator 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.MessageAggregatorImpl
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
aggregate
(AdaptrisMessage original, Iterable<AdaptrisMessage> messages) Joins multipleAdaptrisMessage
s into a single AdaptrisMessage objects.The metadata key that contains the filename to use in the zip file when aggregating.void
joinMessage
(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) Joins multipleAdaptrisMessage
s into a single AdaptrisMessage objects.void
setFilenameMetadata
(String filenameMetadata) The metadata key that contains the filename to use in the zip file when aggregating.Methods inherited from class com.adaptris.core.services.aggregator.MessageAggregatorImpl
filter, filter, getFilterCondition, getOverwriteMetadata, getRetainFilterExceptionsMessages, overwriteMetadata, overwriteMetadata, setFilterCondition, setOverwriteMetadata, setRetainFilterExceptionsMessages, withOverwriteMetadata
-
Field Details
-
DEFAULT_FILENAME_METADATA
- See Also:
-
-
Constructor Details
-
ZipAggregator
public ZipAggregator()
-
-
Method Details
-
joinMessage
Description copied from interface:MessageAggregator
Joins multiple
AdaptrisMessage
s into a single AdaptrisMessage objects. Preservation of metadata is down to the implementation.- Parameters:
msg
- the msg to insert all the messages intomsgs
- the list of messages to join.- Throws:
CoreException
- wrapping any other exception
-
aggregate
public void aggregate(AdaptrisMessage original, Iterable<AdaptrisMessage> messages) throws CoreException Description copied from interface:MessageAggregator
Joins multiple
AdaptrisMessage
s into a single AdaptrisMessage objects. Preservation of metadata is down to the implementation.- Parameters:
original
- the original messagemessages
- the list of messages to join.- Throws:
CoreException
-
getFilenameMetadata
The metadata key that contains the filename to use in the zip file when aggregating.This defaults to
'filename'
if not explicitly configured. -
setFilenameMetadata
The metadata key that contains the filename to use in the zip file when aggregating.This defaults to
'filename'
if not explicitly configured.
-