MetadataExtractor implementation that relies on
Decoders to deserialize the content of metadata entries.
By default only "message/x.rsocket.routing.v0" is extracted and
saved under MetadataExtractor#ROUTE_KEY. Use metadataToExtract
methods to specify other metadata mime types of interest to extract.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private static final Log | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | DefaultMetadataExtractor(Decoder<?>... decoders)
Constructor with decoders for de-serializing metadata entries. |
| public | DefaultMetadataExtractor(List<Decoder<?>> decoders)
Constructor with list of decoders for de-serializing metadata entries. |
| Modifier and Type | Method and Description |
|---|---|
| public Map | extract(Payload
the payload whose metadata should be read payload, MimeType the metadata MimeType for the connection. metadataMimeType)Implements org. Payload metadata.
|
| private void | |
| public List | |
| public <T> void | metadataToExtract(MimeType
the mime type of metadata entries to extract mimeType, Class<T> the target value type to decode to targetType, BiConsumer<T, Map<String, Object>> custom logic to add the decoded value to the output map mapper)Implements org. metadataToExtract(MimeType, Class, String) that allows
custom logic to be used to map the decoded value to any number of values
in the output map.
|
| public <T> void | metadataToExtract(MimeType
the mime type of metadata entries to extract mimeType, ParameterizedTypeReference<T> the target value type to decode to type, BiConsumer<T, Map<String, Object>> custom logic to add the decoded value to the output map mapper)Implements org. metadataToExtract(MimeType, Class, BiConsumer) that
accepts ParameterizedTypeReference instead of Class for
specifying a target type with generic parameters.
|
| private <T> void | registerMetadata(MimeType mimeType, ResolvableType targetType, BiConsumer<T, Map<String, Object>> mapper)
|
| decoders | back to summary |
|---|---|
| private final List<Decoder<?>> decoders | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| registrations | back to summary |
|---|---|
| private final Map<String, DefaultMetadataExtractor. | |
| DefaultMetadataExtractor | back to summary |
|---|---|
| public DefaultMetadataExtractor(Decoder<?>... decoders) Constructor with decoders for de-serializing metadata entries. | |
| DefaultMetadataExtractor | back to summary |
|---|---|
| public DefaultMetadataExtractor(List<Decoder<?>> decoders) Constructor with list of decoders for de-serializing metadata entries. | |
| extract | back to summary |
|---|---|
| public Map Implements org. Doc from org. Extract a map of values from the given | |
| extractEntry | back to summary |
|---|---|
| private void extractEntry(ByteBuf content, String mimeType, Map<String, Object> result) | |
| getDecoders | back to summary |
|---|---|
| public List Return a read-only list with the configured decoders. | |
| metadataToExtract | back to summary |
|---|---|
| public <T> void metadataToExtract(MimeType mimeType, Class<T> targetType, BiConsumer<T, Map<String, Object>> mapper) Implements org. Doc from org. Variant of | |
| metadataToExtract | back to summary |
|---|---|
| public <T> void metadataToExtract(MimeType mimeType, ParameterizedTypeReference<T> type, BiConsumer<T, Map<String, Object>> mapper) Implements org. Doc from org. Variant of
| |
| registerMetadata | back to summary |
|---|---|
private <T> void registerMetadata(MimeType mimeType, ResolvableType targetType, BiConsumer<T, Map<String, Object>> mapper)
| |
| Modifier and Type | Field and Description |
|---|---|
| private final BiConsumer | |
| private static final NettyDataBufferFactory | |
| private final Decoder | |
| private final MimeType | |
| private final ResolvableType |
| Access | Constructor and Description |
|---|---|
| pack-priv | EntryExtractor(Decoder<T> decoder, MimeType mimeType, ResolvableType targetType, BiConsumer<T, Map<String, Object>> accumulator)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public String |
| accumulator | back to summary |
|---|---|
| private final BiConsumer<T, Map<String, Object>> accumulator | |
| bufferFactory | back to summary |
|---|---|
| private static final NettyDataBufferFactory bufferFactory | |
| decoder | back to summary |
|---|---|
| private final Decoder<T> decoder | |
| mimeType | back to summary |
|---|---|
| private final MimeType mimeType | |
| targetType | back to summary |
|---|---|
| private final ResolvableType targetType | |
| EntryExtractor | back to summary |
|---|---|
| pack-priv EntryExtractor(Decoder<T> decoder, MimeType mimeType, ResolvableType targetType, BiConsumer<T, Map<String, Object>> accumulator) | |
| extract | back to summary |
|---|---|
| public void extract(ByteBuf content, Map<String, Object> result) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |