K - the expected type of the service keysV - the expected type of the service response valuespublic class MapValuesInboundAdapter<K,V> extends Object implements InboundAdapter
InboundAdapter where the service response payload is expected to be
a collection of values of type V. These are to be reassembled into a map using the keys
provided by the caller.| Modifier and Type | Field and Description |
|---|---|
private io.netty.buffer.ByteBuf |
byteBuf
Container for bytes queued from the service response
Channel. |
private Deserializer<V> |
deserializerV
The deserializer to be used to construct the values in the service response object.
|
private InboundToken<V> |
inboundToken
The state of receipt of an individual service response token.
|
private Iterator<K> |
iteratorKeys
An iterator used to traverse the caller-supplied keys, in order to reassemble the service map.
|
private Map<K,V> |
result
The reassembled map resulting from the service call.
|
| Constructor and Description |
|---|
MapValuesInboundAdapter(Set<K> keys,
Deserializer<V> deserializerV,
Map<K,V> result)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dequeue()
Parse the received content into a form suitable for supplying to the remote method caller.
|
Map<K,V> |
getResult() |
boolean |
isComplete()
Check for receipt of all response content expected from server.
|
void |
queue(byte[] bytes)
Add
Channel content to a queue for later processing |
private final Iterator<K> iteratorKeys
private final Deserializer<V> deserializerV
private final io.netty.buffer.ByteBuf byteBuf
Channel.private final InboundToken<V> inboundToken
public MapValuesInboundAdapter(Set<K> keys, Deserializer<V> deserializerV, Map<K,V> result)
keys - the map keys requested by the callerdeserializerV - the deserializer to be used to instantiate the service response map valuesresult - container for the map entries reconstituted from the service responsepublic boolean isComplete()
InboundAdapterisComplete in interface InboundAdapterpublic void queue(byte[] bytes)
InboundAdapterChannel content to a queue for later processingqueue in interface InboundAdapterbytes - the remote content to queuepublic void dequeue()
throws IOException
InboundAdapterdequeue in interface InboundAdapterIOException - on failure parsing the contentCopyright © 2022 Apache NiFi Project. All rights reserved.