BUG-2383: Added wiring of Attributes codecs to RibSupportContext
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / IPv6RIBSupport.java
index 06eafcb2e4f3566c2bebea6d5a4593443a4afebf..1a5a575c47e49ab4695165123e0abc1dced1afd0 100644 (file)
@@ -9,9 +9,11 @@ package org.opendaylight.protocol.bgp.rib.impl;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.bgp.rib.rib.loc.rib.tables.routes.Ipv6RoutesCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.prefixes.DestinationIpv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.prefixes.destination.ipv6.Ipv6Prefixes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.Ipv6Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv6.routes.ipv6.routes.Ipv6Route;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.tables.Routes;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
@@ -21,6 +23,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
  * Class supporting IPv6 unicast RIBs.
  */
 final class IPv6RIBSupport extends AbstractIPRIBSupport {
+    private final static QName PREFIX_QNAME = QName.cachedReference(QName.create(Ipv6Route.QNAME, "prefix"));
     private static final IPv6RIBSupport SINGLETON = new IPv6RIBSupport();
     private final ChoiceNode emptyRoutes = Builders.choiceBuilder()
             .withNodeIdentifier(new NodeIdentifier(Routes.QNAME))
@@ -29,6 +32,8 @@ final class IPv6RIBSupport extends AbstractIPRIBSupport {
                 .withChild(ImmutableNodes.mapNodeBuilder(Ipv6Route.QNAME).build()).build()).build();
     private final NodeIdentifier destination = new NodeIdentifier(DestinationIpv6.QNAME);
     private final NodeIdentifier route = new NodeIdentifier(Ipv6Route.QNAME);
+    private final NodeIdentifier nlriRoutesList = new NodeIdentifier(Ipv6Prefixes.QNAME);
+    private final NodeIdentifier routeKeyKeaf = new NodeIdentifier(PREFIX_QNAME);
 
     private IPv6RIBSupport() {
         super(Ipv6RoutesCase.class, Ipv6Routes.class, Ipv6Route.class);
@@ -52,4 +57,24 @@ final class IPv6RIBSupport extends AbstractIPRIBSupport {
     protected NodeIdentifier routeIdentifier() {
         return this.route;
     }
+
+    @Override
+    protected NodeIdentifier routeKeyLeafIdentifier() {
+        return routeKeyKeaf;
+    }
+
+    @Override
+    protected NodeIdentifier nlriRoutesListIdentifier() {
+        return this.nlriRoutesList;
+    }
+
+    @Override
+    protected QName keyLeafQName() {
+        return PREFIX_QNAME;
+    }
+
+    @Override
+    protected QName routeQName() {
+        return Ipv6Route.QNAME;
+    }
 }