Top Description Fields Constructors Methods
io.rsocket.metadata

public Class TaggingMetadataCodec

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, .ByteBufUtil, .CompositeByteBuf, java.nio.charset.StandardCharsets, java.util.Collection

A flyweight class that can be used to encode/decode tagging metadata information to/from ByteBuf. This is intended for low-level efficient manipulation of such buffers. See TaggingMetadata for an Iterator-like approach to decoding entries.
Author
linux_china

Field Summary

Modifier and TypeField and Description
private static int
TAG_LENGTH_MAX

Tag max length in bytes

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static RoutingMetadata

Returns:

routing metadata
createRoutingMetadata
(ByteBufAllocator
the ByteBufAllocator to use to create intermediate buffers as needed.
allocator
,
Collection<String>
tag values
tags
)

create routing metadata

public static ByteBuf

Returns:

tagging content
createTaggingContent
(ByteBufAllocator
the ByteBufAllocator to use to create intermediate buffers as needed.
allocator
,
Collection<String>
tag values
tags
)

create tagging content

public static TaggingMetadata

Returns:

tagging metadata
createTaggingMetadata
(CompositeMetadata.Entry
composite metadata entry
entry
)

create tagging metadata from composite metadata entry

public static TaggingMetadata

Returns:

Tagging Metadata
createTaggingMetadata
(ByteBufAllocator
the ByteBufAllocator to use to create intermediate buffers as needed.
allocator
,
String
the WellKnownMimeType to encode.
knownMimeType
,
Collection<String>
tag values
tags
)

create tagging metadata

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

TAG_LENGTH_MAXback to summary
private static int TAG_LENGTH_MAX

Tag max length in bytes

Constructor Detail

TaggingMetadataCodecback to summary
public TaggingMetadataCodec()

Method Detail

createRoutingMetadataback to summary
public static RoutingMetadata createRoutingMetadata(ByteBufAllocator allocator, Collection<String> tags)

create routing metadata

Parameters
allocator:ByteBufAllocator

the ByteBufAllocator to use to create intermediate buffers as needed.

tags:Collection<String>

tag values

Returns:RoutingMetadata

routing metadata

createTaggingContentback to summary
public static ByteBuf createTaggingContent(ByteBufAllocator allocator, Collection<String> tags)

create tagging content

Parameters
allocator:ByteBufAllocator

the ByteBufAllocator to use to create intermediate buffers as needed.

tags:Collection<String>

tag values

Returns:ByteBuf

tagging content

createTaggingMetadataback to summary
public static TaggingMetadata createTaggingMetadata(CompositeMetadata.Entry entry)

create tagging metadata from composite metadata entry

Parameters
entry:CompositeMetadata.Entry

composite metadata entry

Returns:TaggingMetadata

tagging metadata

createTaggingMetadataback to summary
public static TaggingMetadata createTaggingMetadata(ByteBufAllocator allocator, String knownMimeType, Collection<String> tags)

create tagging metadata

Parameters
allocator:ByteBufAllocator

the ByteBufAllocator to use to create intermediate buffers as needed.

knownMimeType:String

the WellKnownMimeType to encode.

tags:Collection<String>

tag values

Returns:TaggingMetadata

Tagging Metadata