Class SimpleMessageRegistry

    • Constructor Detail

      • SimpleMessageRegistry

        public SimpleMessageRegistry()
    • 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 interface MessageRegistry
        Parameters:
        messageType - message type, key in parser registry
        buffer - message wrapped in ByteBuf
        errors - 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 interface MessageRegistry
        Parameters:
        message - to be parsed
        buffer - byte buffer that will be filled with serialized message