Class AbstractMessageParser
- java.lang.Object
-
- org.opendaylight.protocol.pcep.spi.AbstractMessageParser
-
- All Implemented Interfaces:
MessageParser,MessageSerializer
- Direct Known Subclasses:
InitiatedPCInitiateMessageParser,PCEPCloseMessageParser,PCEPErrorMessageParser,PCEPKeepAliveMessageParser,PCEPMonitoringReplyMessageParser,PCEPNotificationMessageParser,PCEPOpenMessageParser,PCEPReplyMessageParser,PCEPRequestMessageParser,PCEPStartTLSMessageParser,StatefulPCReportMessageParser,StatefulPCUpdateRequestMessageParser
public abstract class AbstractMessageParser extends Object implements MessageParser, MessageSerializer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMessageParser(ObjectRegistry registry)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static List<VendorInformationObject>addVendorInformationObjects(List<Object> objects)static MessagecreateErrorMsg(PCEPErrors err, Optional<Rp> rp)MessageparseMessage(io.netty.buffer.ByteBuf buffer, List<Message> errors)protected voidserializeObject(@Nullable Object object, io.netty.buffer.ByteBuf buffer)Calls registry to pick up specific object serializer for given object.protected voidserializeVendorInformationObjects(List<VendorInformationObject> viObjects, io.netty.buffer.ByteBuf buffer)protected abstract Messagevalidate(List<Object> objects, List<Message> errors)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.protocol.pcep.spi.MessageSerializer
serializeMessage
-
-
-
-
Constructor Detail
-
AbstractMessageParser
protected AbstractMessageParser(ObjectRegistry registry)
-
-
Method Detail
-
serializeObject
protected void serializeObject(@Nullable Object object, io.netty.buffer.ByteBuf buffer)
Calls registry to pick up specific object serializer for given object. Checks if the object is not null.- Parameters:
object- Object to be serialized, may be nullbuffer- ByteBuf where the object should be serialized
-
createErrorMsg
public static Message createErrorMsg(PCEPErrors err, Optional<Rp> rp)
-
validate
protected abstract Message validate(List<Object> objects, List<Message> errors) throws PCEPDeserializerException
- Throws:
PCEPDeserializerException
-
parseMessage
public final Message parseMessage(io.netty.buffer.ByteBuf buffer, List<Message> errors) throws PCEPDeserializerException
- Specified by:
parseMessagein interfaceMessageParser- Throws:
PCEPDeserializerException
-
serializeVendorInformationObjects
protected final void serializeVendorInformationObjects(List<VendorInformationObject> viObjects, io.netty.buffer.ByteBuf buffer)
-
addVendorInformationObjects
protected static List<VendorInformationObject> addVendorInformationObjects(List<Object> objects)
-
-