BGPCEP-574: Remove unnesary methods 47/69347/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sun, 11 Mar 2018 12:28:18 +0000 (13:28 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sun, 11 Mar 2018 12:29:01 +0000 (13:29 +0100)
- remove extract key
- remove extract changed routes

Change-Id: I6bc6e83be77edcc8312dde8509ebd18051d888ee
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
22 files changed:
bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecRIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnRIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv4/FlowspecL3vpnIpv4RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv6/FlowspecL3vpnIpv6RIBSupport.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/AbstractIPRibSupport.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupport.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupport.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/AbstractVpnRIBSupport.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupport.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupport.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/AbstractLabeledUnicastRIBSupport.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupport.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupport.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/LinkstateRIBSupport.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/MultiPathAbstractRIBSupport.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RIBSupport.java
bgp/rib-spi/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/bgp/inet/rev150305/ipv4/routes/ipv4/routes/MultiPathAbstractTest.java

index f401bf22dbee77b418af8a6b19e5d28e85e8d660..f6aaa0b3ad907d07c75a1557cd1a55c7b2dd3f5e 100644 (file)
@@ -48,8 +48,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class EvpnRibSupport extends AbstractRIBSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-        .bgp.evpn.rev171213.bgp.rib.rib.peer.adj.rib.in.tables.routes.EvpnRoutesCase, EvpnRoute, EvpnRouteKey> {
+final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoute, EvpnRouteKey> {
     private static final EvpnRibSupport SINGLETON = new EvpnRibSupport();
     private static final Logger LOG = LoggerFactory.getLogger(EvpnRibSupport.class);
     private static final QName ROUTE_KEY_QNAME = QName.create(EvpnRoute.QNAME, ROUTE_KEY).intern();
@@ -126,11 +125,6 @@ final class EvpnRibSupport extends AbstractRIBSupport<org.opendaylight.yang.gen.
         return new NodeIdentifierWithPredicates(routeQName(), ROUTE_KEY_QNAME, ByteArray.encodeBase64(buffer));
     }
 
-    @Override
-    public EvpnRouteKey extractRouteKey(final EvpnRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public EvpnRoute createRoute(final EvpnRoute route, final EvpnRouteKey routeKey, final PathId pathId,
             final Attributes attributes) {
@@ -142,14 +136,4 @@ final class EvpnRibSupport extends AbstractRIBSupport<org.opendaylight.yang.gen.
         }
         return builder.setRouteKey(routeKey.getRouteKey()).setAttributes(attributes).build();
     }
-
-    @Override
-    public Collection<EvpnRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.bgp.evpn.rev171213.bgp.rib.rib.peer.adj.rib.in.tables.routes.EvpnRoutesCase routes) {
-        final EvpnRoutes routeCont = routes.getEvpnRoutes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getEvpnRoute();
-    }
 }
index 14c7e74329b78173676d9cb29231510aac9ec8ee..b8b494f234d20c69e926a2e3167685953fa99de1 100644 (file)
@@ -35,8 +35,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
 public abstract class AbstractFlowspecRIBSupport<T extends AbstractFlowspecNlriParser,
-        C extends Routes, R extends Route, S extends Identifier>
-        extends MultiPathAbstractRIBSupport<C, R, S> {
+        R extends Route, S extends Identifier>
+        extends MultiPathAbstractRIBSupport<R, S> {
     protected final T nlriParser;
 
     protected AbstractFlowspecRIBSupport(
index 5e6d3cec06e971c6f73fa63568ecd62e71e3e192..4ba2fefca8f3f4fb25335e3d1c27db795262ee45 100644 (file)
@@ -22,8 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily;
 
 public final class FlowspecIpv4RIBSupport extends AbstractFlowspecRIBSupport<SimpleFlowspecIpv4NlriParser,
-        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer
-                .adj.rib.in.tables.routes.FlowspecRoutesCase, FlowspecRoute, FlowspecRouteKey> {
+        FlowspecRoute, FlowspecRouteKey> {
 
     public FlowspecIpv4RIBSupport(SimpleFlowspecExtensionProviderContext context) {
         super(
@@ -43,11 +42,6 @@ public final class FlowspecIpv4RIBSupport extends AbstractFlowspecRIBSupport<Sim
         return new FlowspecIpv4RIBSupport(context);
     }
 
-    @Override
-    public FlowspecRouteKey extractRouteKey(final FlowspecRoute route) {
-        return route.getKey();
-    }
-
     @Nonnull
     @Override
     public FlowspecRoute createRoute(
@@ -64,16 +58,6 @@ public final class FlowspecIpv4RIBSupport extends AbstractFlowspecRIBSupport<Sim
         return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
     }
 
-    @Override
-    public Collection<FlowspecRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.FlowspecRoutesCase routes) {
-        final FlowspecRoutes routesCont = routes.getFlowspecRoutes();
-        if (routesCont == null) {
-            return Collections.emptyList();
-        }
-        return routesCont.getFlowspecRoute();
-    }
-
     @Override
     public FlowspecRouteKey createNewRouteKey(final PathId pathId, final FlowspecRouteKey routeKey) {
         return new FlowspecRouteKey(pathId, routeKey.getRouteKey());
index 16e1c64d5e6b0f1b0d6a22fabc0849ee61ca06d4..2c3d6896a3605e49d877df7d405c17a7ed9a6f78 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.flowspec;
 
-import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.FlowspecSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.loc.rib.tables.routes.FlowspecIpv6RoutesCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.ipv6.DestinationFlowspec;
@@ -21,8 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily;
 
 public final class FlowspecIpv6RIBSupport extends AbstractFlowspecRIBSupport<SimpleFlowspecIpv6NlriParser,
-        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj
-                .rib.in.tables.routes.FlowspecIpv6RoutesCase, FlowspecRoute, FlowspecRouteKey> {
+        FlowspecRoute, FlowspecRouteKey> {
 
     public FlowspecIpv6RIBSupport(SimpleFlowspecExtensionProviderContext context) {
         super(
@@ -42,11 +39,6 @@ public final class FlowspecIpv6RIBSupport extends AbstractFlowspecRIBSupport<Sim
         return new FlowspecIpv6RIBSupport(context);
     }
 
-    @Override
-    public FlowspecRouteKey extractRouteKey(final FlowspecRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public FlowspecRoute createRoute(final FlowspecRoute route, final FlowspecRouteKey routeKey,
             final PathId pathId, final Attributes attributes) {
@@ -59,16 +51,6 @@ public final class FlowspecIpv6RIBSupport extends AbstractFlowspecRIBSupport<Sim
         return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
     }
 
-    @Override
-    public Collection<FlowspecRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.FlowspecIpv6RoutesCase routes) {
-        final FlowspecIpv6Routes routesCont = routes.getFlowspecIpv6Routes();
-        if (routesCont == null) {
-            return Collections.emptyList();
-        }
-        return routesCont.getFlowspecRoute();
-    }
-
     @Override
     public FlowspecRouteKey createNewRouteKey(final PathId pathId, final FlowspecRouteKey routeKey) {
         return new FlowspecRouteKey(pathId, routeKey.getRouteKey());
index 441b3cec452c311b6f0f8bba0a9596855cd20f23..a3c80e81a4ea09c7c6e467a4cbb8b9106253c907 100644 (file)
@@ -29,8 +29,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
 public abstract class AbstractFlowspecL3vpnRIBSupport
-        <T extends AbstractFlowspecL3vpnNlriParser, C extends Routes, R extends Route, S extends Identifier>
-        extends AbstractFlowspecRIBSupport<T, C, R, S> {
+        <T extends AbstractFlowspecL3vpnNlriParser, R extends Route, S extends Identifier>
+        extends AbstractFlowspecRIBSupport<T, R, S> {
     private final NodeIdentifier routeDistinguisherNID;
 
     protected AbstractFlowspecL3vpnRIBSupport(
index 1651e9595e6c9cb022a7f602b76fae7076cdd8f5..51fe882f93e11d8eaa6a4f2594459c67c9b9601b 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4;
 
-import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext;
 import org.opendaylight.protocol.bgp.flowspec.l3vpn.AbstractFlowspecL3vpnRIBSupport;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.loc.rib.tables.routes.FlowspecL3vpnIpv4RoutesCase;
@@ -22,8 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily;
 
 public final class FlowspecL3vpnIpv4RIBSupport extends AbstractFlowspecL3vpnRIBSupport<FlowspecL3vpnIpv4NlriParser,
-        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj
-                .rib.in.tables.routes.FlowspecL3vpnIpv4RoutesCase, FlowspecL3vpnRoute, FlowspecL3vpnRouteKey> {
+        FlowspecL3vpnRoute, FlowspecL3vpnRouteKey> {
 
     public FlowspecL3vpnIpv4RIBSupport(final SimpleFlowspecExtensionProviderContext context) {
         super(
@@ -47,11 +44,6 @@ public final class FlowspecL3vpnIpv4RIBSupport extends AbstractFlowspecL3vpnRIBS
         return new FlowspecL3vpnRouteKey(pathId, routeKey.getRouteKey());
     }
 
-    @Override
-    public FlowspecL3vpnRouteKey extractRouteKey(final FlowspecL3vpnRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public FlowspecL3vpnRoute createRoute(
             final FlowspecL3vpnRoute route,
@@ -66,14 +58,4 @@ public final class FlowspecL3vpnIpv4RIBSupport extends AbstractFlowspecL3vpnRIBS
         }
         return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
     }
-
-    @Override
-    public Collection<FlowspecL3vpnRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-            .ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.FlowspecL3vpnIpv4RoutesCase routes) {
-        final FlowspecL3vpnIpv4Routes routeCont = routes.getFlowspecL3vpnIpv4Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getFlowspecL3vpnRoute();
-    }
 }
index 794f67517e03b4c2c3d09b4d33e12d97eea294b9..b246759eeba778c2beea48ae7321e4fa2901958a 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv6;
 
-import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext;
 import org.opendaylight.protocol.bgp.flowspec.l3vpn.AbstractFlowspecL3vpnRIBSupport;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.loc.rib.tables.routes.FlowspecL3vpnIpv6RoutesCase;
@@ -21,10 +19,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 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.types.rev130919.Ipv6AddressFamily;
 
-public final class FlowspecL3vpnIpv6RIBSupport
-        extends AbstractFlowspecL3vpnRIBSupport<FlowspecL3vpnIpv6NlriParser,
-        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj
-                .rib.in.tables.routes.FlowspecL3vpnIpv6RoutesCase, FlowspecL3vpnRoute, FlowspecL3vpnRouteKey> {
+public final class FlowspecL3vpnIpv6RIBSupport extends AbstractFlowspecL3vpnRIBSupport<FlowspecL3vpnIpv6NlriParser,
+        FlowspecL3vpnRoute, FlowspecL3vpnRouteKey> {
     private FlowspecL3vpnIpv6RIBSupport(SimpleFlowspecExtensionProviderContext context) {
         super(
                 FlowspecL3vpnIpv6RoutesCase.class,
@@ -47,11 +43,6 @@ public final class FlowspecL3vpnIpv6RIBSupport
         return new FlowspecL3vpnRouteKey(pathId, routeKey.getRouteKey());
     }
 
-    @Override
-    public FlowspecL3vpnRouteKey extractRouteKey(final FlowspecL3vpnRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public FlowspecL3vpnRoute createRoute(
             final FlowspecL3vpnRoute route,
@@ -66,14 +57,4 @@ public final class FlowspecL3vpnIpv6RIBSupport
         }
         return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
     }
-
-    @Override
-    public Collection<FlowspecL3vpnRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-            .ns.yang.bgp.flowspec.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.FlowspecL3vpnIpv6RoutesCase routes) {
-        final FlowspecL3vpnIpv6Routes routeCont = routes.getFlowspecL3vpnIpv6Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getFlowspecL3vpnRoute();
-    }
 }
index 45e212ce4dac960fefb807bf4241a6bf38616b5b..af48af6717d035b63b485732459fd82c06e728f5 100644 (file)
@@ -36,8 +36,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Common {@link org.opendaylight.protocol.bgp.rib.spi.RIBSupport} class for IPv4 and IPv6 addresses.
  */
-abstract class AbstractIPRibSupport<C extends Routes, R extends Route, N extends Identifier>
-        extends MultiPathAbstractRIBSupport<C, R,N> {
+abstract class AbstractIPRibSupport<R extends Route, N extends Identifier> extends MultiPathAbstractRIBSupport<R,N> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractIPRibSupport.class);
     private final NodeIdentifier prefixNid;
     private final NodeIdentifier nlriRoutesList;
index 592f6ed102a5864bb9cbe0df1fe1aa4fd6192a52..eb010764e2259b87ffcffd099d0a604304276e28 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.inet;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import javax.annotation.Nonnull;
 import org.opendaylight.protocol.bgp.parser.spi.PathIdUtil;
@@ -35,9 +34,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
 /**
  * Class supporting IPv4 unicast RIBs.
  */
-final class IPv4RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-        .yang.bgp.inet.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.Ipv4RoutesCase,
-        Ipv4Route, Ipv4RouteKey> {
+final class IPv4RIBSupport extends AbstractIPRibSupport<Ipv4Route, Ipv4RouteKey> {
 
     private static final IPv4RIBSupport SINGLETON = new IPv4RIBSupport();
 
@@ -77,11 +74,6 @@ final class IPv4RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.ge
                         .build()).build();
     }
 
-    @Override
-    public Ipv4RouteKey extractRouteKey(final Ipv4Route route) {
-        return route.getKey();
-    }
-
     @Override
     public Ipv4Route createRoute(final Ipv4Route route, final Ipv4RouteKey routeKey, final PathId pathId,
             final Attributes attributes) {
@@ -94,16 +86,6 @@ final class IPv4RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.ge
         return builder.setPrefix(routeKey.getPrefix()).setPathId(pathId).setAttributes(attributes).build();
     }
 
-    @Override
-    public Collection<Ipv4Route> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .bgp.inet.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.Ipv4RoutesCase routes) {
-        final Ipv4Routes routeCont = routes.getIpv4Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getIpv4Route();
-    }
-
     @Override
     public Ipv4RouteKey createNewRouteKey(final PathId pathId, final Ipv4RouteKey routeKey) {
         return new Ipv4RouteKey(pathId, routeKey.getPrefix());
index 56eb5ee73e809a108c25452518f4de5ccd2aaf96..d65bf421942c34b6797d81b99a7873115d34991c 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.inet;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import org.opendaylight.protocol.bgp.parser.spi.PathIdUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
@@ -33,8 +32,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
 /**
  * Class supporting IPv6 unicast RIBs.
  */
-final class IPv6RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-        .yang.bgp.inet.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.Ipv6RoutesCase, Ipv6Route, Ipv6RouteKey> {
+final class IPv6RIBSupport extends AbstractIPRibSupport<Ipv6Route, Ipv6RouteKey> {
 
     private static final IPv6RIBSupport SINGLETON = new IPv6RIBSupport();
 
@@ -72,11 +70,6 @@ final class IPv6RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.ge
         return prefs;
     }
 
-    @Override
-    public Ipv6RouteKey extractRouteKey(final Ipv6Route route) {
-        return route.getKey();
-    }
-
     @Override
     public Ipv6Route createRoute(final Ipv6Route route, final Ipv6RouteKey routeKey, final PathId pathId,
             final Attributes attributes) {
@@ -89,16 +82,6 @@ final class IPv6RIBSupport extends AbstractIPRibSupport<org.opendaylight.yang.ge
         return builder.setPrefix(routeKey.getPrefix()).setPathId(pathId).setAttributes(attributes).build();
     }
 
-    @Override
-    public Collection<Ipv6Route> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .bgp.inet.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.Ipv6RoutesCase routes) {
-        final Ipv6Routes routeCont = routes.getIpv6Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getIpv6Route();
-    }
-
     @Override
     public Ipv6RouteKey createNewRouteKey(final PathId pathId, final Ipv6RouteKey routeKey) {
         return new Ipv6RouteKey(pathId, routeKey.getPrefix());
index f1e0aa464a8c36da0d27e19f280d18c10dd32e44..c5f37495dee7c744c355c064599b2f55a83fc8cd 100644 (file)
@@ -55,7 +55,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractVpnRIBSupport<C extends Routes> extends AbstractRIBSupport<C, VpnRoute, VpnRouteKey> {
+public abstract class AbstractVpnRIBSupport extends AbstractRIBSupport<VpnRoute, VpnRouteKey> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractVpnRIBSupport.class);
     private final NodeIdentifier nlriRoutesListNid;
     private final NodeIdentifier prefixTypeNid;
@@ -192,12 +192,6 @@ public abstract class AbstractVpnRIBSupport<C extends Routes> extends AbstractRI
         return new NodeIdentifierWithPredicates(routeQName(), this.routeKey, ByteArray.encodeBase64(buffer));
     }
 
-
-    @Override
-    public final VpnRouteKey extractRouteKey(final VpnRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public final VpnRoute createRoute(
             final VpnRoute route,
index a5cb5c9f440813d5c7e5d016d61ecb2106baaa35..bcee4558f5c784a3ce9e86de603fe7c6fb4dec6c 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.l3vpn.ipv4;
 
-import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import org.opendaylight.protocol.bgp.l3vpn.AbstractVpnRIBSupport;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
@@ -24,8 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 
-final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-        .ns.yang.bgp.vpn.ipv4.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.VpnIpv4RoutesCase> {
+final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport {
     /**
      * Default constructor. Requires the QName of the container augmented under the routes choice
      * node in instantiations of the rib grouping. It is assumed that this container is defined by
@@ -60,14 +57,4 @@ final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport<org.opendaylight.yan
                 .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
                 .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(dests).build()).build();
     }
-
-    @Override
-    public Collection<VpnRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .bgp.vpn.ipv4.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.VpnIpv4RoutesCase routes) {
-        final VpnIpv4Routes routeCont =  routes.getVpnIpv4Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getVpnRoute();
-    }
 }
index b2fafce3c22c44d12604f5d5e12d921dbf451d63..38b69e4da804dd6ba1100952762844fe2c132321 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.l3vpn.ipv6;
 
-import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import org.opendaylight.protocol.bgp.l3vpn.AbstractVpnRIBSupport;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
@@ -24,8 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 
-final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-        .ns.yang.bgp.vpn.ipv6.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.VpnIpv6RoutesCase> {
+final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport {
 
     /**
      * Default constructor. Requires the QName of the container augmented under the routes choice
@@ -61,14 +58,4 @@ final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport<org.opendaylight.yan
                 .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
                 .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(dests).build()).build();
     }
-
-    @Override
-    public Collection<VpnRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .bgp.vpn.ipv6.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.VpnIpv6RoutesCase routes) {
-        final VpnIpv6Routes routeCont =  routes.getVpnIpv6Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getVpnRoute();
-    }
 }
index a242ca6ebc73ac0fc4690eac9aef68dd41064763..b9a5928649da0bec6798582ebbfc52ff01cfbf0c 100644 (file)
@@ -52,8 +52,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-abstract class AbstractLabeledUnicastRIBSupport<C extends Routes>
-        extends MultiPathAbstractRIBSupport<C, LabeledUnicastRoute, LabeledUnicastRouteKey> {
+abstract class AbstractLabeledUnicastRIBSupport
+        extends MultiPathAbstractRIBSupport<LabeledUnicastRoute, LabeledUnicastRouteKey> {
     private static final NodeIdentifier PREFIX_TYPE_NID = NodeIdentifier.create(QName.create(CLabeledUnicastDestination.QNAME, "prefix").intern());
     private static final NodeIdentifier LABEL_STACK_NID = NodeIdentifier.create(QName.create(CLabeledUnicastDestination.QNAME, "label-stack").intern());
     private static final NodeIdentifier LV_NID = NodeIdentifier.create(QName.create(CLabeledUnicastDestination.QNAME, "label-value").intern());
@@ -167,11 +167,6 @@ abstract class AbstractLabeledUnicastRIBSupport<C extends Routes>
         return new LabeledUnicastRouteKey(pathId, routeKey.getRouteKey());
     }
 
-    @Override
-    public final LabeledUnicastRouteKey extractRouteKey(final LabeledUnicastRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public final LabeledUnicastRoute createRoute(final LabeledUnicastRoute route,
             final LabeledUnicastRouteKey routeKey,
index 51c81ffe9e49665861d3eecc48bd4819bb0ed2cc..62215376cbec52299b58f2ab4ebde724aa6136a0 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
 import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.LabeledUnicastSubsequentAddressFamily;
@@ -25,14 +24,12 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
-public final class LabeledUnicastIpv4RIBSupport extends AbstractLabeledUnicastRIBSupport<org.opendaylight.yang.gen.v1
-        .urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.bgp.rib.rib.peer.adj.rib.in.tables
-        .routes.LabeledUnicastRoutesCase> {
+public final class LabeledUnicastIpv4RIBSupport extends AbstractLabeledUnicastRIBSupport {
     private static final LabeledUnicastIpv4RIBSupport SINGLETON = new LabeledUnicastIpv4RIBSupport();
 
     private LabeledUnicastIpv4RIBSupport() {
         super(LabeledUnicastRoutesCase.class, LabeledUnicastRoutes.class, LabeledUnicastRoute.class,
-            Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class, DestinationLabeledUnicast.QNAME);
+                Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class, DestinationLabeledUnicast.QNAME);
     }
 
     static LabeledUnicastIpv4RIBSupport getInstance() {
@@ -42,14 +39,14 @@ public final class LabeledUnicastIpv4RIBSupport extends AbstractLabeledUnicastRI
     @Override
     protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
         return new DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-            new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
+                new DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
     }
 
     @Override
     protected DestinationType buildWithdrawnDestination(final Collection<MapEntryNode> routes) {
         return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLabeledUnicastCaseBuilder().setDestinationLabeledUnicast(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(
-                extractRoutes(routes)).build()).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.labeled.unicast._case.DestinationLabeledUnicastBuilder().setCLabeledUnicastDestination(
+                        extractRoutes(routes)).build()).build();
     }
 
     @Override
@@ -60,15 +57,4 @@ public final class LabeledUnicastIpv4RIBSupport extends AbstractLabeledUnicastRI
         }
         return null;
     }
-
-    @Override
-    public Collection<LabeledUnicastRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-            .ns.yang.bgp.labeled.unicast.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes
-            .LabeledUnicastRoutesCase routes) {
-        final LabeledUnicastRoutes routeCont =  routes.getLabeledUnicastRoutes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getLabeledUnicastRoute();
-    }
 }
index 376b6e0a1608156974ddabb935cb99d7ff91f810..ca3261028cb5de989fc8124633ec40ba1f9faae8 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.protocol.bgp.labeled.unicast;
 
 import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.LabeledUnicastSubsequentAddressFamily;
@@ -25,14 +24,12 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 
-final class LabeledUnicastIpv6RIBSupport extends AbstractLabeledUnicastRIBSupport<org.opendaylight.yang.gen.v1.urn
-        .opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.bgp.rib.rib.peer.adj.rib.in.tables
-        .routes.LabeledUnicastIpv6RoutesCase> {
+final class LabeledUnicastIpv6RIBSupport extends AbstractLabeledUnicastRIBSupport {
     private static final LabeledUnicastIpv6RIBSupport SINGLETON = new LabeledUnicastIpv6RIBSupport();
 
     private LabeledUnicastIpv6RIBSupport() {
         super(LabeledUnicastIpv6RoutesCase.class, LabeledUnicastIpv6Routes.class, LabeledUnicastRoute.class,
-            Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class, DestinationIpv6LabeledUnicast.QNAME);
+                Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class, DestinationIpv6LabeledUnicast.QNAME);
     }
 
     static LabeledUnicastIpv6RIBSupport getInstance() {
@@ -42,16 +39,16 @@ final class LabeledUnicastIpv6RIBSupport extends AbstractLabeledUnicastRIBSuppor
     @Override
     protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
         return new DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-            new DestinationIpv6LabeledUnicastBuilder().setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
+                new DestinationIpv6LabeledUnicastBuilder().setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
     }
 
     @Override
     protected DestinationType buildWithdrawnDestination(final Collection<MapEntryNode> routes) {
         return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.unreach
-            .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp
-                .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
-                .setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
+                .nlri.withdrawn.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder().setDestinationIpv6LabeledUnicast(
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp
+                        .unreach.nlri.withdrawn.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder()
+                        .setCLabeledUnicastDestination(extractRoutes(routes)).build()).build();
     }
 
     @Override
@@ -63,14 +60,4 @@ final class LabeledUnicastIpv6RIBSupport extends AbstractLabeledUnicastRIBSuppor
         }
         return null;
     }
-
-    @Override
-    public Collection<LabeledUnicastRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
-            .ns.yang.bgp.labeled.unicast.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.LabeledUnicastIpv6RoutesCase routes) {
-        final LabeledUnicastIpv6Routes routeCont =  routes.getLabeledUnicastIpv6Routes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getLabeledUnicastRoute();
-    }
 }
index 5598831081b2dd5b6ccd7a17239ff8167cd46e83..ca34c507fed9697332e2789c9fe1937258ca8659 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
@@ -49,9 +48,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public final class LinkstateRIBSupport extends AbstractRIBSupport<org.opendaylight.yang.gen.v1.urn.opendaylight.params
-        .xml.ns.yang.bgp.linkstate.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.LinkstateRoutesCase,
-        LinkstateRoute, LinkstateRouteKey> {
+public final class LinkstateRIBSupport extends AbstractRIBSupport<LinkstateRoute, LinkstateRouteKey> {
     private static final Logger LOG = LoggerFactory.getLogger(LinkstateRIBSupport.class);
     private static final QName ROUTE_KEY_QNAME = QName.create(LinkstateRoute.QNAME, ROUTE_KEY).intern();
     private static final LinkstateRIBSupport SINGLETON = new LinkstateRIBSupport();
@@ -137,11 +134,6 @@ public final class LinkstateRIBSupport extends AbstractRIBSupport<org.opendaylig
         return routes.stream().map(LinkstateNlriParser::extractLinkstateDestination).collect(Collectors.toList());
     }
 
-    @Override
-    public LinkstateRouteKey extractRouteKey(final LinkstateRoute route) {
-        return route.getKey();
-    }
-
     @Override
     public LinkstateRoute createRoute(
             final LinkstateRoute route,
@@ -156,14 +148,4 @@ public final class LinkstateRIBSupport extends AbstractRIBSupport<org.opendaylig
         }
         return builder.setRouteKey(routeKey.getRouteKey()).setAttributes(attributes).build();
     }
-
-    @Override
-    public Collection<LinkstateRoute> changedRoutes(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.bgp.linkstate.rev171207.bgp.rib.rib.peer.adj.rib.in.tables.routes.LinkstateRoutesCase routes) {
-        final LinkstateRoutes routeCont = routes.getLinkstateRoutes();
-        if (routeCont == null) {
-            return Collections.emptyList();
-        }
-        return routeCont.getLinkstateRoute();
-    }
 }
index 032766120e3172f6cad5901542523ef12bafd2ff..0abb4a140047f97cc319e152f03bed7e4278b2cf 100644 (file)
@@ -111,8 +111,8 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         return this.adjInTracker.getTotalPrefixesInstalled();
     }
 
-    private final class AdjInTracker implements PrefixesReceivedCounters, PrefixesInstalledCounters, AutoCloseable,
-            ClusteredDataTreeChangeListener<Tables> {
+    private static final class AdjInTracker implements PrefixesReceivedCounters, PrefixesInstalledCounters,
+            AutoCloseable, ClusteredDataTreeChangeListener<Tables> {
         private final RIBSupportContextRegistry registry;
         private final KeyedInstanceIdentifier<Peer, PeerKey> peerIId;
         private final InstanceIdentifier<EffectiveRibIn> effRibTables;
@@ -194,7 +194,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                         updateRoutes(tx, tk, ribSupport, tablePath, routesChangesContainer.getModifiedChildren());
                         break;
                     case WRITE:
-                        writeTable(tx, table.getDataAfter());
+                        writeTable(tx, table);
                         break;
                     default:
                         LOG.warn("Ignoring unhandled root {}", table);
@@ -213,14 +213,14 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                 final KeyedInstanceIdentifier<Tables, TablesKey> tablePath,
                 final Collection<DataObjectModification<? extends DataObject>> routeChanges) {
             for (final DataObjectModification<? extends DataObject> routeChanged : routeChanges) {
+                final Identifier routeKey
+                        = ((InstanceIdentifier.IdentifiableItem) routeChanged.getIdentifier()).getKey();
                 switch (routeChanged.getModificationType()) {
                     case SUBTREE_MODIFIED:
                     case WRITE:
-                        writeRoutes(tx, tableKey, ribSupport, tablePath, (Route) routeChanged.getDataAfter());
+                        writeRoutes(tx, tableKey, ribSupport, tablePath, routeKey, (Route) routeChanged.getDataAfter());
                         break;
                     case DELETE:
-                        final Route routeDeleted = (Route) routeChanged.getDataBefore();
-                        final Identifier routeKey = ribSupport.extractRouteKey(routeDeleted);
                         final InstanceIdentifier routeIID = ribSupport.createRouteIId(tablePath, routeKey);
                         tx.delete(LogicalDatastoreType.OPERATIONAL, routeIID);
                         break;
@@ -230,8 +230,8 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
 
         @SuppressWarnings("unchecked")
         private void writeRoutes(final WriteTransaction tx, final TablesKey tk, final RIBSupport ribSupport,
-                final KeyedInstanceIdentifier<Tables, TablesKey> tablePath, final Route route) {
-            final Identifier routeKey = ribSupport.extractRouteKey(route);
+                final KeyedInstanceIdentifier<Tables, TablesKey> tablePath, final Identifier routeKey,
+                final Route route) {
             final InstanceIdentifier routeIID = ribSupport.createRouteIId(tablePath, routeKey);
             CountersUtil.increment(this.prefixesReceived.get(tk), tk);
             final Optional<Attributes> effAtt = this.ribPolicies
@@ -246,11 +246,12 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         }
 
         @SuppressWarnings("unchecked")
-        private void writeTable(final WriteTransaction tx, final Tables table) {
-            if (table == null) {
+        private void writeTable(final WriteTransaction tx, final DataObjectModification<Tables> table) {
+            final Tables newTable = table.getDataAfter();
+            if (newTable == null) {
                 return;
             }
-            final TablesKey tableKey = table.getKey();
+            final TablesKey tableKey = newTable.getKey();
             final KeyedInstanceIdentifier<Tables, TablesKey> tablePath
                     = this.effRibTables.child(Tables.class, tableKey);
 
@@ -258,17 +259,21 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
             LOG.trace("Create Empty table", tablePath);
             tx.put(LogicalDatastoreType.OPERATIONAL, tablePath, new TablesBuilder()
                     .setAfi(tableKey.getAfi()).setSafi(tableKey.getSafi())
-                    .setAttributes(table.getAttributes()).build());
+                    .setAttributes(newTable.getAttributes()).build());
 
             final RIBSupport ribSupport = this.registry.getRIBSupport(tableKey);
-            final Routes routes = table.getRoutes();
+            final Routes routes = newTable.getRoutes();
             if (routes == null) {
                 return;
             }
-            final Collection<? extends Route> changedRoutes = ribSupport.changedRoutes(routes);
-            for (final Route route : changedRoutes) {
-                writeRoutes(tx, tableKey, ribSupport, tablePath, route);
+
+            final DataObjectModification routesChangesContainer =
+                    table.getModifiedChildContainer(ribSupport.routesContainerClass());
+
+            if (routesChangesContainer == null) {
+                return;
             }
+            updateRoutes(tx, tableKey, ribSupport, tablePath, routesChangesContainer.getModifiedChildren());
         }
 
         @Override
index 47eeff5ba37ebf0936e3a5eafe287c8ffc799b59..2980331f61ef0985cccbecaa8981dea893c5561c 100644 (file)
@@ -64,8 +64,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Beta
-public abstract class AbstractRIBSupport<C extends Routes, R extends Route, N extends Identifier>
-        implements RIBSupport<C, R, N> {
+public abstract class AbstractRIBSupport<R extends Route, N extends Identifier>
+        implements RIBSupport<R, N> {
     public static final String ROUTE_KEY = "route-key";
     private static final Logger LOG = LoggerFactory.getLogger(AbstractRIBSupport.class);
     private static final NodeIdentifier ADVERTISED_ROUTES = new NodeIdentifier(AdvertizedRoutes.QNAME);
index a955ac1a72ad19f32ddb1de9ef35f62d10d64625..e9d1a1b2415c2e23c98380e525f529053b258a5d 100644 (file)
@@ -25,8 +25,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 /**
  * Implements common methods for Advertisement of Multiple Paths on ribSupport.
  */
-public abstract class MultiPathAbstractRIBSupport<C extends Routes, R extends Route, N extends Identifier>
-        extends AbstractRIBSupport<C, R, N> {
+public abstract class MultiPathAbstractRIBSupport<R extends Route, N extends Identifier>
+        extends AbstractRIBSupport<R, N> {
     private final QName routeKeyQname;
     private final QName pathIdQname;
     private final NodeIdentifier pathIdNid;
index 74ee97b3a087c52ac8cf122dfa6f43b6592b9e1e..52eca3962ca15fa41bf458f9056737254d401b1f 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNod
  * to register an implementation of this class and the RIB core then calls into it
  * to inquire about details specific to that particular model.
  */
-public interface RIBSupport<C extends Routes, R extends Route, N extends Identifier> extends AddPathRibSupport {
+public interface RIBSupport<R extends Route, N extends Identifier> extends AddPathRibSupport {
     /**
      * Return the table-type-specific empty routes container, as augmented into the
      * bgp-rib model under /rib/tables/routes choice node. This needs to include all
@@ -198,15 +198,6 @@ public interface RIBSupport<C extends Routes, R extends Route, N extends Identif
     @Nonnull
     Class<? extends SubsequentAddressFamily> getSafi();
 
-    /**
-     * Extract Routes from Route Container.
-     *
-     * @param routes container
-     * @return routes
-     */
-    @Nonnull
-    Collection<R> changedRoutes(@Nonnull C routes);
-
     /**
      * Creates Route Rib out Peer InstanceIdentifier.
      *
@@ -219,14 +210,6 @@ public interface RIBSupport<C extends Routes, R extends Route, N extends Identif
             @Nonnull KeyedInstanceIdentifier<Tables, TablesKey> ribOutIId,
             @Nonnull N newRouteKey);
 
-    /**
-     * Extract key route from route
-     *
-     * @param route container
-     * @return key
-     */
-    N extractRouteKey(R route);
-
     @Nonnull
     R createRoute(@Nullable R route, N routeKey, @Nullable PathId pathId, @Nonnull Attributes attributes);
 
index 70a13e96dbaec40f23d7069656c9767a1d0c435d..cca22289600cb63cb0781f197a7bb8e45bb0b171 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 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.Route;
-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.types.rev130919.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -78,19 +77,9 @@ public final class MultiPathAbstractTest extends MultiPathAbstractRIBSupport {
         return false;
     }
 
-    @Override
-    public Identifier extractRouteKey(final Route route) {
-        return null;
-    }
-
     @Override
     public Route createRoute(final Route route, final Identifier routeKey, final PathId pathId
             , final Attributes attributes) {
         return null;
     }
-
-    @Override
-    public Collection changedRoutes(final Routes routes) {
-        return null;
-    }
 }
\ No newline at end of file