Rework parser infrastructure to support partial message processing
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / message / PCEPCloseMessageParser.java
index 63c7604eaf2f09636a7800baf3f723efb56bb8ea..1a166cd4e70a49ee6193b479d9d9a4771a641c8c 100644 (file)
@@ -12,8 +12,6 @@ import io.netty.buffer.ByteBuf;
 import java.util.List;
 
 import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
-import org.opendaylight.protocol.pcep.impl.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Close;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.CloseBuilder;
@@ -50,15 +48,7 @@ public class PCEPCloseMessageParser extends AbstractMessageParser {
        }
 
        @Override
-       public CloseMessage parseMessage(final byte[] buffer) throws PCEPDeserializerException, PCEPDocumentedException {
-               if (buffer == null || buffer.length == 0) {
-                       throw new PCEPDeserializerException("Close message doesn't contain CLOSE object.");
-               }
-               final List<Object> objs = parseObjects(buffer);
-               return validate(objs);
-       }
-
-       private Close validate(final List<Object> objects) throws PCEPDeserializerException {
+       protected Close validate(final List<Object> objects, final List<Message> errors) throws PCEPDeserializerException {
                if (objects == null) {
                        throw new IllegalArgumentException("Passed list can't be null.");
                }