public class SizeBasedSplitter extends MessageSplitterImp
MessageSplitter
implementation that splits by size.
Attempts to split an AdaptrisMessage object by size. Reads the specified number of bytes from the input stream when required during the split. Note that while an attempt is made to make sure that each split message is of the same size, this is not guaranteed.
In the adapter configuration file this class is aliased as size-based-splitter which is the preferred alternative to the fully qualified classname when building your configuration.
MessageSplitterImp.SplitMessageIterator
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SPLIT_SIZE |
logR
Constructor and Description |
---|
SizeBasedSplitter() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getSplitSizeBytes() |
void |
setSplitSizeBytes(java.lang.Integer l) |
CloseableIterable<AdaptrisMessage> |
splitMessage(AdaptrisMessage msg)
Splits an
AdaptrisMessage into some number of AdaptrisMessage objects. |
copyMetadata, getCopyMetadata, getCopyObjectMetadata, getMessageFactory, selectFactory, setCopyMetadata, setCopyObjectMetadata, setMessageFactory
public static final int DEFAULT_SPLIT_SIZE
public CloseableIterable<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.Integer getSplitSizeBytes()
public void setSplitSizeBytes(java.lang.Integer l)
l
- the splitSizeBytes to set, default is 262144 if not specified.