Class SimpleMessageRegistry
- java.lang.Object
-
- org.opendaylight.protocol.pcep.spi.pojo.SimpleMessageRegistry
-
- All Implemented Interfaces:
MessageRegistry
public final class SimpleMessageRegistry extends Object implements MessageRegistry
-
-
Constructor Summary
Constructors Constructor Description SimpleMessageRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
parseMessage(int messageType, io.netty.buffer.ByteBuf buffer, List<Message> errors)
Finds parser for given message type in the registry.org.opendaylight.yangtools.concepts.Registration
registerMessageParser(int messageType, MessageParser parser)
org.opendaylight.yangtools.concepts.Registration
registerMessageSerializer(Class<? extends Message> msgClass, MessageSerializer serializer)
void
serializeMessage(Message message, io.netty.buffer.ByteBuf buffer)
Find serializer for given message.
-
-
-
Method Detail
-
registerMessageParser
public org.opendaylight.yangtools.concepts.Registration registerMessageParser(int messageType, MessageParser parser)
-
registerMessageSerializer
public org.opendaylight.yangtools.concepts.Registration registerMessageSerializer(Class<? extends Message> msgClass, MessageSerializer serializer)
-
parseMessage
public Message parseMessage(int messageType, io.netty.buffer.ByteBuf buffer, List<Message> errors) throws PCEPDeserializerException
Description copied from interface:MessageRegistry
Finds parser for given message type in the registry. Delegates parsing to found parser.- Specified by:
parseMessage
in interfaceMessageRegistry
- Parameters:
messageType
- message type, key in parser registrybuffer
- message wrapped in ByteBuferrors
- list of error messages, that is filled during parsing- Returns:
- null if the parser for this message could not be found
- Throws:
PCEPDeserializerException
- if the parsing did not succeed
-
serializeMessage
public void serializeMessage(Message message, io.netty.buffer.ByteBuf buffer)
Description copied from interface:MessageRegistry
Find serializer for given message. Delegates parsing to found serializer.- Specified by:
serializeMessage
in interfaceMessageRegistry
- Parameters:
message
- to be parsedbuffer
- byte buffer that will be filled with serialized message
-
-