Class SplitByMetadata
- java.lang.Object
-
- com.adaptris.core.services.splitter.MessageSplitterImp
-
- com.adaptris.core.services.splitter.MessageCopier
-
- com.adaptris.core.services.splitter.SplitByMetadata
-
- All Implemented Interfaces:
MessageSplitter
public class SplitByMetadata extends MessageCopier
Implementation of
MessageSplitter
which allows a singleAdaptrisMessage
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.services.splitter.MessageCopier
MessageCopier.MessageCallback, MessageCopier.MessageCopierIterator
-
Nested classes/interfaces inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
MessageSplitterImp.SplitMessageIterator
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
logR
-
-
Constructor Summary
Constructors Constructor Description SplitByMetadata()
SplitByMetadata(java.lang.String metadataKey, java.lang.String splitMetadataKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 fromsetMetadataKey(String)
will be stored.java.lang.Iterable<AdaptrisMessage>
splitMessage(AdaptrisMessage msg)
Splits anAdaptrisMessage
into some number of AdaptrisMessage objects.-
Methods inherited from class com.adaptris.core.services.splitter.MessageCopier
duplicateWithPayload, toInteger
-
Methods inherited from class com.adaptris.core.services.splitter.MessageSplitterImp
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
-
-
-
-
Method Detail
-
splitMessage
public java.lang.Iterable<AdaptrisMessage> splitMessage(AdaptrisMessage msg) throws CoreException
Description copied from interface: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.- Parameters:
msg
- the msg to split- Returns:
- an
Iterable
ofAdaptrisMessage
- Throws:
CoreException
- wrapping any other exception
-
getSeparator
public java.lang.String getSeparator()
- Returns:
- the splitToken
-
setSeparator
public void setSeparator(java.lang.String splitToken)
- Parameters:
splitToken
- the splitToken to set
-
getMetadataKey
public java.lang.String getMetadataKey()
- Returns:
- the metadataKey
-
setMetadataKey
public void setMetadataKey(java.lang.String s)
- Parameters:
s
- the metadataKey to derive splis from.
-
getSplitMetadataKey
public java.lang.String getSplitMetadataKey()
- Returns:
- the splitMetadataKey
-
setSplitMetadataKey
public void setSplitMetadataKey(java.lang.String s)
The metadata key where the split value fromsetMetadataKey(String)
will be stored.- Parameters:
s
- the splitMetadataKey to set
-
-