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 Modifier and Type Field Description protected com.fasterxml.jackson.databind.ObjectMapper
mapper
-
Fields inherited from class com.adaptris.core.services.aggregator.MessageAggregatorImpl
log
-
-
Constructor Summary
Constructors Constructor Description JsonMergeAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aggregate(AdaptrisMessage original, java.lang.Iterable<AdaptrisMessage> messages)
java.lang.String
getMergeMetadataKey()
Specify the metadata key that contains the 'key' against which the message will be merged into the original.void
setMergeMetadataKey(java.lang.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
-
-
-
-
Method Detail
-
aggregate
public void aggregate(AdaptrisMessage original, java.lang.Iterable<AdaptrisMessage> messages) throws CoreException
- Specified by:
aggregate
in interfaceMessageAggregator
- Specified by:
aggregate
in classJsonAggregatorImpl
- Throws:
CoreException
-
getMergeMetadataKey
public java.lang.String getMergeMetadataKey()
Specify the metadata key that contains the 'key' against which the message will be merged into the original.
-
setMergeMetadataKey
public void setMergeMetadataKey(java.lang.String mergeMetadataKey)
Specify the metadata key that contains the 'key' against which the message will be merged into the original.
-
-