BUG-50: added more object tests.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / object / PCEPOpenObjectParser.java
index 9adf9d2c643698b3feef7156479fc09ce4c400be..bba35a4ffc7833e8e8f824a2b86e1b85d5b37986 100644 (file)
@@ -11,9 +11,6 @@ package org.opendaylight.protocol.pcep.impl.object;
 import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.PCEPDocumentedException;
 import org.opendaylight.protocol.pcep.PCEPErrors;
-import org.opendaylight.protocol.pcep.impl.Util;
-import org.opendaylight.protocol.pcep.spi.AbstractObjectParser;
-import org.opendaylight.protocol.pcep.spi.SubobjectHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspDbVersionTlv;
@@ -39,7 +36,7 @@ import com.google.common.primitives.UnsignedBytes;
  * Parser for {@link OpenObject}
  */
 
-public class PCEPOpenObjectParser extends AbstractObjectParser<OpenBuilder> {
+public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<OpenBuilder> {
 
        public static final int CLASS = 1;
 
@@ -78,8 +75,8 @@ public class PCEPOpenObjectParser extends AbstractObjectParser<OpenBuilder> {
 
        private static final int PCEP_VERSION = 1;
 
-       public PCEPOpenObjectParser(final SubobjectHandlerRegistry subobjReg, final TlvHandlerRegistry tlvReg) {
-               super(subobjReg, tlvReg);
+       public PCEPOpenObjectParser(final TlvHandlerRegistry tlvReg) {
+               super(tlvReg);
        }
 
        @Override
@@ -133,7 +130,7 @@ public class PCEPOpenObjectParser extends AbstractObjectParser<OpenBuilder> {
 
                final byte[] tlvs = serializeTlvs(open.getTlvs());
 
-               final byte[] bytes = new byte[TLVS_OFFSET + tlvs.length + Util.getPadding(TLVS_OFFSET + tlvs.length, PADDED_TO)];
+               final byte[] bytes = new byte[TLVS_OFFSET + tlvs.length + getPadding(TLVS_OFFSET + tlvs.length, PADDED_TO)];
 
                bytes[VER_FLAGS_MF_OFFSET] = versionFlagMF;
                bytes[KEEPALIVE_F_OFFSET] = ByteArray.shortToBytes(open.getKeepalive())[1];