public class UtMetadataMessageHandler extends Object implements MessageHandler<UtMetadata>
Constructor and Description |
---|
UtMetadataMessageHandler() |
Modifier and Type | Method and Description |
---|---|
int |
decode(DecodingContext context,
ByteBufferView buffer)
Tries to decode message from the byte buffer.
|
boolean |
encode(EncodingContext context,
UtMetadata message,
ByteBuffer buffer)
Tries to encode the provided message and place the result into the byte buffer.
|
Collection<Class<? extends UtMetadata>> |
getSupportedTypes() |
Class<? extends UtMetadata> |
readMessageType(ByteBufferView buffer)
Tries to determine the message type based on the (part of the) message available in the byte buffer.
|
public boolean encode(EncodingContext context, UtMetadata message, ByteBuffer buffer)
MessageHandler
encode
in interface MessageHandler<UtMetadata>
context
- Encoding contextbuffer
- Byte buffer of arbitrary capacity.
Encoded message should be placed into the buffer starting with its current position.
Protocol should check if the buffer has sufficient space available, and return false
if it's not the case.public int decode(DecodingContext context, ByteBufferView buffer)
MessageHandler
context
decode
in interface MessageHandler<UtMetadata>
context
- Message context. In case of success the decoded message must be put into this context.buffer
- Byte buffer of arbitrary length containing (a part of) the message.
Decoding should be performed starting with the current position of the buffer.public Collection<Class<? extends UtMetadata>> getSupportedTypes()
getSupportedTypes
in interface Protocol<UtMetadata>
public Class<? extends UtMetadata> readMessageType(ByteBufferView buffer)
Protocol
readMessageType
in interface Protocol<UtMetadata>
buffer
- Byte buffer of arbitrary length containing (a part of) the message.
Decoding should be performed starting with the current position of the buffer.Copyright © 2016–2021. All rights reserved.