import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.RpObject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SrpObject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SvecObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.subobjects.subobject.type.PathKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.db.version.tlv.LspDbVersion;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.error.code.tlv.LspErrorCode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.identifiers.tlv.LspIdentifiers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.AsNumberSubobject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.IpPrefixSubobject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.LabelSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.SrlgSubobject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.UnnumberedSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.Srlg;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.Unnumbered;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.label.type.GeneralizedLabel;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.label.type.Type1Label;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.label.type.WavebandSwitchingLabel;
context.registerXROSubobjectParser(XROPathKeySubobjectParser.TYPE, new XROPathKeySubobjectParser());
context.registerXROSubobjectParser(XROPathKeySubobjectParser.TYPE128, new XROPathKeySubobjectParser());
- context.registerXROSubobjectSerializer(IpPrefixSubobject.class, new XROIpPrefixSubobjectParser());
- context.registerXROSubobjectSerializer(AsNumberSubobject.class, new XROAsNumberSubobjectParser());
- context.registerXROSubobjectSerializer(SrlgSubobject.class, new XROSRLGSubobjectParser());
- context.registerXROSubobjectSerializer(UnnumberedSubobject.class, new XROUnnumberedInterfaceSubobjectParser());
- context.registerXROSubobjectSerializer(PathKeySubobject.class, new XROPathKeySubobjectParser());
+ context.registerXROSubobjectSerializer(IpPrefix.class, new XROIpPrefixSubobjectParser());
+ context.registerXROSubobjectSerializer(AsNumber.class, new XROAsNumberSubobjectParser());
+ context.registerXROSubobjectSerializer(Srlg.class, new XROSRLGSubobjectParser());
+ context.registerXROSubobjectSerializer(Unnumbered.class, new XROUnnumberedInterfaceSubobjectParser());
+ context.registerXROSubobjectSerializer(PathKey.class, new XROPathKeySubobjectParser());
final TlvHandlerRegistry tlvReg = context.getTlvHandlerRegistry();
context.registerTlvParser(NoPathVectorTlvParser.TYPE, new NoPathVectorTlvParser());
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.primitives.UnsignedBytes;
public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, ObjectSerializer {
- private static final Logger logger = LoggerFactory.getLogger(AbstractXROWithSubobjectsParser.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractXROWithSubobjectsParser.class);
private static final int SUB_TYPE_FLAG_F_LENGTH = 1;
private static final int SUB_LENGTH_F_LENGTH = 1;
private static final int SUB_HEADER_LENGTH = SUB_TYPE_FLAG_F_LENGTH + SUB_LENGTH_F_LENGTH;
- public static final int TYPE_FLAG_F_OFFSET = 0;
- public static final int LENGTH_F_OFFSET = TYPE_FLAG_F_OFFSET + SUB_TYPE_FLAG_F_LENGTH;
- public static final int SO_CONTENTS_OFFSET = LENGTH_F_OFFSET + SUB_LENGTH_F_LENGTH;
-
- protected static final int PADDED_TO = 4;
+ private static final int TYPE_FLAG_F_OFFSET = 0;
+ private static final int LENGTH_F_OFFSET = TYPE_FLAG_F_OFFSET + SUB_TYPE_FLAG_F_LENGTH;
+ private static final int SO_CONTENTS_OFFSET = LENGTH_F_OFFSET + SUB_LENGTH_F_LENGTH;
private final XROSubobjectHandlerRegistry subobjReg;
if (bytes == null) {
throw new IllegalArgumentException("Byte array is mandatory.");
}
-
int type;
-
byte[] soContentsBytes;
int length;
int offset = 0;
while (offset < bytes.length) {
- length = ByteArray.bytesToInt(ByteArray.subByte(bytes, offset + LENGTH_F_OFFSET, SUB_LENGTH_F_LENGTH));
+ final boolean mandatory = ((bytes[offset] & (1 << 7)) != 0) ? true : false;
+ type = UnsignedBytes.checkedCast((bytes[offset] & 0xff) & ~(1 << 7));
- final boolean mandatory = ((bytes[offset + TYPE_FLAG_F_OFFSET] & (1 << 7)) != 0) ? true : false;
- type = (bytes[offset + TYPE_FLAG_F_OFFSET] & 0xff) & ~(1 << 7);
+ offset += SUB_TYPE_FLAG_F_LENGTH;
- if (length > bytes.length - offset) {
+ length = UnsignedBytes.toInt(bytes[offset]);
+
+ offset += SUB_LENGTH_F_LENGTH;
+
+ if (length - SUB_HEADER_LENGTH > bytes.length - offset) {
throw new PCEPDeserializerException("Wrong length specified. Passed: " + length + "; Expected: <= "
+ (bytes.length - offset));
}
+ soContentsBytes = ByteArray.subByte(bytes, offset, length - SO_CONTENTS_OFFSET);
- soContentsBytes = new byte[length - SO_CONTENTS_OFFSET];
- System.arraycopy(bytes, offset + SO_CONTENTS_OFFSET, soContentsBytes, 0, length - SO_CONTENTS_OFFSET);
-
- logger.debug("Attempt to parse subobject from bytes: {}", ByteArray.bytesToHexString(soContentsBytes));
+ LOG.debug("Attempt to parse subobject from bytes: {}", ByteArray.bytesToHexString(soContentsBytes));
final Subobjects sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes, mandatory);
- logger.debug("Subobject was parsed. {}", sub);
+ LOG.debug("Subobject was parsed. {}", sub);
subs.add(sub);
- offset += length;
+ offset += soContentsBytes.length;
}
return subs;
}
for (final Subobjects subobject : subobjects) {
- final XROSubobjectSerializer serializer = this.subobjReg.getSubobjectSerializer(subobject);
+ final XROSubobjectSerializer serializer = this.subobjReg.getSubobjectSerializer(subobject.getSubobjectType());
+
+ final byte typeBytes = (byte) (ByteArray.cutBytes(ByteArray.intToBytes(serializer.getType()), (Integer.SIZE / 8) - 1)[0] | (subobject.isMandatory() ? 1 << 7
+ : 0));
final byte[] valueBytes = serializer.serializeSubobject(subobject);
- final byte[] bytes = new byte[SUB_HEADER_LENGTH + valueBytes.length];
+ final byte lengthBytes = UnsignedBytes.checkedCast(valueBytes.length + SUB_HEADER_LENGTH);
- final byte typeBytes = (byte) (ByteArray.cutBytes(ByteArray.intToBytes(serializer.getType()), (Integer.SIZE / 8) - 1)[0] | (subobject.isMandatory() ? 1 << 7
- : 0));
- final byte lengthBytes = ByteArray.cutBytes(ByteArray.intToBytes(valueBytes.length), (Integer.SIZE / 8) - 1)[0];
+ final byte[] bytes = new byte[valueBytes.length + SUB_HEADER_LENGTH];
bytes[0] = typeBytes;
bytes[1] = lengthBytes;
- System.arraycopy(valueBytes, 0, bytes, SUB_HEADER_LENGTH, valueBytes.length);
+ ByteArray.copyWhole(valueBytes, bytes, SUB_HEADER_LENGTH);
finalLength += bytes.length;
result.add(bytes);
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExcludeRouteObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExcludeRouteObject.Flags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.svec.XroBuilder;
+import com.google.common.primitives.UnsignedBytes;
+
/**
* Parser for {@link ExcludeRouteObject}
*/
public final class PCEPExcludeRouteObjectParser extends AbstractXROWithSubobjectsParser {
- public static final int CLASS = 7; // FIXME: to actual value
+ public static final int CLASS = 7;
public static final int TYPE = 1;
+ private static final int FLAGS_OFFSET = 3;
+
public PCEPExcludeRouteObjectParser(final XROSubobjectHandlerRegistry registry) {
super(registry);
}
@Override
public ExcludeRouteObject parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException,
PCEPDocumentedException {
- if (bytes == null || bytes.length == 0)
+ if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
-
+ }
final XroBuilder builder = new XroBuilder();
-
builder.setIgnore(header.isIgnore());
builder.setProcessingRule(header.isProcessingRule());
- builder.setSubobjects(parseSubobjects(bytes));
+ builder.setFlags(new Flags(UnsignedBytes.toInt(bytes[FLAGS_OFFSET]) != 0));
+ builder.setSubobjects(parseSubobjects(ByteArray.cutBytes(bytes, FLAGS_OFFSET + 1)));
return builder.build();
}
@Override
public byte[] serializeObject(final Object object) {
- if (!(object instanceof ExcludeRouteObject))
+ if (!(object instanceof ExcludeRouteObject)) {
throw new IllegalArgumentException("Wrong instance of PCEPObject. Passed " + object.getClass() + ". Needed ExcludeRouteObject.");
+ }
final ExcludeRouteObject obj = (ExcludeRouteObject) object;
assert !(obj.getSubobjects().isEmpty()) : "Empty Excluded Route Object.";
- return serializeSubobject(obj.getSubobjects());
+ final byte[] bytes = serializeSubobject(obj.getSubobjects());
+ final byte[] result = new byte[FLAGS_OFFSET + 1 + bytes.length];
+ if (obj.getFlags().isFail()) {
+ result[FLAGS_OFFSET] = 1;
+ }
+ ByteArray.copyWhole(bytes, result, FLAGS_OFFSET + 1);
+ return result;
}
@Override
/*
* offsets of flags inside flags field in bits
*/
- private static final int S_FLAG_OFFSET = 6;
private static final int L_FLAG_OFFSET = 7;
/*
for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Subobjects subobject : subobjects) {
- final XROSubobjectSerializer serializer = this.registry.getSubobjectSerializer(subobject);
+ final XROSubobjectSerializer serializer = this.registry.getSubobjectSerializer(subobject.getSubobjectType());
System.out.println(serializer);
import org.opendaylight.protocol.pcep.impl.object.PCEPCloseObjectParser;
import org.opendaylight.protocol.pcep.impl.object.PCEPEndPointsObjectParser;
import org.opendaylight.protocol.pcep.impl.object.PCEPErrorObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPExcludeRouteObjectParser;
import org.opendaylight.protocol.pcep.impl.object.PCEPGlobalConstraintsObjectParser;
import org.opendaylight.protocol.pcep.impl.object.PCEPLoadBalancingObjectParser;
import org.opendaylight.protocol.pcep.impl.object.PCEPLspObjectParser;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.pojo.PCEPExtensionProviderContextImpl;
import org.opendaylight.protocol.util.ByteArray;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ClassType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.message.c.close.message.CCloseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.object.address.family.Ipv4Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.object.address.family.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Subobjects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.SubobjectsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.ClassTypeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.LspaBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.OfBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.requests.segment.computation.p2p.reported.route.BandwidthBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.svec.GcBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.svec.MetricBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.svec.XroBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.predundancy.group.id.tlv.PredundancyGroupId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.predundancy.group.id.tlv.PredundancyGroupIdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.req.missing.tlv.ReqMissingBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.symbolic.path.name.tlv.SymbolicPathName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.symbolic.path.name.tlv.SymbolicPathNameBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.AttributeFilter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.ExcludeRouteSubobjects.Attribute;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumberBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixBuilder;
import com.google.common.collect.Lists;
import com.google.common.primitives.UnsignedBytes;
assertArrayEquals(result, parser.serializeObject(builder.build()));
}
- //
- // /**
- // * Test PCEPExcludeRouteObjectObject (Serialization/Deserialization)<br/>
- // * Used resources:<br/>
- // * - PCEPExcludeRouteObject.1.bin<br/>
- // *
- // * @throws IOException
- // * @throws PCEPDeserializerException
- // * @throws PCEPDocumentedException
- // */
- // @Test
- // public void testExcludeRouteObject() throws IOException, PCEPDeserializerException, PCEPDocumentedException {
- // final List<ExcludeRouteSubobject> xroSubobjects = new ArrayList<ExcludeRouteSubobject>();
- // xroSubobjects.add(new XROIPPrefixSubobject<IPv4Prefix>(new IPv4Prefix(new IPv4Address(new byte[] { (byte) 192,
- // (byte) 168,
- // (byte) 100, (byte) 100 }), 16), true, XROSubobjectAttribute.NODE));
- // xroSubobjects.add(new XROAsNumberSubobject(new AsNumber(0x1234L), false));
- //
- // }
- //
+ @Test
+ public void testExcludeRouteObject() throws Exception {
+ final PCEPExcludeRouteObjectParser parser = new PCEPExcludeRouteObjectParser(PCEPExtensionProviderContextImpl.create().getXROSubobjectHandlerRegistry());
+ final byte[] result = ByteArray.fileToBytes("src/test/resources/PCEPExcludeRouteObject.1.bin");
+
+ final XroBuilder builder = new XroBuilder();
+ builder.setProcessingRule(false);
+ builder.setIgnore(false);
+ builder.setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExcludeRouteObject.Flags(true));
+ final List<Subobjects> subs = Lists.newArrayList();
+ subs.add(new SubobjectsBuilder().setMandatory(true).setSubobjectType(
+ new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("192.168.0.0/16"))).build()).setAttribute(Attribute.Node).build());
+ subs.add(new SubobjectsBuilder().setMandatory(false).setSubobjectType(
+ new AsNumberBuilder().setAsNumber(new AsNumber(0x1234L)).build()).build());
+ builder.setSubobjects(subs);
+
+ assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), result));
+ assertArrayEquals(result, parser.serializeObject(builder.build()));
+ }
@Test
public void testSrpObject() throws IOException, PCEPDeserializerException, PCEPDocumentedException {
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.LabelType;
public interface PCEPExtensionProviderContext extends PCEPExtensionConsumerContext {
public AutoCloseable registerTlvParser(int tlvType, TlvParser parser);
- public AutoCloseable registerXROSubobjectSerializer(Class<? extends CSubobject> subobjectClass, XROSubobjectSerializer serializer);
+ public AutoCloseable registerXROSubobjectSerializer(Class<? extends SubobjectType> subobjectClass, XROSubobjectSerializer serializer);
public AutoCloseable registerXROSubobjectParser(int subobjectType, XROSubobjectParser parser);
}
*/
package org.opendaylight.protocol.pcep.spi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Subobjects;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
public interface XROSubobjectHandlerRegistry {
public XROSubobjectParser getSubobjectParser(int subobjectType);
- public XROSubobjectSerializer getSubobjectSerializer(Subobjects subobject);
+
+ public XROSubobjectSerializer getSubobjectSerializer(SubobjectType subobject);
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.LabelType;
import org.osgi.framework.BundleContext;
}
@Override
- public AutoCloseable registerXROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
+ public AutoCloseable registerXROSubobjectSerializer(final Class<? extends SubobjectType> subobjectClass,
final XROSubobjectSerializer serializer) {
// TODO Auto-generated method stub
return null;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.LabelType;
/**
}
@Override
- public AutoCloseable registerXROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
+ public AutoCloseable registerXROSubobjectSerializer(final Class<? extends SubobjectType> subobjectClass,
final XROSubobjectSerializer serializer) {
return this.xroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
}
import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
import org.opendaylight.protocol.util.Util;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Subobjects;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.SubobjectType;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import com.google.common.base.Preconditions;
return this.handlers.registerParser(subobjectType, parser);
}
- public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
+ public AutoCloseable registerSubobjectSerializer(final Class<? extends SubobjectType> subobjectClass,
final XROSubobjectSerializer serializer) {
return this.handlers.registerSerializer(subobjectClass, serializer);
}
}
@Override
- public XROSubobjectSerializer getSubobjectSerializer(final Subobjects subobject) {
+ public XROSubobjectSerializer getSubobjectSerializer(final SubobjectType subobject) {
return this.handlers.getSerializer(subobject.getImplementedInterface());
}
}