public class SplitByMetadata extends MessageCopier
Implementation of MessageSplitter
which allows a single AdaptrisMessage
that contains a metadata key
that is considered to contain multiple elements to be split.
In the adapter configuration file this class is aliased as split-by-metadata which is the preferred alternative to the fully qualified classname when building your configuration.
MessageCopier.MessageCallback, MessageCopier.MessageCopierIterator
MessageSplitterImp.SplitMessageIterator
logR
Constructor and Description |
---|
SplitByMetadata() |
SplitByMetadata(java.lang.String metadataKey,
java.lang.String splitMetadataKey) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMetadataKey() |
java.lang.String |
getSeparator() |
java.lang.String |
getSplitMetadataKey() |
void |
setMetadataKey(java.lang.String s) |
void |
setSeparator(java.lang.String splitToken) |
void |
setSplitMetadataKey(java.lang.String s)
The metadata key where the split value from
setMetadataKey(String)
will be stored. |
java.lang.Iterable<AdaptrisMessage> |
splitMessage(AdaptrisMessage msg)
Splits an
AdaptrisMessage into some number of AdaptrisMessage objects. |
duplicateWithPayload, toInteger
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
public SplitByMetadata()
public SplitByMetadata(java.lang.String metadataKey, java.lang.String splitMetadataKey)
public java.lang.Iterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg) throws CoreException
MessageSplitter
Splits an AdaptrisMessage
into some number of AdaptrisMessage objects. Preservation of metadata is down to the
implementation.
If this method returns a CloseableIterable
, it must be closed by the caller! This contract cannot be clearly
expressed in Java code without breaking the API in uncomfortable ways for things just returning a List, which is why
this method is only declared to return Iterable.
msg
- the msg to splitIterable
of AdaptrisMessage
CoreException
- wrapping any other exceptionpublic java.lang.String getSeparator()
public void setSeparator(java.lang.String splitToken)
splitToken
- the splitToken to setpublic java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String s)
s
- the metadataKey to derive splis from.public java.lang.String getSplitMetadataKey()
public void setSplitMetadataKey(java.lang.String s)
setMetadataKey(String)
will be stored.s
- the splitMetadataKey to set