Provide Add Path support for all AFI/SAFI
[bgpcep.git] / bgp / evpn / src / main / java / org / opendaylight / protocol / bgp / evpn / impl / EvpnRibSupport.java
index 54d051513fc43ffd21b683805046d29f32502466..16ae7383c19fdf3e24571619a6178bc91ed81768 100644 (file)
@@ -37,7 +37,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -54,14 +54,13 @@ import org.slf4j.LoggerFactory;
 
 final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoute, EvpnRouteKey> {
     private static final EvpnRibSupport SINGLETON = new EvpnRibSupport();
-    private static final String ROUTE_KEY = "route-key";
     private static final Logger LOG = LoggerFactory.getLogger(EvpnRibSupport.class);
     private static final QName ROUTE_KEY_QNAME = QName.create(EvpnRoute.QNAME, ROUTE_KEY).intern();
     private static final NodeIdentifier NLRI_ROUTES_LIST = NodeIdentifier.create(EvpnDestination.QNAME);
 
     private EvpnRibSupport() {
         super(EvpnRoutesCase.class, EvpnRoutes.class, EvpnRoute.class, L2vpnAddressFamily.class,
-                EvpnSubsequentAddressFamily.class, ROUTE_KEY, DestinationEvpn.QNAME);
+                EvpnSubsequentAddressFamily.class, DestinationEvpn.QNAME);
     }
 
     static EvpnRibSupport getInstance() {
@@ -134,7 +133,7 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoute, EvpnRouteKey> {
     }
 
     @Override
-    public EvpnRoute createRoute(final EvpnRoute route, final EvpnRouteKey routeKey, final long pathId,
+    public EvpnRoute createRoute(final EvpnRoute route, final String routeKey, final long pathId,
             final Attributes attributes) {
         final EvpnRouteBuilder builder;
         if (route != null) {
@@ -142,8 +141,7 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoute, EvpnRouteKey> {
         } else {
             builder = new EvpnRouteBuilder();
         }
-        return builder.setRouteKey(routeKey.getRouteKey())
-                .setPathId(new PathId(pathId)).setAttributes(attributes).build();
+        return builder.setKey(new EvpnRouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
     }
 
     @Override
@@ -152,7 +150,7 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoute, EvpnRouteKey> {
     }
 
     @Override
-    public EvpnRouteKey createNewRouteKey(final long pathId, final EvpnRouteKey routeKey) {
-        return new EvpnRouteKey(new PathId(pathId), routeKey.getRouteKey());
+    public EvpnRouteKey createRouteListKey(final long pathId, final String routeKey) {
+        return new EvpnRouteKey(new PathId(pathId), routeKey);
     }
 }