BUG-50 : adjusted LSPA object. 94/2494/1
authorDana Kutenicsova <dkutenic@cisco.com>
Thu, 7 Nov 2013 12:48:09 +0000 (13:48 +0100)
committerDana Kutenicsova <dkutenic@cisco.com>
Thu, 7 Nov 2013 12:48:09 +0000 (13:48 +0100)
Change-Id: I8309a0849bd51f1a79015e1b2df84d9d2b8b5e2d
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
pcep/api/src/main/yang/pcep-types.yang
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPLspaObjectParser.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java

index 966a937bb70674f3c33bb41faf225bf67c492243..af518a72f439f41247334580f653a30e7ee32324 100644 (file)
@@ -651,24 +651,26 @@ module pcep-types {
                description "LSPA Object";
                reference "https://tools.ietf.org/html/rfc5440#section-7.11";
 
-               uses object;
-
-               leaf hold-priority {
-                       type uint8;
-                       mandatory true;
-               }
-
-               leaf setup-priority {
-                       type uint8;
-                       mandatory true;
-               }
-
-               leaf local-protection-desired {
-                       type boolean;
-                       default false;
+               container lspa {
+                       uses object;
+       
+                       leaf hold-priority {
+                               type uint8;
+                               mandatory true;
+                       }
+       
+                       leaf setup-priority {
+                               type uint8;
+                               mandatory true;
+                       }
+       
+                       leaf local-protection-desired {
+                               type boolean;
+                               default false;
+                       }
+       
+                       uses rsvp:attribute-filters;
                }
-
-               uses rsvp:attribute-filters;
        }
 
        grouping svec-object {
@@ -987,9 +989,7 @@ module pcep-types {
        }
 
        grouping lsp-attributes {
-               container lspa {
-                       uses lspa-object;
-               }
+               uses lspa-object;
 
                container bandwidth {
                        uses bandwidth-object;
index 360602607e6099d84dca23b646f3762c29caebe2..efdd58e5a1ab71a375e1f420f2d83a0975b9bc8d 100644 (file)
@@ -87,7 +87,6 @@ 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.IncludeRouteObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.KeepaliveMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LoadBalancingObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspaObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.MetricObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfObject;
@@ -110,6 +109,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.lsp.error.code.tlv.LspErrorCode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.identifiers.tlv.LspIdentifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.object.Lsp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lspa.object.Lspa;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.notification.object.CNotification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.of.list.tlv.OfList;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
@@ -283,7 +283,7 @@ public final class Activator implements PCEPExtensionProviderActivator {
                context.registerObjectSerializer(MetricObject.class, new PCEPMetricObjectParser(tlvReg));
                context.registerObjectSerializer(Ero.class, new PCEPExplicitRouteObjectParser(eroSubReg));
                context.registerObjectSerializer(ReportedRouteObject.class, new PCEPReportedRouteObjectParser(rroSubReg));
-               context.registerObjectSerializer(LspaObject.class, new PCEPLspaObjectParser(tlvReg));
+               context.registerObjectSerializer(Lspa.class, new PCEPLspaObjectParser(tlvReg));
                context.registerObjectSerializer(IncludeRouteObject.class, new PCEPIncludeRouteObjectParser(eroSubReg));
                context.registerObjectSerializer(SvecObject.class, new PCEPSvecObjectParser(tlvReg));
                context.registerObjectSerializer(CNotification.class, new PCEPNotificationObjectParser(tlvReg));
index 535ebb7d517e6bf5eece8f0666628058ad9d1052..56c20b5d3b3ca419a34c08aaa3e037aac680784d 100644 (file)
@@ -13,17 +13,17 @@ import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.PCEPDocumentedException;
 import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
 import org.opendaylight.protocol.util.ByteArray;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspaObject;
 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.Tlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.LspaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lspa.object.Lspa;
+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.rsvp.rev130820.AttributeFilter;
 
 import com.google.common.primitives.UnsignedBytes;
 
 /**
- * Parser for {@link LspaObject}
+ * Parser for {@link Lspa}
  */
 public class PCEPLspaObjectParser extends AbstractObjectWithTlvsParser<LspaBuilder> {
 
@@ -62,7 +62,7 @@ public class PCEPLspaObjectParser extends AbstractObjectWithTlvsParser<LspaBuild
        }
 
        @Override
-       public LspaObject parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+       public Lspa parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
                if (bytes == null) {
                        throw new IllegalArgumentException("Bytes array is mandatory.");
                }
@@ -90,10 +90,10 @@ public class PCEPLspaObjectParser extends AbstractObjectWithTlvsParser<LspaBuild
 
        @Override
        public byte[] serializeObject(final Object object) {
-               if (!(object instanceof LspaObject)) {
+               if (!(object instanceof Lspa)) {
                        throw new IllegalArgumentException("Wrong instance of PCEPObject. Passed " + object.getClass() + ". Needed LspaObject.");
                }
-               final LspaObject lspaObj = (LspaObject) object;
+               final Lspa lspaObj = (Lspa) object;
 
                final byte[] retBytes = new byte[TLVS_F_OFFSET];
 
index b260068ea0797357126232da76b9ebf3fc823d1c..e3fbf0a50eb71a9c9fe4e6e58024c4365f202b77 100644 (file)
@@ -68,13 +68,13 @@ 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.lsp.attributes.ClassTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.IncludeRouteBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.LspaBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.OfBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.db.version.tlv.LspDbVersion;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.db.version.tlv.LspDbVersionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.error.code.tlv.LspErrorCode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.error.code.tlv.LspErrorCodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.object.LspBuilder;
+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.pcep.types.rev131005.notification.object.CNotificationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.OpenBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.order.tlv.OrderBuilder;