package org.opendaylight.protocol.pcep.impl.subobject;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.impl.PCEPXROSubobjectParser;
-import org.opendaylight.protocol.pcep.subobject.EROExplicitExclusionRouteSubobject;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Subobjects;
-public class EROExplicitExclusionRouteSubobjectParser {
- public static EROExplicitExclusionRouteSubobject parse(byte[] cutBytes, boolean loose) throws PCEPDeserializerException {
- if (cutBytes == null || cutBytes.length == 0)
- throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
+public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectParser, EROSubobjectSerializer {
- return new EROExplicitExclusionRouteSubobject(PCEPXROSubobjectParser.parse(cutBytes));
- }
+ public static final int TYPE = 33;
- public static byte[] put(EROExplicitExclusionRouteSubobject objToSerialize) {
- return PCEPXROSubobjectParser.put(objToSerialize.getXroSubobjets());
- }
+ @Override
+ public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException {
+ if (buffer == null || buffer.length == 0)
+ throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
+ // return new EROExplicitExclusionRouteSubobject(PCEPXROSubobjectParser.parse(cutBytes));
+ return null;
+ }
+
+ @Override
+ public byte[] serializeSubobject(final Subobjects subobject) {
+ // return PCEPXROSubobjectParser.put(subobject.getXroSubobjets());
+ return new byte[0];
+ }
+
+ @Override
+ public int getType() {
+ return TYPE;
+ }
}