Class JsonMergeAggregator
java.lang.Object
com.adaptris.core.services.aggregator.MessageAggregatorImpl
com.adaptris.core.json.aggregator.JsonAggregatorImpl
com.adaptris.core.json.aggregator.JsonMergeAggregator
- All Implemented Interfaces:
MessageAggregator
@ComponentProfile(summary="Merge each message into an existing JSON object.",
tag="json")
public class JsonMergeAggregator
extends JsonAggregatorImpl
MessageAggregator
implementation that merges each message to a JSON object or array.
The payloads from the collection are assumed to be JSON objects, and will be aggregated into the pre-split message be it an object or array. Messages that are not JSON objects will be ignored but an error will be thrown should the pre-split message not be valid.
In the adapter configuration file this class is aliased as json-merge-aggregator which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.services.aggregator.MessageAggregatorImpl
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
aggregate
(AdaptrisMessage original, Iterable<AdaptrisMessage> messages) Specify the metadata key that contains the 'key' against which the message will be merged into the original.void
setMergeMetadataKey
(String mergeMetadataKey) Specify the metadata key that contains the 'key' against which the message will be merged into the original.Methods inherited from class com.adaptris.core.json.aggregator.JsonAggregatorImpl
joinMessage
Methods inherited from class com.adaptris.core.services.aggregator.MessageAggregatorImpl
filter, filter, getFilterCondition, getOverwriteMetadata, getRetainFilterExceptionsMessages, overwriteMetadata, overwriteMetadata, setFilterCondition, setOverwriteMetadata, setRetainFilterExceptionsMessages, withOverwriteMetadata
-
Field Details
-
mapper
protected transient com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
JsonMergeAggregator
public JsonMergeAggregator()
-
-
Method Details
-
aggregate
public void aggregate(AdaptrisMessage original, Iterable<AdaptrisMessage> messages) throws CoreException - Specified by:
aggregate
in interfaceMessageAggregator
- Specified by:
aggregate
in classJsonAggregatorImpl
- Throws:
CoreException
-
getMergeMetadataKey
Specify the metadata key that contains the 'key' against which the message will be merged into the original. -
setMergeMetadataKey
Specify the metadata key that contains the 'key' against which the message will be merged into the original.
-