Class ZipAggregator

java.lang.Object
com.adaptris.core.services.aggregator.MessageAggregatorImpl
com.adaptris.core.services.aggregator.ZipAggregator
All Implemented Interfaces:
MessageAggregator

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.

  • Field Details

  • Constructor Details

    • ZipAggregator

      public ZipAggregator()
  • Method Details

    • joinMessage

      public void joinMessage(AdaptrisMessage msg, Collection<AdaptrisMessage> msgs) throws CoreException
      Description copied from interface: MessageAggregator

      Joins multiple AdaptrisMessages into a single AdaptrisMessage objects. Preservation of metadata is down to the implementation.

      Parameters:
      msg - the msg to insert all the messages into
      msgs - 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 AdaptrisMessages into a single AdaptrisMessage objects. Preservation of metadata is down to the implementation.

      Parameters:
      original - the original message
      messages - the list of messages to join.
      Throws:
      CoreException
    • getFilenameMetadata

      public String 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

      public void setFilenameMetadata(String filenameMetadata)
      The metadata key that contains the filename to use in the zip file when aggregating.

      This defaults to 'filename' if not explicitly configured.