Class SimpleMessageRegistry
java.lang.Object
org.opendaylight.protocol.pcep.spi.pojo.SimpleMessageRegistry
- All Implemented Interfaces:
MessageRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionparseMessage
(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.
-
Constructor Details
-
SimpleMessageRegistry
public SimpleMessageRegistry()
-
-
Method Details
-
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
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
-