public class XmlDocumentAggregator extends MessageAggregatorImpl
MessageAggregator
implementation that creates single XML using each message that needs to be joined up.
The original pre-split document forms the basis of the resulting document; each of the split documents is merged into the main
document using the configured DocumentMerge
function.
Use setDocumentEncoding(String)
to force the encoding of the resulting XML document to the required value; if not set,
then either the original AdaptrisMessage.getCharEncoding()
(if set) or UTF-8
will be used in that order.
In the adapter configuration file this class is aliased as xml-document-aggregator which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
XmlDocumentAggregator() |
XmlDocumentAggregator(DocumentMerge merge) |
Modifier and Type | Method and Description |
---|---|
void |
aggregate(AdaptrisMessage original,
java.lang.Iterable<AdaptrisMessage> messages)
Joins multiple
AdaptrisMessage s into a single AdaptrisMessage
objects. |
protected DocumentBuilderFactoryBuilder |
documentFactoryBuilder() |
java.lang.String |
getDocumentEncoding()
Set the XML encoding for the resulting document which defaults to 'UTF-8' if not explicitly
configured.
|
@NonNull DocumentMerge |
getMergeImplementation()
How to merge the split documents into the main XML document.
|
DocumentBuilderFactoryBuilder |
getXmlDocumentFactoryConfig() |
void |
joinMessage(AdaptrisMessage original,
java.util.Collection<AdaptrisMessage> messages)
Joins multiple
AdaptrisMessage s into a single AdaptrisMessage
objects. |
void |
setDocumentEncoding(java.lang.String documentEncoding)
Set the XML encoding for the resulting document which defaults to 'UTF-8' if not explicitly
configured.
|
void |
setMergeImplementation(@NonNull DocumentMerge mergeImplementation)
How to merge the split documents into the main XML document.
|
void |
setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xmlDocumentFactoryConfig) |
filter, filter, getFilterCondition, getOverwriteMetadata, getRetainFilterExceptionsMessages, overwriteMetadata, overwriteMetadata, setFilterCondition, setOverwriteMetadata, setRetainFilterExceptionsMessages, withOverwriteMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collect
public XmlDocumentAggregator()
public XmlDocumentAggregator(DocumentMerge merge)
public void joinMessage(AdaptrisMessage original, java.util.Collection<AdaptrisMessage> messages) throws CoreException
MessageAggregator
Joins multiple AdaptrisMessage
s into a single AdaptrisMessage
objects. Preservation of metadata is down to the implementation.
original
- the msg to insert all the messages intomessages
- 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
protected DocumentBuilderFactoryBuilder documentFactoryBuilder()
public java.lang.String getDocumentEncoding()
public void setDocumentEncoding(java.lang.String documentEncoding)
@NonNull public @NonNull DocumentMerge getMergeImplementation()
public void setMergeImplementation(@NonNull @NonNull DocumentMerge mergeImplementation)
public DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig()
public void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xmlDocumentFactoryConfig)