From 8185249f461f92df89c3033a5c40a8a9d9e310d4 Mon Sep 17 00:00:00 2001 From: "Claudio D. Gasparini" Date: Tue, 20 Mar 2018 09:54:25 +0100 Subject: [PATCH] revert method name change Change-Id: Id3f00b6d224e61b9de2dc5ab9d85a6273883aaef Signed-off-by: Claudio D. Gasparini --- .../bgp/evpn/impl/EvpnRibSupportTest.java | 6 +- .../flowspec/FlowspecIpv4RIBSupportTest.java | 6 +- .../flowspec/FlowspecIpv6RIBSupportTest.java | 6 +- .../FlowspecL3vpnIpv4RIBSupportTest.java | 6 +- .../FlowspecL3vpnIpv6RIBSupportTest.java | 6 +- .../protocol/bgp/inet/IPv4RIBSupportTest.java | 6 +- .../protocol/bgp/inet/IPv6RIBSupportTest.java | 6 +- .../bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java | 6 +- .../bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java | 6 +- .../LabeledUnicastIpv4RIBSupportTest.java | 6 +- .../LabeledUnicastIpv6RIBSupportTest.java | 6 +- .../linkstate/LinkstateRIBSupportTest.java | 6 +- .../bgp/rib/impl/AdjRibOutListener.java | 2 +- .../bgp/rib/spi/AbstractRIBSupport.java | 2 +- .../bgp/rib/spi/AddPathRibSupport.java | 74 +++++++++++++++++++ .../protocol/bgp/rib/spi/RIBSupport.java | 48 +++--------- .../spi/MultiPathAbstractRIBSupportTest.java | 6 +- 17 files changed, 125 insertions(+), 79 deletions(-) create mode 100644 bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AddPathRibSupport.java diff --git a/bgp/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java b/bgp/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java index 87d42c4328..9dab37e7fc 100644 --- a/bgp/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java +++ b/bgp/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java @@ -189,15 +189,15 @@ public final class EvpnRibSupportTest extends AbstractRIBSupportTest { final Routes emptyCase = new EvpnRoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new EvpnRoutesCaseBuilder().setEvpnRoutes(new EvpnRoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new EvpnRoutesCaseBuilder().setEvpnRoutes(EVPN_ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java index 9b024b3268..e909240b9a 100644 --- a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java +++ b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java @@ -185,16 +185,16 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new FlowspecRoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new FlowspecRoutesCaseBuilder().setFlowspecRoutes(new FlowspecRoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new FlowspecRoutesCaseBuilder().setFlowspecRoutes(new FlowspecRoutesBuilder() .setFlowspecRoute(Collections.singletonList(ROUTE)).build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java index 2f3fcf6c6b..1dbc9ab962 100644 --- a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java +++ b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java @@ -184,16 +184,16 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new FlowspecIpv6RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new FlowspecIpv6RoutesCaseBuilder().setFlowspecIpv6Routes(new FlowspecIpv6RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new FlowspecIpv6RoutesCaseBuilder().setFlowspecIpv6Routes(new FlowspecIpv6RoutesBuilder() .setFlowspecRoute(Collections.singletonList(ROUTE)).build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java index ac6ab0839c..e5aa49e80d 100644 --- a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java +++ b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java @@ -181,16 +181,16 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new FlowspecL3vpnIpv4RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder() .setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } diff --git a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java index 833a54eceb..762cfe34ff 100644 --- a/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java +++ b/bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java @@ -182,16 +182,16 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new FlowspecL3vpnIpv6RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new FlowspecL3vpnIpv6RoutesCaseBuilder().setFlowspecL3vpnIpv6Routes(new FlowspecL3vpnIpv6RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new FlowspecL3vpnIpv6RoutesCaseBuilder().setFlowspecL3vpnIpv6Routes(new FlowspecL3vpnIpv6RoutesBuilder() .setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java b/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java index a6c8b69f63..0bc2bb8455 100644 --- a/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java +++ b/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java @@ -177,15 +177,15 @@ public final class IPv4RIBSupportTest extends AbstractRIBSupportTest { final Routes emptyCase = new Ipv4RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new Ipv4RoutesCaseBuilder().setIpv4Routes(new Ipv4RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new Ipv4RoutesCaseBuilder().setIpv4Routes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } diff --git a/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java b/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java index 54e7b28d3a..84e0103768 100644 --- a/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java +++ b/bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java @@ -177,15 +177,15 @@ public final class IPv6RIBSupportTest extends AbstractRIBSupportTest { final Routes emptyCase = new Ipv6RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new Ipv6RoutesCaseBuilder().setIpv6Routes(new Ipv6RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new Ipv6RoutesCaseBuilder().setIpv6Routes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } diff --git a/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java b/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java index b577c518ce..415d2c73c9 100644 --- a/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java +++ b/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java @@ -172,16 +172,16 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest { final Routes emptyCase = new VpnIpv4RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes( new VpnIpv4RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java b/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java index 76866b8631..a9c74d511d 100644 --- a/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java +++ b/bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java @@ -170,16 +170,16 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest { final Routes emptyCase = new VpnIpv6RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new VpnIpv6RoutesCaseBuilder() .setVpnIpv6Routes(new VpnIpv6RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java b/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java index 5923c04d08..f7610d3793 100644 --- a/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java +++ b/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java @@ -190,15 +190,15 @@ public class LabeledUnicastIpv4RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new LabeledUnicastRoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new LabeledUnicastRoutesCaseBuilder().setLabeledUnicastRoutes(new LabeledUnicastRoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new LabeledUnicastRoutesCaseBuilder().setLabeledUnicastRoutes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } diff --git a/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java b/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java index 6f27355170..ba2f01c307 100644 --- a/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java +++ b/bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java @@ -191,15 +191,15 @@ public class LabeledUnicastIpv6RIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new LabeledUnicastIpv6RoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new LabeledUnicastIpv6RoutesCaseBuilder().setLabeledUnicastIpv6Routes(new LabeledUnicastIpv6RoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new LabeledUnicastIpv6RoutesCaseBuilder().setLabeledUnicastIpv6Routes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } diff --git a/bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java b/bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java index d907dfcc3c..ed4d84f02d 100644 --- a/bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java +++ b/bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java @@ -211,15 +211,15 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest { public void testChangedRoutes() { final Routes emptyCase = new LinkstateRoutesCaseBuilder().build(); DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes emptyRoutes = new LinkstateRoutesCaseBuilder().setLinkstateRoutes(new LinkstateRoutesBuilder().build()).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode(); - Assert.assertTrue(RIB_SUPPORT.changedDOMRoutes(tree).isEmpty()); + Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty()); final Routes routes = new LinkstateRoutesCaseBuilder().setLinkstateRoutes(ROUTES).build(); tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode(); - final Collection result = RIB_SUPPORT.changedDOMRoutes(tree); + final Collection result = RIB_SUPPORT.changedRoutes(tree); Assert.assertFalse(result.isEmpty()); } } \ No newline at end of file diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java index 7fcddfe021..a302633b65 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java @@ -116,7 +116,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre } private void processSupportedFamilyRoutes(final DataTreeCandidateNode child) { - final Collection changedRoutes = this.support.changedDOMRoutes(child); + final Collection changedRoutes = this.support.changedRoutes(child); for (final DataTreeCandidateNode route : changedRoutes) { processRouteChange(route); } diff --git a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java index fcce1a994f..46c7d7802f 100644 --- a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java +++ b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java @@ -298,7 +298,7 @@ public abstract class AbstractRIBSupport } @Override - public final Collection changedDOMRoutes(final DataTreeCandidateNode routes) { + public final Collection changedRoutes(final DataTreeCandidateNode routes) { final DataTreeCandidateNode myRoutes = routes.getModifiedChild(this.routesContainerIdentifier); if (myRoutes == null) { return Collections.emptySet(); diff --git a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AddPathRibSupport.java b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AddPathRibSupport.java new file mode 100644 index 0000000000..1fcfb3a003 --- /dev/null +++ b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AddPathRibSupport.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.protocol.bgp.rib.spi; + +import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route; +import org.opendaylight.yangtools.yang.binding.Identifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; + +/** + * Interface implemented to be extended by RibSupport. + * This interface exposes methods to access to Add Path information + * By default we implement non supported Multiple Path therefore + * 0 Path Id is returned and null PathArgument + */ +interface AddPathRibSupport { + /** + * Extract PathId from route change received. + * + * @param route Path Id Container + * @return pathId The path identifier value + */ + default long extractPathId(@Nonnull R route) { + return NON_PATH_ID_VALUE; + } + + /** + * Construct a PathArgument to an AddPathRoute. + * + * @param pathId The path identifier + * @param routeId PathArgument leaf path + * @return routeId PathArgument + pathId or Null in case Add-path is not supported + */ + @Deprecated + @Nullable + default PathArgument getRouteIdAddPath(long pathId, @Nonnull PathArgument routeId) { + return null; + } + + /** + * Create a new Path Argument for route Key removing remove Path Id from key. + * For extension which do not support Multiple Path this step is not required. + * + * @param routeKey routeKey Path Argument + * @return new route Key + */ + @Nonnull + default NodeIdentifierWithPredicates createRouteKeyPathArgument(@Nonnull NodeIdentifierWithPredicates routeKey) { + return routeKey; + } + + /** + * Construct a Route Key using new path Id for Families supporting additional path. + * Otherwise returns null. + * + * @param pathId The path identifier + * @param routeKey RouteKey + * @return routeId PathArgument + pathId or Null in case Add-path is not supported + */ + @Nullable + default N createNewRouteKey(@Nonnull long pathId, @Nonnull N routeKey) { + return null; + } +} diff --git a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RIBSupport.java b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RIBSupport.java index aac6c6b6de..b8272dfd04 100644 --- a/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RIBSupport.java +++ b/bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/RIBSupport.java @@ -7,8 +7,6 @@ */ package org.opendaylight.protocol.bgp.rib.spi; -import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE; - import com.google.common.collect.ImmutableCollection; import java.util.Collection; import javax.annotation.Nonnull; @@ -41,7 +39,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 { +public interface RIBSupport 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 @@ -157,7 +155,7 @@ public interface RIBSupport { * @return collection of modified nodes or empty collection if no node was modified */ @Nonnull - Collection changedDOMRoutes(@Nonnull DataTreeCandidateNode routes); + Collection changedRoutes(@Nonnull DataTreeCandidateNode routes); /** * Constructs an instance identifier path to routeId. @@ -211,47 +209,21 @@ public interface RIBSupport { @Nonnull KeyedInstanceIdentifier tableKey, @Nonnull N newRouteKey); - @Nonnull - R createRoute(@Nullable R route, N routeKey, @Nullable long pathId, @Nonnull Attributes attributes); - /** - * Construct a Route Key using new path Id for Families supporting additional path. - * Otherwise returns null. + * Creates a route with new path Id and attributes. * - * @param pathId The path identifier - * @param routeKey RouteKey - * @return routeId PathArgument + pathId or Null in case Add-path is not supported + * @param route route + * @param routeKey route key + * @param pathId new path Id + * @param attributes route attributes + * @return Route */ - @Nullable - default N createNewRouteKey(@Nonnull long pathId, @Nonnull N routeKey) { - return null; - } + @Nonnull + R createRoute(@Nullable R route, N routeKey, @Nullable long pathId, @Nonnull Attributes attributes); interface ApplyRoute { void apply(@Nonnull DOMDataWriteTransaction tx, @Nonnull YangInstanceIdentifier base, @Nonnull NodeIdentifierWithPredicates routeKey, @Nonnull DataContainerNode route, ContainerNode attributes); } - - /** - * Extract PathId from route change received. - * - * @param route Path Id Container - * @return pathId The path identifier value - */ - default long extractPathId(@Nonnull R route) { - return NON_PATH_ID_VALUE; - } - - /** - * Create a new Path Argument for route Key removing remove Path Id from key. - * For extension which do not support Multiple Path this step is not required. - * - * @param routeKey routeKey Path Argument - * @return new route Key - */ - @Nonnull - default NodeIdentifierWithPredicates createRouteKeyPathArgument(@Nonnull NodeIdentifierWithPredicates routeKey) { - return routeKey; - } } diff --git a/bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/MultiPathAbstractRIBSupportTest.java b/bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/MultiPathAbstractRIBSupportTest.java index 0bca8e236d..9e7a376125 100644 --- a/bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/MultiPathAbstractRIBSupportTest.java +++ b/bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/MultiPathAbstractRIBSupportTest.java @@ -225,9 +225,9 @@ public class MultiPathAbstractRIBSupportTest { @Test public void changedRoutes() { - Assert.assertTrue(MULTI_PATH_ABSTRACT_TEST.changedDOMRoutes(this.emptyTree).isEmpty()); - Assert.assertTrue(MULTI_PATH_ABSTRACT_TEST.changedDOMRoutes(this.emptySubTree).isEmpty()); - Assert.assertNotNull(MULTI_PATH_ABSTRACT_TEST.changedDOMRoutes(this.subTree)); + Assert.assertTrue(MULTI_PATH_ABSTRACT_TEST.changedRoutes(this.emptyTree).isEmpty()); + Assert.assertTrue(MULTI_PATH_ABSTRACT_TEST.changedRoutes(this.emptySubTree).isEmpty()); + Assert.assertNotNull(MULTI_PATH_ABSTRACT_TEST.changedRoutes(this.subTree)); } @Test -- 2.36.6