From cc3df352cb1591421c751913f07d8d3ce0b2a901 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 1 Jan 2014 14:03:13 +0100 Subject: [PATCH] Rename lists such that they follow IETF conventions reported-lsps -> reported-lsp various subobjects -> subobject Change-Id: I08bea6203401a2a05a78af669fe3c6a98636b326 Signed-off-by: Robert Varga --- pcep/api/src/main/yang/pcep-types.yang | 8 ++-- .../protocol/pcep/impl/Activator.java | 4 +- .../AbstractEROWithSubobjectsParser.java | 12 ++--- .../AbstractRROWithSubobjectsParser.java | 12 ++--- .../AbstractXROWithSubobjectsParser.java | 12 ++--- .../object/PCEPExcludeRouteObjectParser.java | 6 +-- .../object/PCEPExplicitRouteObjectParser.java | 6 +-- .../object/PCEPIncludeRouteObjectParser.java | 20 ++++----- .../impl/object/PCEPPathKeyObjectParser.java | 18 ++++---- .../object/PCEPReportedRouteObjectParser.java | 6 +-- .../subobject/EROAsNumberSubobjectParser.java | 10 ++--- ...ExplicitExclusionRouteSubobjectParser.java | 26 +++++------ .../EROIpv4PrefixSubobjectParser.java | 10 ++--- .../EROIpv6PrefixSubobjectParser.java | 10 ++--- .../subobject/EROLabelSubobjectParser.java | 10 ++--- .../EROPathKey128SubobjectParser.java | 18 ++++---- .../EROPathKey32SubobjectParser.java | 18 ++++---- ...EROUnnumberedInterfaceSubobjectParser.java | 10 ++--- .../RROIpv4PrefixSubobjectParser.java | 10 ++--- .../RROIpv6PrefixSubobjectParser.java | 10 ++--- .../subobject/RROLabelSubobjectParser.java | 10 ++--- .../RROPathKey128SubobjectParser.java | 16 +++---- .../RROPathKey32SubobjectParser.java | 16 +++---- ...RROUnnumberedInterfaceSubobjectParser.java | 10 ++--- .../subobject/XROAsNumberSubobjectParser.java | 10 ++--- .../XROIpv4PrefixSubobjectParser.java | 10 ++--- .../XROIpv6PrefixSubobjectParser.java | 12 ++--- .../XROPathKey128SubobjectParser.java | 18 ++++---- .../XROPathKey32SubobjectParser.java | 18 ++++---- .../subobject/XROSRLGSubobjectParser.java | 10 ++--- ...XROUnnumberedInterfaceSubobjectParser.java | 10 ++--- .../pcep/impl/PCEPEROSubobjectParserTest.java | 22 +++++----- .../pcep/impl/PCEPObjectParserTest.java | 44 +++++++++---------- .../pcep/impl/PCEPRROSubobjectParserTest.java | 18 ++++---- .../protocol/pcep/impl/PCEPValidatorTest.java | 22 +++++----- .../pcep/impl/PCEPXROSubobjectParserTest.java | 20 ++++----- .../protocol/pcep/spi/EROSubobjectParser.java | 4 +- .../pcep/spi/EROSubobjectSerializer.java | 4 +- .../protocol/pcep/spi/RROSubobjectParser.java | 4 +- .../pcep/spi/RROSubobjectSerializer.java | 4 +- .../protocol/pcep/spi/XROSubobjectParser.java | 4 +- .../pcep/spi/XROSubobjectSerializer.java | 4 +- .../src/main/yang/network-topology-pcep.yang | 2 +- .../provider/ServerSessionManager.java | 34 +++++++------- .../tunnel/provider/NodeChangedListener.java | 26 +++++------ .../tunnel/provider/TunnelProgramming.java | 10 ++--- 46 files changed, 299 insertions(+), 299 deletions(-) diff --git a/pcep/api/src/main/yang/pcep-types.yang b/pcep/api/src/main/yang/pcep-types.yang index c737dc0efd..1e69b9e63d 100644 --- a/pcep/api/src/main/yang/pcep-types.yang +++ b/pcep/api/src/main/yang/pcep-types.yang @@ -466,7 +466,7 @@ module pcep-types { mandatory true; } - list subobjects { + list subobject { uses rsvp:exclude-route-subobjects; } } @@ -480,7 +480,7 @@ module pcep-types { // No possibility of TLVs uses object; - list subobjects { + list subobject { leaf loose { type boolean; mandatory true; @@ -507,7 +507,7 @@ module pcep-types { // No possibility of TLVs uses object; - list subobjects { + list subobject { uses rsvp:explicit-route-subobjects; } } @@ -521,7 +521,7 @@ module pcep-types { // No possibility of TLVs uses object; - list subobjects { + list subobject { uses rsvp:record-route-subobjects { augment "subobject-type" { case path-key-case { diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java index 0071a6de3f..510ba848eb 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java @@ -107,7 +107,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.object.EndpointsObj; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Xro; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.gc.object.Gc; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.Iro; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.load.balancing.object.LoadBalancing; @@ -185,7 +185,7 @@ public final class Activator extends AbstractPCEPExtensionProviderActivator { org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.UnnumberedCase.class, new RROUnnumberedInterfaceSubobjectParser()); context.registerRROSubobjectSerializer( - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCase.class, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCase.class, new RROPathKey32SubobjectParser()); final XROSubobjectHandlerRegistry xroSubReg = context.getXROSubobjectHandlerRegistry(); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractEROWithSubobjectsParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractEROWithSubobjectsParser.java index eb01a5b209..324e9f40e3 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractEROWithSubobjectsParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractEROWithSubobjectsParser.java @@ -15,7 +15,7 @@ import org.opendaylight.protocol.pcep.spi.ObjectParser; import org.opendaylight.protocol.pcep.spi.ObjectSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,7 +39,7 @@ public abstract class AbstractEROWithSubobjectsParser implements ObjectParser, O this.subobjReg = Preconditions.checkNotNull(subobjReg); } - protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { + protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { if (bytes == null) { throw new IllegalArgumentException("Byte array is mandatory."); } @@ -50,7 +50,7 @@ public abstract class AbstractEROWithSubobjectsParser implements ObjectParser, O int length; int offset = 0; - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); while (offset < bytes.length) { @@ -68,7 +68,7 @@ public abstract class AbstractEROWithSubobjectsParser implements ObjectParser, O System.arraycopy(bytes, offset + SO_CONTENTS_OFFSET, soContentsBytes, 0, length - SO_CONTENTS_OFFSET); LOG.debug("Attempt to parse subobject from bytes: {}", ByteArray.bytesToHexString(soContentsBytes)); - final Subobjects sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes, loose); + final Subobject sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes, loose); LOG.debug("Subobject was parsed. {}", sub); subs.add(sub); @@ -78,13 +78,13 @@ public abstract class AbstractEROWithSubobjectsParser implements ObjectParser, O return subs; } - protected final byte[] serializeSubobject(final List subobjects) { + protected final byte[] serializeSubobject(final List subobjects) { final List result = Lists.newArrayList(); int finalLength = 0; - for (final Subobjects subobject : subobjects) { + for (final Subobject subobject : subobjects) { final EROSubobjectSerializer serializer = this.subobjReg.getSubobjectSerializer(subobject.getSubobjectType()); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractRROWithSubobjectsParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractRROWithSubobjectsParser.java index 7451908b50..412c61b4e8 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractRROWithSubobjectsParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractRROWithSubobjectsParser.java @@ -15,7 +15,7 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry; import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,7 +39,7 @@ public abstract class AbstractRROWithSubobjectsParser implements ObjectParser, O this.subobjReg = Preconditions.checkNotNull(subobjReg); } - protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { + protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { if (bytes == null) { throw new IllegalArgumentException("Byte array is mandatory."); } @@ -50,7 +50,7 @@ public abstract class AbstractRROWithSubobjectsParser implements ObjectParser, O int length; int offset = 0; - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); while (offset < bytes.length) { @@ -67,7 +67,7 @@ public abstract class AbstractRROWithSubobjectsParser implements ObjectParser, O System.arraycopy(bytes, offset + SO_CONTENTS_OFFSET, soContentsBytes, 0, length - SO_CONTENTS_OFFSET); LOG.debug("Attempt to parse subobject from bytes: {}", ByteArray.bytesToHexString(soContentsBytes)); - final Subobjects sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes); + final Subobject sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes); LOG.debug("Subobject was parsed. {}", sub); subs.add(sub); @@ -77,13 +77,13 @@ public abstract class AbstractRROWithSubobjectsParser implements ObjectParser, O return subs; } - protected final byte[] serializeSubobject(final List subobjects) { + protected final byte[] serializeSubobject(final List subobjects) { final List result = Lists.newArrayList(); int finalLength = 0; - for (final Subobjects subobject : subobjects) { + for (final Subobject subobject : subobjects) { final RROSubobjectSerializer serializer = this.subobjReg.getSubobjectSerializer(subobject.getSubobjectType()); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractXROWithSubobjectsParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractXROWithSubobjectsParser.java index dd250211de..cd2d0628ba 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractXROWithSubobjectsParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/AbstractXROWithSubobjectsParser.java @@ -15,7 +15,7 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +41,7 @@ public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, O this.subobjReg = Preconditions.checkNotNull(subobjReg); } - protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { + protected List parseSubobjects(final byte[] bytes) throws PCEPDeserializerException { if (bytes == null) { throw new IllegalArgumentException("Byte array is mandatory."); } @@ -50,7 +50,7 @@ public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, O int length; int offset = 0; - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); while (offset < bytes.length) { @@ -70,7 +70,7 @@ public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, O soContentsBytes = ByteArray.subByte(bytes, offset, length - SO_CONTENTS_OFFSET); LOG.debug("Attempt to parse subobject from bytes: {}", ByteArray.bytesToHexString(soContentsBytes)); - final Subobjects sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes, mandatory); + final Subobject sub = this.subobjReg.getSubobjectParser(type).parseSubobject(soContentsBytes, mandatory); LOG.debug("Subobject was parsed. {}", sub); subs.add(sub); @@ -80,13 +80,13 @@ public abstract class AbstractXROWithSubobjectsParser implements ObjectParser, O return subs; } - protected final byte[] serializeSubobject(final List subobjects) { + protected final byte[] serializeSubobject(final List subobjects) { final List result = Lists.newArrayList(); int finalLength = 0; - for (final Subobjects subobject : subobjects) { + for (final Subobject subobject : subobjects) { final XROSubobjectSerializer serializer = this.subobjReg.getSubobjectSerializer(subobject.getSubobjectType()); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExcludeRouteObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExcludeRouteObjectParser.java index 21e37526fe..1243ac0b34 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExcludeRouteObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExcludeRouteObjectParser.java @@ -42,7 +42,7 @@ public final class PCEPExcludeRouteObjectParser extends AbstractXROWithSubobject builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); builder.setFlags(new Flags(UnsignedBytes.toInt(bytes[FLAGS_OFFSET]) != 0)); - builder.setSubobjects(parseSubobjects(ByteArray.cutBytes(bytes, FLAGS_OFFSET + 1))); + builder.setSubobject(parseSubobjects(ByteArray.cutBytes(bytes, FLAGS_OFFSET + 1))); return builder.build(); } @@ -52,8 +52,8 @@ public final class PCEPExcludeRouteObjectParser extends AbstractXROWithSubobject throw new IllegalArgumentException("Wrong instance of PCEPObject. Passed " + object.getClass() + ". Needed ExcludeRouteObject."); } final Xro obj = (Xro) object; - assert !(obj.getSubobjects().isEmpty()) : "Empty Excluded Route Object."; - final byte[] bytes = serializeSubobject(obj.getSubobjects()); + assert !(obj.getSubobject().isEmpty()) : "Empty Excluded Route Object."; + final byte[] bytes = serializeSubobject(obj.getSubobject()); final byte[] result = new byte[FLAGS_OFFSET + 1 + bytes.length]; if (obj.getFlags().isFail()) { result[FLAGS_OFFSET] = 1; diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExplicitRouteObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExplicitRouteObjectParser.java index 387634c73e..5e67e0887e 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExplicitRouteObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPExplicitRouteObjectParser.java @@ -35,7 +35,7 @@ public class PCEPExplicitRouteObjectParser extends AbstractEROWithSubobjectsPars final EroBuilder builder = new EroBuilder(); builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); - builder.setSubobjects(parseSubobjects(bytes)); + builder.setSubobject(parseSubobjects(bytes)); return builder.build(); } @@ -47,10 +47,10 @@ public class PCEPExplicitRouteObjectParser extends AbstractEROWithSubobjectsPars } final Ero ero = ((Ero) object); - assert !(ero.getSubobjects().isEmpty()) : "Empty Explicit Route Object."; + assert !(ero.getSubobject().isEmpty()) : "Empty Explicit Route Object."; return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), - serializeSubobject(ero.getSubobjects())); + serializeSubobject(ero.getSubobject())); } @Override diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPIncludeRouteObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPIncludeRouteObjectParser.java index 23add83a03..a05e975c5f 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPIncludeRouteObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPIncludeRouteObjectParser.java @@ -15,8 +15,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ 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.include.route.object.Iro; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.IroBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder; import com.google.common.collect.Lists; @@ -44,11 +44,11 @@ public class PCEPIncludeRouteObjectParser extends AbstractEROWithSubobjectsParse builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); - final List subs = Lists.newArrayList(); - for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects s : parseSubobjects(bytes)) { - subs.add(new SubobjectsBuilder().setSubobjectType(s.getSubobjectType()).build()); + final List subs = Lists.newArrayList(); + for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject s : parseSubobjects(bytes)) { + subs.add(new SubobjectBuilder().setSubobjectType(s.getSubobjectType()).build()); } - builder.setSubobjects(subs); + builder.setSubobject(subs); return builder.build(); } @@ -59,12 +59,12 @@ public class PCEPIncludeRouteObjectParser extends AbstractEROWithSubobjectsParse } final Iro iro = ((Iro) object); - assert !(iro.getSubobjects().isEmpty()) : "Empty Include Route Object."; + assert !(iro.getSubobject().isEmpty()) : "Empty Include Route Object."; - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); - for (final Subobjects s : iro.getSubobjects()) { - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder().setLoose( + for (final Subobject s : iro.getSubobject()) { + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder().setLoose( false).setSubobjectType(s.getSubobjectType()).build()); } return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), serializeSubobject(subs)); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java index 427953dfe6..ec5b8d541f 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java @@ -13,8 +13,8 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; 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.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.path.key.object.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.path.key.object.PathKeyBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.path.key.object.path.key.PathKeys; @@ -41,9 +41,9 @@ public class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsParser { builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); final List pk = Lists.newArrayList(); - final List subs = parseSubobjects(bytes); - for (final Subobjects s : subs) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase k = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase) s.getSubobjectType(); + final List subs = parseSubobjects(bytes); + for (final Subobject s : subs) { + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase k = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase) s.getSubobjectType(); pk.add(new PathKeysBuilder().setLoose(s.isLoose()).setPceId(k.getPathKey().getPceId()).setPathKey(k.getPathKey().getPathKey()).build()); } builder.setPathKeys(pk); @@ -57,11 +57,11 @@ public class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsParser { } final PathKey pkey = (PathKey) object; final List pk = pkey.getPathKeys(); - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); for (final PathKeys p : pk) { - subs.add(new SubobjectsBuilder().setLoose(p.isLoose()).setSubobjectType( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder().setPathKey( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder().setPathKey( + subs.add(new SubobjectBuilder().setLoose(p.isLoose()).setSubobjectType( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder().setPathKey( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder().setPathKey( p.getPathKey()).setPceId(p.getPceId()).build()).build()).build()); } return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), serializeSubobject(subs)); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPReportedRouteObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPReportedRouteObjectParser.java index bfee4bbbd3..587dcea3f0 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPReportedRouteObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPReportedRouteObjectParser.java @@ -36,7 +36,7 @@ public class PCEPReportedRouteObjectParser extends AbstractRROWithSubobjectsPars builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); - builder.setSubobjects(parseSubobjects(bytes)); + builder.setSubobject(parseSubobjects(bytes)); return builder.build(); } @@ -47,9 +47,9 @@ public class PCEPReportedRouteObjectParser extends AbstractRROWithSubobjectsPars + ". Needed ReportedRouteObject."); } final Rro obj = (Rro) object; - assert !(obj.getSubobjects().isEmpty()) : "Empty Reported Route Object."; + assert !(obj.getSubobject().isEmpty()) : "Empty Reported Route Object."; return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), - serializeSubobject(obj.getSubobjects())); + serializeSubobject(obj.getSubobject())); } @Override diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROAsNumberSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROAsNumberSubobjectParser.java index b28e58eea2..9521ac3da0 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROAsNumberSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROAsNumberSubobjectParser.java @@ -13,8 +13,8 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; 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.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; 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.basic.explicit.route.subobjects.subobject.type.AsNumberCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumberCaseBuilder; @@ -34,7 +34,7 @@ public class EROAsNumberSubobjectParser implements EROSubobjectParser, EROSubobj public static final int CONTENT_LENGTH = AS_NUMBER_LENGTH + AS_NUMBER_OFFSET; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } @@ -43,13 +43,13 @@ public class EROAsNumberSubobjectParser implements EROSubobjectParser, EROSubobj + CONTENT_LENGTH + "."); } - return new SubobjectsBuilder().setLoose(loose).setSubobjectType( + return new SubobjectBuilder().setLoose(loose).setSubobjectType( new AsNumberCaseBuilder().setAsNumber( new AsNumberBuilder().setAsNumber(new AsNumber(ByteArray.bytesToLong(buffer))).build()).build()).build(); } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof AsNumberCase)) { throw new IllegalArgumentException("Unknown subobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed AsNumberCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROExplicitExclusionRouteSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROExplicitExclusionRouteSubobjectParser.java index 56148546b6..8ddc26655d 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROExplicitExclusionRouteSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROExplicitExclusionRouteSubobjectParser.java @@ -17,8 +17,8 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry; import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.ExrsCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.ExrsCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.Exrs; @@ -44,15 +44,15 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar } @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); - final List list = parseSubobjects(buffer); + final List list = parseSubobject(buffer); final List exrss = Lists.newArrayList(); - for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects s : list) { + for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject s : list) { final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder b = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder(); b.setAttribute(s.getAttribute()); b.setMandatory(s.isMandatory()); @@ -64,15 +64,15 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof ExrsCase)) { throw new IllegalArgumentException("Unknown subobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed Exrs."); } final Exrs e = ((ExrsCase) subobject.getSubobjectType()).getExrs(); - final List list = Lists.newArrayList(); + final List list = Lists.newArrayList(); for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.exrs.Exrs ex : e.getExrs()) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder b = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder(); + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder b = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder(); b.setAttribute(ex.getAttribute()); b.setMandatory(ex.isMandatory()); b.setSubobjectType(ex.getSubobjectType()); @@ -81,7 +81,7 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar return EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), serializeSubobject(list)); } - private List parseSubobjects( + private List parseSubobject( final byte[] bytes) throws PCEPDeserializerException { if (bytes == null) { throw new IllegalArgumentException("Byte array is mandatory."); @@ -93,7 +93,7 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar int length; int offset = 0; - final List subs = Lists.newArrayList(); + final List subs = Lists.newArrayList(); while (offset < bytes.length) { @@ -119,13 +119,13 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar } private byte[] serializeSubobject( - final List subobjects) { + final List subobjects) { final List result = Lists.newArrayList(); int finalLength = 0; - for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects subobject : subobjects) { + for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject subobject : subobjects) { final XROSubobjectSerializer serializer = this.registry.getSubobjectSerializer(subobject.getSubobjectType()); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv4PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv4PrefixSubobjectParser.java index 90da93c4e8..416334f258 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv4PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv4PrefixSubobjectParser.java @@ -14,8 +14,8 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; 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.basic.explicit.route.subobjects.subobject.type.IpPrefixCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder; @@ -38,11 +38,11 @@ public class EROIpv4PrefixSubobjectParser implements EROSubobjectParser, EROSubo private static final int CONTENT4_LENGTH = PREFIX4_F_OFFSET + PREFIX4_F_LENGTH + 1; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); if (buffer.length != CONTENT4_LENGTH) { @@ -55,7 +55,7 @@ public class EROIpv4PrefixSubobjectParser implements EROSubobjectParser, EROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown subobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed IpPrefixCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv6PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv6PrefixSubobjectParser.java index e06dd2553b..19df848d4b 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv6PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROIpv6PrefixSubobjectParser.java @@ -15,8 +15,8 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; 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.basic.explicit.route.subobjects.subobject.type.IpPrefixCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder; @@ -40,11 +40,11 @@ public class EROIpv6PrefixSubobjectParser implements EROSubobjectParser, EROSubo private static final int CONTENT_LENGTH = PREFIX_F_OFFSET + PREFIX_F_LENGTH + 1; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); if (buffer.length != CONTENT_LENGTH) { @@ -57,7 +57,7 @@ public class EROIpv6PrefixSubobjectParser implements EROSubobjectParser, EROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown subobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed IpPrefixCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROLabelSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROLabelSubobjectParser.java index bcf575a8e8..7a9c54eed6 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROLabelSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROLabelSubobjectParser.java @@ -18,8 +18,8 @@ import org.opendaylight.protocol.pcep.spi.LabelParser; import org.opendaylight.protocol.pcep.spi.LabelSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.LabelCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.LabelCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.label._case.Label; @@ -52,7 +52,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject } @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } @@ -72,11 +72,11 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject final LabelBuilder builder = new LabelBuilder(); builder.setUniDirectional(reserved.get(U_FLAG_OFFSET)); builder.setLabelType(parser.parseLabel(ByteArray.cutBytes(buffer, HEADER_LENGTH))); - return new SubobjectsBuilder().setLoose(loose).setSubobjectType(new LabelCaseBuilder().setLabel(builder.build()).build()).build(); + return new SubobjectBuilder().setLoose(loose).setSubobjectType(new LabelCaseBuilder().setLabel(builder.build()).build()).build(); } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { Preconditions.checkNotNull(subobject.getSubobjectType(), "Subobject type cannot be empty."); final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel(); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey128SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey128SubobjectParser.java index f9e126fc0f..4b24caac41 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey128SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey128SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; /** * Parser for {@link PathKey} @@ -39,7 +39,7 @@ public class EROPathKey128SubobjectParser implements EROSubobjectParser, EROSubo private static final int CONTENT128_LENGTH = PCE_ID_F_OFFSET + PCE128_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } @@ -49,7 +49,7 @@ public class EROPathKey128SubobjectParser implements EROSubobjectParser, EROSubo } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT128_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); @@ -59,8 +59,8 @@ public class EROPathKey128SubobjectParser implements EROSubobjectParser, EROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); + public byte[] serializeSubobject(final Subobject subobject) { + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); final int pathKey = pk.getPathKey().getValue(); final byte[] pceId = pk.getPceId().getBinary(); final byte[] retBytes = new byte[PK_F_LENGTH + pceId.length]; diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey32SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey32SubobjectParser.java index 910e195f69..3af2a6ab62 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey32SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROPathKey32SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; /** * Parser for {@link PathKey} @@ -38,7 +38,7 @@ public class EROPathKey32SubobjectParser implements EROSubobjectParser, EROSubob private static final int CONTENT_LENGTH = PCE_ID_F_OFFSET + PCE_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } @@ -48,7 +48,7 @@ public class EROPathKey32SubobjectParser implements EROSubobjectParser, EROSubob } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); @@ -58,8 +58,8 @@ public class EROPathKey32SubobjectParser implements EROSubobjectParser, EROSubob } @Override - public byte[] serializeSubobject(final Subobjects subobject) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); + public byte[] serializeSubobject(final Subobject subobject) { + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); final int pathKey = pk.getPathKey().getValue(); final byte[] pceId = pk.getPceId().getBinary(); final byte[] retBytes = new byte[PK_F_LENGTH + pceId.length]; diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROUnnumberedInterfaceSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROUnnumberedInterfaceSubobjectParser.java index 1843483449..35978fbd87 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROUnnumberedInterfaceSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/EROUnnumberedInterfaceSubobjectParser.java @@ -12,8 +12,8 @@ import org.opendaylight.protocol.pcep.spi.EROSubobjectParser; import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; 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.UnnumberedCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.UnnumberedCaseBuilder; @@ -37,7 +37,7 @@ public class EROUnnumberedInterfaceSubobjectParser implements EROSubobjectParser private static final int CONTENT_LENGTH = INTERFACE_ID_NUMBER_OFFSET + INTERFACE_ID_NUMBER_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException { + public Subobject 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."); } @@ -45,7 +45,7 @@ public class EROUnnumberedInterfaceSubobjectParser implements EROSubobjectParser throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + "; Expected: " + CONTENT_LENGTH + "."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setLoose(loose); final UnnumberedBuilder ubuilder = new UnnumberedBuilder(); ubuilder.setRouterId(ByteArray.bytesToLong(ByteArray.subByte(buffer, ROUTER_ID_NUMBER_OFFSET, ROUTER_ID_NUMBER_LENGTH))); @@ -56,7 +56,7 @@ public class EROUnnumberedInterfaceSubobjectParser implements EROSubobjectParser } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof UnnumberedCase)) { throw new IllegalArgumentException("Unknown ExplicitRouteSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed UnnumberedCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv4PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv4PrefixSubobjectParser.java index 8e5b7dbf76..74e5e21790 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv4PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv4PrefixSubobjectParser.java @@ -17,8 +17,8 @@ import org.opendaylight.protocol.pcep.spi.RROSubobjectParser; import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; 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.record.route.subobjects.subobject.type.IpPrefixCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.IpPrefixCaseBuilder; @@ -49,14 +49,14 @@ public class RROIpv4PrefixSubobjectParser implements RROSubobjectParser, RROSubo private static final int LPIU_F_OFFSET = 6; @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } if (buffer.length != CONTENT4_LENGTH) { throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + ";"); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); final int length = UnsignedBytes.toInt(buffer[PREFIX4_F_OFFSET]); final BitSet flags = ByteArray.bytesToBitSet(Arrays.copyOfRange(buffer, FLAGS4_F_OFFSET, FLAGS4_F_OFFSET + FLAGS_F_LENGTH)); builder.setProtectionAvailable(flags.get(LPA_F_OFFSET)); @@ -68,7 +68,7 @@ public class RROIpv4PrefixSubobjectParser implements RROSubobjectParser, RROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown ReportedRouteSubobject instance. Passed " + subobject.getClass() + ". Needed IpPrefixCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv6PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv6PrefixSubobjectParser.java index 8b5af74224..692d51d8bc 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv6PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROIpv6PrefixSubobjectParser.java @@ -18,8 +18,8 @@ import org.opendaylight.protocol.pcep.spi.RROSubobjectParser; import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; 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.record.route.subobjects.subobject.type.IpPrefixCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.IpPrefixCaseBuilder; @@ -50,11 +50,11 @@ public class RROIpv6PrefixSubobjectParser implements RROSubobjectParser, RROSubo private static final int LPIU_F_OFFSET = 6; @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); if (buffer.length != CONTENT_LENGTH) { throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + ";"); } @@ -69,7 +69,7 @@ public class RROIpv6PrefixSubobjectParser implements RROSubobjectParser, RROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown ReportedRouteSubobject instance. Passed " + subobject.getClass() + ". Needed IpPrefixCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROLabelSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROLabelSubobjectParser.java index 0bf35f48fb..20df46586b 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROLabelSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROLabelSubobjectParser.java @@ -18,8 +18,8 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.RROSubobjectParser; import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.LabelType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.LabelCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.LabelCaseBuilder; @@ -53,7 +53,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject } @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -74,11 +74,11 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject builder.setUniDirectional(reserved.get(U_FLAG_OFFSET)); builder.setGlobal(reserved.get(G_FLAG_OFFSET)); builder.setLabelType(parser.parseLabel(ByteArray.cutBytes(buffer, HEADER_LENGTH))); - return new SubobjectsBuilder().setSubobjectType(new LabelCaseBuilder().setLabel(builder.build()).build()).build(); + return new SubobjectBuilder().setSubobjectType(new LabelCaseBuilder().setLabel(builder.build()).build()).build(); } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel(); final LabelType l = label.getLabelType(); final LabelSerializer parser = this.registry.getLabelSerializer(l); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey128SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey128SubobjectParser.java index f7e7964479..ae1d3580e4 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey128SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey128SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.path.key._case.PathKeyBuilder; public class RROPathKey128SubobjectParser implements RROSubobjectParser, RROSubobjectSerializer { @@ -36,7 +36,7 @@ public class RROPathKey128SubobjectParser implements RROSubobjectParser, RROSubo private static final int CONTENT128_LENGTH = PCE_ID_F_OFFSET + PCE128_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -46,7 +46,7 @@ public class RROPathKey128SubobjectParser implements RROSubobjectParser, RROSubo } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT128_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); pBuilder.setPathKey(new PathKey(pathKey)); @@ -55,7 +55,7 @@ public class RROPathKey128SubobjectParser implements RROSubobjectParser, RROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { final PathKeyCase pk = (PathKeyCase) subobject.getSubobjectType(); final int pathKey = pk.getPathKey().getPathKey().getValue(); final byte[] pceId = pk.getPathKey().getPceId().getBinary(); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey32SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey32SubobjectParser.java index 6220ead64b..8b7ab98542 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey32SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROPathKey32SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.path.key._case.PathKeyBuilder; public class RROPathKey32SubobjectParser implements RROSubobjectParser, RROSubobjectSerializer { @@ -35,7 +35,7 @@ public class RROPathKey32SubobjectParser implements RROSubobjectParser, RROSubob private static final int CONTENT_LENGTH = PCE_ID_F_OFFSET + PCE_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -45,7 +45,7 @@ public class RROPathKey32SubobjectParser implements RROSubobjectParser, RROSubob } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); pBuilder.setPathKey(new PathKey(pathKey)); @@ -54,7 +54,7 @@ public class RROPathKey32SubobjectParser implements RROSubobjectParser, RROSubob } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { final PathKeyCase pk = (PathKeyCase) subobject.getSubobjectType(); final int pathKey = pk.getPathKey().getPathKey().getValue(); final byte[] pceId = pk.getPathKey().getPceId().getBinary(); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROUnnumberedInterfaceSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROUnnumberedInterfaceSubobjectParser.java index ef07f101b1..8bab5bd732 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROUnnumberedInterfaceSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/RROUnnumberedInterfaceSubobjectParser.java @@ -15,8 +15,8 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.RROSubobjectParser; import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; 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.record.route.subobjects.subobject.type.UnnumberedCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.UnnumberedCaseBuilder; @@ -44,7 +44,7 @@ public class RROUnnumberedInterfaceSubobjectParser implements RROSubobjectParser private static final int LPIU_F_OFFSET = 6; @Override - public Subobjects parseSubobject(final byte[] buffer) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -53,7 +53,7 @@ public class RROUnnumberedInterfaceSubobjectParser implements RROSubobjectParser + CONTENT_LENGTH + "."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); final BitSet flags = ByteArray.bytesToBitSet(Arrays.copyOfRange(buffer, 0, FLAGS_F_LENGTH)); builder.setProtectionAvailable(flags.get(LPA_F_OFFSET)); builder.setProtectionInUse(flags.get(LPIU_F_OFFSET)); @@ -66,7 +66,7 @@ public class RROUnnumberedInterfaceSubobjectParser implements RROSubobjectParser } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof UnnumberedCase)) { throw new IllegalArgumentException("Unknown ReportedRouteSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed UnnumberedCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROAsNumberSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROAsNumberSubobjectParser.java index 24da8a080d..dbabc4907a 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROAsNumberSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROAsNumberSubobjectParser.java @@ -13,8 +13,8 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; 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.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; 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.basic.explicit.route.subobjects.subobject.type.AsNumberCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumberCaseBuilder; @@ -34,7 +34,7 @@ public class XROAsNumberSubobjectParser implements XROSubobjectParser, XROSubobj private static final int CONTENT_LENGTH = AS_NUMBER_LENGTH + AS_NUMBER_OFFSET; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -42,13 +42,13 @@ public class XROAsNumberSubobjectParser implements XROSubobjectParser, XROSubobj throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + "; Expected: " + CONTENT_LENGTH + "."); } - return new SubobjectsBuilder().setMandatory(mandatory).setSubobjectType( + return new SubobjectBuilder().setMandatory(mandatory).setSubobjectType( new AsNumberCaseBuilder().setAsNumber( new AsNumberBuilder().setAsNumber(new AsNumber(ByteArray.bytesToLong(buffer))).build()).build()).build(); } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof AsNumberCase)) { throw new IllegalArgumentException("Unknown PCEPXROSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed AsNumberCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv4PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv4PrefixSubobjectParser.java index b0ab8474c0..b256c6eddc 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv4PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv4PrefixSubobjectParser.java @@ -14,8 +14,8 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; 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.IpPrefixSubobject; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCase; @@ -42,14 +42,14 @@ public class XROIpv4PrefixSubobjectParser implements XROSubobjectParser, XROSubo private static final int CONTENT4_LENGTH = ATTRIBUTE4_OFFSET + ATTRIBUTE_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } if (buffer.length != CONTENT4_LENGTH) { throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + ";"); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setMandatory(mandatory); final int length = UnsignedBytes.toInt(buffer[PREFIX4_F_OFFSET]); builder.setAttribute(Attribute.forValue(UnsignedBytes.toInt(buffer[ATTRIBUTE4_OFFSET]))); @@ -60,7 +60,7 @@ public class XROIpv4PrefixSubobjectParser implements XROSubobjectParser, XROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown PCEPXROSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed IpPrefixCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv6PrefixSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv6PrefixSubobjectParser.java index 05a2dfd1d2..828a249ff7 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv6PrefixSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROIpv6PrefixSubobjectParser.java @@ -15,8 +15,8 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; 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.IpPrefixSubobject; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCase; @@ -44,14 +44,14 @@ public class XROIpv6PrefixSubobjectParser implements XROSubobjectParser, XROSubo private static final int CONTENT6_LENGTH = ATTRIBUTE6_OFFSET + ATTRIBUTE_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } if (buffer.length != CONTENT6_LENGTH) { throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + ";"); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setMandatory(mandatory); final int length = UnsignedBytes.toInt(buffer[PREFIX6_F_OFFSET]); builder.setAttribute(Attribute.forValue(UnsignedBytes.toInt(buffer[ATTRIBUTE6_OFFSET]))); @@ -62,7 +62,7 @@ public class XROIpv6PrefixSubobjectParser implements XROSubobjectParser, XROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof IpPrefixCase)) { throw new IllegalArgumentException("Unknown PCEPXROSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed IpPrefixCase."); @@ -84,4 +84,4 @@ public class XROIpv6PrefixSubobjectParser implements XROSubobjectParser, XROSubo public int getType() { return TYPE; } -} \ No newline at end of file +} diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey128SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey128SubobjectParser.java index d49002e69d..a8415da491 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey128SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey128SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; /** * Parser for {@link PathKey} @@ -39,7 +39,7 @@ public class XROPathKey128SubobjectParser implements XROSubobjectParser, XROSubo private static final int CONTENT128_LENGTH = PCE_ID_F_OFFSET + PCE128_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -49,7 +49,7 @@ public class XROPathKey128SubobjectParser implements XROSubobjectParser, XROSubo } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT128_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setMandatory(mandatory); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); @@ -59,8 +59,8 @@ public class XROPathKey128SubobjectParser implements XROSubobjectParser, XROSubo } @Override - public byte[] serializeSubobject(final Subobjects subobject) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); + public byte[] serializeSubobject(final Subobject subobject) { + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); final int pathKey = pk.getPathKey().getValue(); final byte[] pceId = pk.getPceId().getBinary(); final byte[] retBytes = new byte[PK_F_LENGTH + pceId.length]; diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey32SubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey32SubobjectParser.java index 721a281fde..61acda20b3 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey32SubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROPathKey32SubobjectParser.java @@ -16,11 +16,11 @@ import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCase; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; /** * Parser for {@link PathKey} @@ -38,7 +38,7 @@ public class XROPathKey32SubobjectParser implements XROSubobjectParser, XROSubob private static final int CONTENT_LENGTH = PCE_ID_F_OFFSET + PCE_ID_F_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -48,7 +48,7 @@ public class XROPathKey32SubobjectParser implements XROSubobjectParser, XROSubob } final byte[] pceId = Arrays.copyOfRange(buffer, PCE_ID_F_OFFSET, CONTENT_LENGTH); final int pathKey = ByteArray.bytesToShort(Arrays.copyOfRange(buffer, PK_F_OFFSET, PCE_ID_F_OFFSET)); - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setMandatory(mandatory); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(pceId)); @@ -58,8 +58,8 @@ public class XROPathKey32SubobjectParser implements XROSubobjectParser, XROSubob } @Override - public byte[] serializeSubobject(final Subobjects subobject) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); + public byte[] serializeSubobject(final Subobject subobject) { + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKey pk = ((PathKeyCase) subobject.getSubobjectType()).getPathKey(); final int pathKey = pk.getPathKey().getValue(); final byte[] pceId = pk.getPceId().getBinary(); final byte[] retBytes = new byte[PK_F_LENGTH + pceId.length]; diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROSRLGSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROSRLGSubobjectParser.java index ee5f9b6a83..b93f1ed1d4 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROSRLGSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROSRLGSubobjectParser.java @@ -12,8 +12,8 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; 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.SrlgId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.SrlgSubobject; @@ -39,7 +39,7 @@ public class XROSRLGSubobjectParser implements XROSubobjectParser, XROSubobjectS private static final int CONTENT_LENGTH = SRLG_ID_NUMBER_LENGTH + ATTRIBUTE_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -48,7 +48,7 @@ public class XROSRLGSubobjectParser implements XROSubobjectParser, XROSubobjectS + CONTENT_LENGTH + "."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); builder.setMandatory(mandatory); builder.setAttribute(Attribute.Srlg); builder.setSubobjectType(new SrlgCaseBuilder().setSrlg( @@ -58,7 +58,7 @@ public class XROSRLGSubobjectParser implements XROSubobjectParser, XROSubobjectS } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof SrlgCase)) { throw new IllegalArgumentException("Unknown PCEPXROSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed SrlgCase."); diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROUnnumberedInterfaceSubobjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROUnnumberedInterfaceSubobjectParser.java index 0e34dd322b..ceef1e1187 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROUnnumberedInterfaceSubobjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/subobject/XROUnnumberedInterfaceSubobjectParser.java @@ -12,8 +12,8 @@ import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.pcep.spi.XROSubobjectParser; import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer; import org.opendaylight.protocol.util.ByteArray; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; 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.UnnumberedSubobject; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.UnnumberedCase; @@ -41,7 +41,7 @@ public class XROUnnumberedInterfaceSubobjectParser implements XROSubobjectParser private static final int CONTENT_LENGTH = INTERFACE_ID_NUMBER_OFFSET + INTERFACE_ID_NUMBER_LENGTH; @Override - public Subobjects parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { + public Subobject parseSubobject(final byte[] buffer, final boolean mandatory) throws PCEPDeserializerException { if (buffer == null || buffer.length == 0) { throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty."); } @@ -50,7 +50,7 @@ public class XROUnnumberedInterfaceSubobjectParser implements XROSubobjectParser + CONTENT_LENGTH + "."); } - final SubobjectsBuilder builder = new SubobjectsBuilder(); + final SubobjectBuilder builder = new SubobjectBuilder(); final UnnumberedBuilder ubuilder = new UnnumberedBuilder(); ubuilder.setRouterId(ByteArray.bytesToLong(ByteArray.subByte(buffer, ROUTER_ID_NUMBER_OFFSET, ROUTER_ID_NUMBER_LENGTH))); ubuilder.setInterfaceId(UnsignedInts.toLong(ByteArray.bytesToInt(ByteArray.subByte(buffer, INTERFACE_ID_NUMBER_OFFSET, @@ -62,7 +62,7 @@ public class XROUnnumberedInterfaceSubobjectParser implements XROSubobjectParser } @Override - public byte[] serializeSubobject(final Subobjects subobject) { + public byte[] serializeSubobject(final Subobject subobject) { if (!(subobject.getSubobjectType() instanceof UnnumberedCase)) { throw new IllegalArgumentException("Unknown PCEPXROSubobject instance. Passed " + subobject.getSubobjectType().getClass() + ". Needed UnnumberedCase."); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java index f4b01b193c..fa9fb16cf5 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java @@ -30,9 +30,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. 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.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumberCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.LabelCaseBuilder; @@ -69,7 +69,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROIp4PrefixSubobject() throws PCEPDeserializerException { final EROIpv4PrefixSubobjectParser parser = new EROIpv4PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build()); @@ -80,7 +80,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROIp6PrefixSubobject() throws PCEPDeserializerException { final EROIpv6PrefixSubobjectParser parser = new EROIpv6PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix( new IpPrefix(Ipv6Util.prefixForBytes(new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, @@ -94,7 +94,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROAsNumberSubobject() throws PCEPDeserializerException { final EROAsNumberSubobjectParser parser = new EROAsNumberSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build()); assertEquals(subs.build(), parser.parseSubobject(ByteArray.cutBytes(asNumberBytes, 2), true)); @@ -104,7 +104,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROUnnumberedSubobject() throws PCEPDeserializerException { final EROUnnumberedInterfaceSubobjectParser parser = new EROUnnumberedInterfaceSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered( new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build()); @@ -115,7 +115,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROPathKey32Subobject() throws PCEPDeserializerException { final EROPathKey32SubobjectParser parser = new EROPathKey32SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 })); @@ -128,7 +128,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROPathKey128Subobject() throws PCEPDeserializerException { final EROPathKey128SubobjectParser parser = new EROPathKey128SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, @@ -142,7 +142,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROLabelSubobject() throws Exception { final EROLabelSubobjectParser parser = new EROLabelSubobjectParser(ServiceLoaderPCEPExtensionProviderContext.create().getLabelHandlerRegistry()); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); subs.setSubobjectType(new LabelCaseBuilder().setLabel( new LabelBuilder().setUniDirectional(true).setLabelType( @@ -156,7 +156,7 @@ public class PCEPEROSubobjectParserTest { @Test public void testEROEXRSSubobject() throws Exception { final EROExplicitExclusionRouteSubobjectParser parser = new EROExplicitExclusionRouteSubobjectParser(ServiceLoaderPCEPExtensionProviderContext.create().getXROSubobjectHandlerRegistry()); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setLoose(true); final List list = Lists.newArrayList(); final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder builder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder(); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java index 0474530804..1aba4a4c0b 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java @@ -76,8 +76,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.address.family.ipv6._case.Ipv6Builder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.object.EndpointsObjBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.XroBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.EroBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.gc.object.GcBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.IroBuilder; @@ -214,19 +214,19 @@ public class PCEPObjectParserTest { final EroBuilder builder = new EroBuilder(); builder.setProcessingRule(false); builder.setIgnore(false); - final List subs = Lists.newArrayList(); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder().setLoose( + final List subs = Lists.newArrayList(); + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder().setLoose( true).setSubobjectType( new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0xffffL)).build()).build()).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder().setLoose( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder().setLoose( true).setSubobjectType( new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/32"))).build()).build()).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder().setLoose( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder().setLoose( true).setSubobjectType( new UnnumberedCaseBuilder().setUnnumbered( new UnnumberedBuilder().setRouterId(0xffffffffL).setInterfaceId(0xffffffffL).build()).build()).build()); - builder.setSubobjects(subs); + builder.setSubobject(subs); assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), ByteArray.cutBytes(result, 4))); assertArrayEquals(result, parser.serializeObject(builder.build())); @@ -242,19 +242,19 @@ public class PCEPObjectParserTest { final IroBuilder builder = new IroBuilder(); builder.setProcessingRule(false); builder.setIgnore(false); - final List subs = Lists.newArrayList(); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder().setSubobjectType( + final List subs = Lists.newArrayList(); + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder().setSubobjectType( new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x10L)).build()).build()).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder().setSubobjectType( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder().setSubobjectType( new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("18.52.80.0/21"))).build()).build()).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder().setSubobjectType( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder().setSubobjectType( new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix(new IpPrefix(Ipv6Util.prefixForBytes(ip6PrefixBytes, 22))).build()).build()).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder().setSubobjectType( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder().setSubobjectType( new UnnumberedCaseBuilder().setUnnumbered( new UnnumberedBuilder().setRouterId(0x1245678L).setInterfaceId(0x9abcdef0L).build()).build()).build()); - builder.setSubobjects(subs); + builder.setSubobject(subs); assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), ByteArray.cutBytes(result, 4))); assertArrayEquals(result, parser.serializeObject(builder.build())); @@ -270,23 +270,23 @@ public class PCEPObjectParserTest { final RroBuilder builder = new RroBuilder(); builder.setProcessingRule(false); builder.setIgnore(false); - final List subs = Lists.newArrayList(); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder().setSubobjectType( + final List subs = Lists.newArrayList(); + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder().setSubobjectType( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.IpPrefixCaseBuilder().setIpPrefix( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder().setIpPrefix( new IpPrefix(new Ipv4Prefix("255.255.255.255/32"))).build()).build()).setProtectionAvailable(false).setProtectionInUse( false).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder().setSubobjectType( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder().setSubobjectType( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.IpPrefixCaseBuilder().setIpPrefix( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder().setIpPrefix( new IpPrefix(Ipv6Util.prefixForBytes(ip6PrefixBytes, 22))).build()).build()).setProtectionAvailable(false).setProtectionInUse( false).build()); - subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder().setSubobjectType( + subs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder().setSubobjectType( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.UnnumberedCaseBuilder().setUnnumbered( new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.unnumbered._case.UnnumberedBuilder().setRouterId( 0x1245678L).setInterfaceId(0x9abcdef0L).build()).build()).setProtectionAvailable(false).setProtectionInUse( false).build()); - builder.setSubobjects(subs); + builder.setSubobject(subs); assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), ByteArray.cutBytes(result, 4))); assertArrayEquals(result, parser.serializeObject(builder.build())); @@ -611,14 +611,14 @@ public class PCEPObjectParserTest { builder.setProcessingRule(false); builder.setIgnore(false); builder.setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Xro.Flags(true)); - final List subs = Lists.newArrayList(); - subs.add(new SubobjectsBuilder().setMandatory(true).setSubobjectType( + final List subs = Lists.newArrayList(); + subs.add(new SubobjectBuilder().setMandatory(true).setSubobjectType( new IpPrefixCaseBuilder().setIpPrefix( new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("192.168.0.0/16"))).build()).build()).setAttribute( Attribute.Node).build()); - subs.add(new SubobjectsBuilder().setMandatory(false).setSubobjectType( + subs.add(new SubobjectBuilder().setMandatory(false).setSubobjectType( new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x1234L)).build()).build()).build()); - builder.setSubobjects(subs); + builder.setSubobject(subs); assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), ByteArray.cutBytes(result, 4))); assertArrayEquals(result, parser.serializeObject(builder.build())); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java index 5a789d1713..1ed5cd83d3 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java @@ -25,9 +25,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. 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.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.subobject.subobject.type.path.key._case.PathKeyBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.label.type.GeneralizedLabelCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.label.subobject.label.type.generalized.label._case.GeneralizedLabelBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.record.route.subobjects.subobject.type.IpPrefixCaseBuilder; @@ -57,7 +57,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROIp4PrefixSubobject() throws PCEPDeserializerException { final RROIpv4PrefixSubobjectParser parser = new RROIpv4PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setProtectionAvailable(true); subs.setProtectionInUse(false); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( @@ -69,7 +69,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROIp6PrefixSubobject() throws PCEPDeserializerException { final RROIpv6PrefixSubobjectParser parser = new RROIpv6PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setProtectionAvailable(false); subs.setProtectionInUse(true); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( @@ -84,7 +84,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROUnnumberedSubobject() throws PCEPDeserializerException { final RROUnnumberedInterfaceSubobjectParser parser = new RROUnnumberedInterfaceSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setProtectionAvailable(false); subs.setProtectionInUse(true); subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered( @@ -96,7 +96,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROPathKey32Subobject() throws PCEPDeserializerException { final RROPathKey32SubobjectParser parser = new RROPathKey32SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 })); pBuilder.setPathKey(new PathKey(4660)); @@ -108,7 +108,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROPathKey128Subobject() throws PCEPDeserializerException { final RROPathKey128SubobjectParser parser = new RROPathKey128SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 })); @@ -121,7 +121,7 @@ public class PCEPRROSubobjectParserTest { @Test public void testRROLabelSubobject() throws Exception { final RROLabelSubobjectParser parser = new RROLabelSubobjectParser(ServiceLoaderPCEPExtensionProviderContext.create().getLabelHandlerRegistry()); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setSubobjectType(new LabelCaseBuilder().setLabel( new LabelBuilder().setUniDirectional(true).setGlobal(true).setLabelType( new GeneralizedLabelCaseBuilder().setGeneralizedLabel( diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java index 1530d94a41..2bee92454c 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java @@ -81,8 +81,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.EroBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.Iro; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.IroBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.include.route.object.iro.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.MetricsBuilder; @@ -240,27 +240,27 @@ public class PCEPValidatorTest { final IroBuilder iroBuilder = new IroBuilder(); iroBuilder.setIgnore(false); iroBuilder.setProcessingRule(false); - final List iroSubs = Lists.newArrayList(); - iroSubs.add(new SubobjectsBuilder().setSubobjectType(this.eroASSubobject).build()); - iroBuilder.setSubobjects(iroSubs); + final List iroSubs = Lists.newArrayList(); + iroSubs.add(new SubobjectBuilder().setSubobjectType(this.eroASSubobject).build()); + iroBuilder.setSubobject(iroSubs); this.iro = iroBuilder.build(); final EroBuilder eroBuilder = new EroBuilder(); eroBuilder.setIgnore(false); eroBuilder.setProcessingRule(false); - final List eroSubs = Lists.newArrayList(); - eroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder().setSubobjectType( + final List eroSubs = Lists.newArrayList(); + eroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder().setSubobjectType( this.eroASSubobject).setLoose(false).build()); - eroBuilder.setSubobjects(eroSubs); + eroBuilder.setSubobject(eroSubs); this.ero = eroBuilder.build(); final RroBuilder rroBuilder = new RroBuilder(); rroBuilder.setIgnore(false); rroBuilder.setProcessingRule(false); - final List rroSubs = Lists.newArrayList(); - rroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectsBuilder().setSubobjectType( + final List rroSubs = Lists.newArrayList(); + rroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.SubobjectBuilder().setSubobjectType( this.rroUnnumberedSub).setProtectionAvailable(false).setProtectionInUse(false).build()); - rroBuilder.setSubobjects(rroSubs); + rroBuilder.setSubobject(rroSubs); this.rro = rroBuilder.build(); final OfBuilder ofBuilder = new OfBuilder(); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java index 8959742399..bcd3517d2d 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java @@ -26,9 +26,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. 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.pcep.types.rev131005.PathKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PceId; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.SubobjectBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.PathKeyCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobject.subobject.type.path.key._case.PathKeyBuilder; 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.SrlgId; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.AsNumberCaseBuilder; @@ -60,7 +60,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROIp4PrefixSubobject() throws PCEPDeserializerException { final XROIpv4PrefixSubobjectParser parser = new XROIpv4PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(false); subs.setAttribute(Attribute.Interface); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( @@ -72,7 +72,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROIp6PrefixSubobject() throws PCEPDeserializerException { final XROIpv6PrefixSubobjectParser parser = new XROIpv6PrefixSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); subs.setAttribute(Attribute.Node); subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix( @@ -87,7 +87,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROSrlgSubobject() throws PCEPDeserializerException { final XROSRLGSubobjectParser parser = new XROSRLGSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); subs.setAttribute(Attribute.Srlg); subs.setSubobjectType(new SrlgCaseBuilder().setSrlg(new SrlgBuilder().setSrlgId(new SrlgId(0x12345678L)).build()).build()); @@ -98,7 +98,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROUnnumberedSubobject() throws PCEPDeserializerException { final XROUnnumberedInterfaceSubobjectParser parser = new XROUnnumberedInterfaceSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); subs.setAttribute(Attribute.Node); subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered( @@ -110,7 +110,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROAsNumberSubobject() throws PCEPDeserializerException { final XROAsNumberSubobjectParser parser = new XROAsNumberSubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build()); assertEquals(subs.build(), parser.parseSubobject(ByteArray.cutBytes(asNumberBytes, 2), true)); @@ -120,7 +120,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROPathKey32Subobject() throws PCEPDeserializerException { final XROPathKey32SubobjectParser parser = new XROPathKey32SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 })); @@ -133,7 +133,7 @@ public class PCEPXROSubobjectParserTest { @Test public void testXROPathKey128Subobject() throws PCEPDeserializerException { final XROPathKey128SubobjectParser parser = new XROPathKey128SubobjectParser(); - final SubobjectsBuilder subs = new SubobjectsBuilder(); + final SubobjectBuilder subs = new SubobjectBuilder(); subs.setMandatory(true); final PathKeyBuilder pBuilder = new PathKeyBuilder(); pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectParser.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectParser.java index ab2c453872..d290b923c8 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectParser.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectParser.java @@ -7,8 +7,8 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; public interface EROSubobjectParser { - Subobjects parseSubobject(byte[] buffer, boolean loose) throws PCEPDeserializerException; + Subobject parseSubobject(byte[] buffer, boolean loose) throws PCEPDeserializerException; } diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectSerializer.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectSerializer.java index c4084c215c..1230c85b87 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectSerializer.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectSerializer.java @@ -7,11 +7,11 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; public interface EROSubobjectSerializer { @Deprecated int getType(); - byte[] serializeSubobject(Subobjects subobject); + byte[] serializeSubobject(Subobject subobject); } diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectParser.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectParser.java index de8b0e9c35..2c2914e8de 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectParser.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectParser.java @@ -7,8 +7,8 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; public interface RROSubobjectParser { - Subobjects parseSubobject(byte[] buffer) throws PCEPDeserializerException; + Subobject parseSubobject(byte[] buffer) throws PCEPDeserializerException; } diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectSerializer.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectSerializer.java index b1efa68cc6..5bb0e9cc5a 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectSerializer.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectSerializer.java @@ -7,12 +7,12 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject; public interface RROSubobjectSerializer { @Deprecated int getType(); - byte[] serializeSubobject(Subobjects subobject); + byte[] serializeSubobject(Subobject subobject); } diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectParser.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectParser.java index 17abf309e5..6a0d3338f6 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectParser.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectParser.java @@ -7,8 +7,8 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; public interface XROSubobjectParser { - Subobjects parseSubobject(byte[] buffer, boolean mandatory) throws PCEPDeserializerException; + Subobject parseSubobject(byte[] buffer, boolean mandatory) throws PCEPDeserializerException; } diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectSerializer.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectSerializer.java index 50ffcb31c8..cc47c272d5 100644 --- a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectSerializer.java +++ b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectSerializer.java @@ -7,12 +7,12 @@ */ package org.opendaylight.protocol.pcep.spi; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobjects; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject; public interface XROSubobjectSerializer { @Deprecated int getType(); - byte[] serializeSubobject(Subobjects subobject); + byte[] serializeSubobject(Subobject subobject); } diff --git a/pcep/topology-api/src/main/yang/network-topology-pcep.yang b/pcep/topology-api/src/main/yang/network-topology-pcep.yang index b3bf6e391c..6e59ab4797 100644 --- a/pcep/topology-api/src/main/yang/network-topology-pcep.yang +++ b/pcep/topology-api/src/main/yang/network-topology-pcep.yang @@ -87,7 +87,7 @@ module network-topology-pcep { type pcc-sync-state; } - list reported-lsps { + list reported-lsp { leaf name { type stateful:symbolic-path-name; } diff --git a/pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java b/pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java index 4d5c9be45f..1f75f5eac1 100644 --- a/pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java +++ b/pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java @@ -69,8 +69,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.UpdateLspArgs; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.PathComputationClient; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.PathComputationClientBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsps; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLspsKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsp; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLspKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.StatefulTlvBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.topology.pcep.type.TopologyPcepBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; @@ -166,7 +166,7 @@ final class ServerSessionManager implements SessionListenerFactoryemptyList()); + this.pccBuilder.setReportedLsp(Collections.emptyList()); this.pccBuilder.setStatefulTlv(new StatefulTlvBuilder(tlvs).build()); this.pccBuilder.setStateSync(PccSyncState.InitialResync); } @@ -247,9 +247,9 @@ final class ServerSessionManager implements SessionListenerFactory lspIdentifier(final SymbolicPathName name) { - return InstanceIdentifier.builder(this.topologyAugment).child(PathComputationClient.class).child(ReportedLsps.class, - new ReportedLspsKey(name.getPathName())).toInstance(); + private InstanceIdentifier lspIdentifier(final SymbolicPathName name) { + return InstanceIdentifier.builder(this.topologyAugment).child(PathComputationClient.class).child(ReportedLsp.class, + new ReportedLspKey(name.getPathName())).toInstance(); } @Override @@ -443,8 +443,8 @@ final class ServerSessionManager implements SessionListenerFactory lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( - ReportedLsps.class, new ReportedLspsKey(input.getName())).toInstance(); + final InstanceIdentifier lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( + ReportedLsp.class, new ReportedLspKey(input.getName())).toInstance(); if (this.dataProvider.readOperationalData(lsp) != null) { LOG.debug("Node {} already contains lsp {} at {}", input.getNode(), input.getName(), lsp); return Futures.immediateFuture(OPERATION_UNSENT); @@ -486,9 +486,9 @@ final class ServerSessionManager implements SessionListenerFactory lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( - ReportedLsps.class, new ReportedLspsKey(input.getName())).toInstance(); - final ReportedLsps rep = (ReportedLsps) this.dataProvider.readOperationalData(lsp); + final InstanceIdentifier lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( + ReportedLsp.class, new ReportedLspKey(input.getName())).toInstance(); + final ReportedLsp rep = (ReportedLsp) this.dataProvider.readOperationalData(lsp); if (rep == null) { LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName()); return Futures.immediateFuture(OPERATION_UNSENT); @@ -513,9 +513,9 @@ final class ServerSessionManager implements SessionListenerFactory lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( - ReportedLsps.class, new ReportedLspsKey(input.getName())).toInstance(); - final ReportedLsps rep = (ReportedLsps) this.dataProvider.readOperationalData(lsp); + final InstanceIdentifier lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( + ReportedLsp.class, new ReportedLspKey(input.getName())).toInstance(); + final ReportedLsp rep = (ReportedLsp) this.dataProvider.readOperationalData(lsp); if (rep == null) { LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName()); return Futures.immediateFuture(OPERATION_UNSENT); @@ -542,10 +542,10 @@ final class ServerSessionManager implements SessionListenerFactory lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( - ReportedLsps.class, new ReportedLspsKey(input.getName())).toInstance(); + final InstanceIdentifier lsp = InstanceIdentifier.builder(l.topologyAugment).child(PathComputationClient.class).child( + ReportedLsp.class, new ReportedLspKey(input.getName())).toInstance(); LOG.debug("Checking if LSP {} has operational state {}", lsp, input.getArguments().getOperational()); - final ReportedLsps rep = (ReportedLsps) this.dataProvider.readOperationalData(lsp); + final ReportedLsp rep = (ReportedLsp) this.dataProvider.readOperationalData(lsp); if (rep == null) { LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName()); return Futures.immediateFuture(OPERATION_UNSENT); diff --git a/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java b/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java index b70cf98877..950d5178d0 100644 --- a/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java +++ b/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java @@ -25,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.address.family.ipv6._case.Ipv6; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.Node1; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.PathComputationClient; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsps; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsp; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.AdministrativeStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.Link1; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.Link1Builder; @@ -78,9 +78,9 @@ public final class NodeChangedListener implements DataChangeListener { this.target = Preconditions.checkNotNull(target); } - private static void categorizeIdentifier(final InstanceIdentifier i, final Set> changedLsps, + private static void categorizeIdentifier(final InstanceIdentifier i, final Set> changedLsps, final Set> changedNodes) { - final InstanceIdentifier li = i.firstIdentifierOf(ReportedLsps.class); + final InstanceIdentifier li = i.firstIdentifierOf(ReportedLsp.class); if (li == null) { final InstanceIdentifier ni = i.firstIdentifierOf(Node.class); if (ni == null) { @@ -93,7 +93,7 @@ public final class NodeChangedListener implements DataChangeListener { } } - private static void enumerateLsps(final InstanceIdentifier id, final Node node, final Set> lsps) { + private static void enumerateLsps(final InstanceIdentifier id, final Node node, final Set> lsps) { if (node == null) { LOG.trace("Skipping null node", id); return; @@ -104,13 +104,13 @@ public final class NodeChangedListener implements DataChangeListener { return; } - for (final ReportedLsps l : pccnode.getPathComputationClient().getReportedLsps()) { - lsps.add(InstanceIdentifier.builder(id).augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsps.class, + for (final ReportedLsp l : pccnode.getPathComputationClient().getReportedLsp()) { + lsps.add(InstanceIdentifier.builder(id).augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsp.class, l.getKey()).toInstance()); } } - private static LinkId linkIdForLsp(final InstanceIdentifier i, final ReportedLsps lsp) { + private static LinkId linkIdForLsp(final InstanceIdentifier i, final ReportedLsp lsp) { return new LinkId(i.firstKeyOf(Node.class, NodeKey.class).getNodeId().getValue() + "/lsps/" + lsp.getName()); } @@ -201,7 +201,7 @@ public final class NodeChangedListener implements DataChangeListener { return InstanceIdentifier.builder(this.target).child(Node.class, nb.getKey()).child(TerminationPoint.class, tpb.getKey()).toInstance(); } - private void create(final DataModificationTransaction trans, final InstanceIdentifier i, final ReportedLsps value) { + private void create(final DataModificationTransaction trans, final InstanceIdentifier i, final ReportedLsp value) { final InstanceIdentifier ni = i.firstIdentifierOf(Node.class); final AddressFamily af = value.getLsp().getTlvs().getLspIdentifiers().getAddressFamily(); @@ -253,7 +253,7 @@ public final class NodeChangedListener implements DataChangeListener { return InstanceIdentifier.builder(this.target).child(Node.class, new NodeKey(node)).toInstance(); } - private void remove(final DataModificationTransaction trans, final InstanceIdentifier i, final ReportedLsps value) { + private void remove(final DataModificationTransaction trans, final InstanceIdentifier i, final ReportedLsp value) { final InstanceIdentifier li = linkForLsp(linkIdForLsp(i, value)); final Link l = (Link) trans.readOperationalData(li); @@ -353,7 +353,7 @@ public final class NodeChangedListener implements DataChangeListener { public void onDataChanged(final DataChangeEvent, DataObject> change) { final DataModificationTransaction trans = this.dataProvider.beginTransaction(); - final Set> lsps = new HashSet<>(); + final Set> lsps = new HashSet<>(); final Set> nodes = new HashSet<>(); // Categorize reported identifiers @@ -378,9 +378,9 @@ public final class NodeChangedListener implements DataChangeListener { } // We now have list of all affected LSPs. Walk them create/remove them - for (final InstanceIdentifier i : lsps) { - final ReportedLsps oldValue = (ReportedLsps) o.get(i); - final ReportedLsps newValue = (ReportedLsps) n.get(i); + for (final InstanceIdentifier i : lsps) { + final ReportedLsp oldValue = (ReportedLsp) o.get(i); + final ReportedLsp newValue = (ReportedLsp) n.get(i); LOG.debug("Updating lsp {} value {} -> {}", i, oldValue, newValue); if (oldValue != null) { diff --git a/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgramming.java b/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgramming.java index c73990b293..77780dd46e 100644 --- a/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgramming.java +++ b/pcep/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgramming.java @@ -28,8 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.endpoints.object.EndpointsObjBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.EroBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobjects; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.SubobjectBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lspa.object.LspaBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.AddLspInputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.AddLspOutput; @@ -188,12 +188,12 @@ public final class TunnelProgramming implements TopologyTunnelPcepProgrammingSer final EroBuilder b = new EroBuilder(); if (!explicitHops.isEmpty()) { - final List subobjs = new ArrayList<>(explicitHops.size()); + final List subobjs = new ArrayList<>(explicitHops.size()); for (final ExplicitHops h : explicitHops) { final ExplicitHops1 h1 = h.getAugmentation(ExplicitHops1.class); if (h1 != null) { - final SubobjectsBuilder sb = new SubobjectsBuilder(); + final SubobjectBuilder sb = new SubobjectBuilder(); sb.fieldsFrom(h1); sb.setLoose(h.isLoose()); subobjs.add(sb.build()); @@ -201,7 +201,7 @@ public final class TunnelProgramming implements TopologyTunnelPcepProgrammingSer LOG.debug("Ignoring unhandled explicit hop {}", h); } } - b.setSubobjects(subobjs); + b.setSubobject(subobjs); } return b.build(); } -- 2.36.6