public class ZipAggregator extends MessageAggregatorImpl
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FILENAME_METADATA |
log
Constructor and Description |
---|
ZipAggregator() |
Modifier and Type | Method and Description |
---|---|
void |
aggregate(AdaptrisMessage original,
java.lang.Iterable<AdaptrisMessage> messages)
Joins multiple
AdaptrisMessage s into a single AdaptrisMessage
objects. |
java.lang.String |
getFilenameMetadata()
The metadata key that contains the filename to use in the zip file when aggregating.
|
void |
joinMessage(AdaptrisMessage msg,
java.util.Collection<AdaptrisMessage> msgs)
Joins multiple
AdaptrisMessage s into a single AdaptrisMessage
objects. |
void |
setFilenameMetadata(java.lang.String filenameMetadata)
The metadata key that contains the filename to use in the zip file when aggregating.
|
filter, filter, getFilterCondition, getOverwriteMetadata, getRetainFilterExceptionsMessages, overwriteMetadata, overwriteMetadata, setFilterCondition, setOverwriteMetadata, setRetainFilterExceptionsMessages, withOverwriteMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collect
public static final java.lang.String DEFAULT_FILENAME_METADATA
public void joinMessage(AdaptrisMessage msg, java.util.Collection<AdaptrisMessage> msgs) throws CoreException
MessageAggregator
Joins multiple AdaptrisMessage
s into a single AdaptrisMessage
objects. Preservation of metadata is down to the implementation.
msg
- the msg to insert all the messages intomsgs
- the list of messages to join.CoreException
- wrapping any other exceptionpublic void aggregate(AdaptrisMessage original, java.lang.Iterable<AdaptrisMessage> messages) throws CoreException
MessageAggregator
Joins multiple AdaptrisMessage
s into a single AdaptrisMessage
objects. Preservation of metadata is down to the implementation.
original
- the original messagemessages
- the list of messages to join.CoreException
public java.lang.String getFilenameMetadata()
This defaults to 'filename'
if not explicitly configured.
public void setFilenameMetadata(java.lang.String filenameMetadata)
This defaults to 'filename'
if not explicitly configured.