BGPCEP-754: Rework EffectiveRibInWriter
[bgpcep.git] / bgp / l3vpn / src / main / java / org / opendaylight / protocol / bgp / l3vpn / ipv4 / VpnIpv4RIBSupport.java
index bcee4558f5c784a3ce9e86de603fe7c6fb4dec6c..a5cb5c9f440813d5c7e5d016d61ecb2106baaa35 100644 (file)
@@ -7,6 +7,8 @@
  */
 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;
@@ -22,7 +24,8 @@ 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 {
+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> {
     /**
      * 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
@@ -57,4 +60,14 @@ final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport {
                 .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();
+    }
 }