until the moment a PathId is required.
Change-Id: Idc2ce010fe4f2081f0d8131f2af226dfe88aec72
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
package org.opendaylight.protocol.bgp.benchmark.app;
import static java.util.Objects.requireNonNull;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Stopwatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4Route;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4RouteBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4RouteKey;
-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.message.rev171207.path.attributes.AttributesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.AsPath;
private static final String SLASH = "/";
private static final String PREFIX = SLASH + "32";
- private static final PathId PATH_ID = new PathId(0L);
-
private final BindingTransactionChain txChain;
private final RpcRegistration<OdlBgpAppPeerBenchmarkService> rpcRegistration;
private final InstanceIdentifier<ApplicationRib> appIID;
String address = getAdddressFromPrefix(ipv4Prefix);
final Stopwatch stopwatch = Stopwatch.createStarted();
for (int i = 1; i <= count; i++) {
- final Ipv4RouteKey routeKey = new Ipv4RouteKey(PATH_ID, createPrefix(address));
+ final Ipv4RouteKey routeKey = new Ipv4RouteKey(NON_PATH_ID, createPrefix(address));
final KeyedInstanceIdentifier<Ipv4Route, Ipv4RouteKey> routeIId =
this.routesIId.child(Ipv4Route.class, routeKey);
if (attributes != null) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationEvpnCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder;
-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.yangtools.yang.binding.DataObject;
}
@Override
- public EvpnRoute createRoute(final EvpnRoute route, final EvpnRouteKey routeKey, final PathId pathId,
+ public EvpnRoute createRoute(final EvpnRoute route, final EvpnRouteKey routeKey, final long pathId,
final Attributes attributes) {
final EvpnRouteBuilder builder;
if (route != null) {
import static org.opendaylight.protocol.bgp.evpn.impl.EvpnTestUtil.RD;
import static org.opendaylight.protocol.bgp.evpn.impl.nlri.EthADRParserTest.ETHERNET_AD_ROUTE_CASE;
import static org.opendaylight.protocol.bgp.evpn.impl.nlri.EthADRParserTest.ETHERNET_AD_ROUTE_CASE_KEY;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import io.netty.buffer.ByteBuf;
@Test
public void testRouteIdAddPath() {
- Assert.assertNull(RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, null));
+ Assert.assertNull(RIB_SUPPORT.createNewRouteKey(1L, null));
}
@Test
@Test
public void testExtractPathId() {
- assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
*/
package org.opendaylight.protocol.bgp.flowspec;
-import java.util.Collection;
-import java.util.Collections;
-import javax.annotation.Nonnull;
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.FlowspecRoutesCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.ipv4.DestinationFlowspec;
return new FlowspecIpv4RIBSupport(context);
}
- @Nonnull
@Override
- public FlowspecRoute createRoute(
- final FlowspecRoute route,
- final FlowspecRouteKey routeKey,
- final PathId pathId,
- final Attributes attributes) {
+ public FlowspecRoute createRoute(final FlowspecRoute route, final FlowspecRouteKey routeKey,
+ final long pathId, final Attributes attributes) {
final FlowspecRouteBuilder builder;
if (route != null) {
builder = new FlowspecRouteBuilder(route);
} else {
builder = new FlowspecRouteBuilder();
}
- return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(routeKey.getRouteKey()).setPathId(new PathId(pathId))
+ .setAttributes(attributes).build();
}
@Override
- public FlowspecRouteKey createNewRouteKey(final PathId pathId, final FlowspecRouteKey routeKey) {
- return new FlowspecRouteKey(pathId, routeKey.getRouteKey());
+ public FlowspecRouteKey createNewRouteKey(final long pathId, final FlowspecRouteKey routeKey) {
+ return new FlowspecRouteKey(new PathId(pathId), routeKey.getRouteKey());
}
}
@Override
public FlowspecRoute createRoute(final FlowspecRoute route, final FlowspecRouteKey routeKey,
- final PathId pathId, final Attributes attributes) {
+ final long pathId, final Attributes attributes) {
final FlowspecRouteBuilder builder;
if (route != null) {
builder = new FlowspecRouteBuilder(route);
} else {
builder = new FlowspecRouteBuilder();
}
- return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(routeKey.getRouteKey())
+ .setPathId(new PathId(pathId)).setAttributes(attributes).build();
}
@Override
- public FlowspecRouteKey createNewRouteKey(final PathId pathId, final FlowspecRouteKey routeKey) {
- return new FlowspecRouteKey(pathId, routeKey.getRouteKey());
+ public FlowspecRouteKey createNewRouteKey(final long pathId, final FlowspecRouteKey routeKey) {
+ return new FlowspecRouteKey(new PathId(pathId), routeKey.getRouteKey());
}
}
}
@Override
- public final FlowspecL3vpnRouteKey createNewRouteKey(final PathId pathId, final FlowspecL3vpnRouteKey routeKey) {
- return new FlowspecL3vpnRouteKey(pathId, routeKey.getRouteKey());
+ public final FlowspecL3vpnRouteKey createNewRouteKey(final long pathId, final FlowspecL3vpnRouteKey routeKey) {
+ return new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey.getRouteKey());
}
@Override
- public FlowspecL3vpnRoute createRoute(
- final FlowspecL3vpnRoute route,
- final FlowspecL3vpnRouteKey routeKey,
- final PathId pathId,
- final Attributes attributes) {
+ public FlowspecL3vpnRoute createRoute(final FlowspecL3vpnRoute route, final FlowspecL3vpnRouteKey routeKey,
+ final long pathId, final Attributes attributes) {
final FlowspecL3vpnRouteBuilder builder;
if (route != null) {
builder = new FlowspecL3vpnRouteBuilder(route);
} else {
builder = new FlowspecL3vpnRouteBuilder();
}
- return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(routeKey.getRouteKey()).setPathId(new PathId(pathId))
+ .setAttributes(attributes).build();
}
}
}
@Override
- public final FlowspecL3vpnRouteKey createNewRouteKey(final PathId pathId, final FlowspecL3vpnRouteKey routeKey) {
- return new FlowspecL3vpnRouteKey(pathId, routeKey.getRouteKey());
+ public final FlowspecL3vpnRouteKey createNewRouteKey(final long pathId, final FlowspecL3vpnRouteKey routeKey) {
+ return new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey.getRouteKey());
}
@Override
- public FlowspecL3vpnRoute createRoute(
- final FlowspecL3vpnRoute route,
- final FlowspecL3vpnRouteKey routeKey,
- final PathId pathId,
- final Attributes attributes) {
+ public FlowspecL3vpnRoute createRoute(final FlowspecL3vpnRoute route, final FlowspecL3vpnRouteKey routeKey,
+ final long pathId, final Attributes attributes) {
final FlowspecL3vpnRouteBuilder builder;
if (route != null) {
builder = new FlowspecL3vpnRouteBuilder(route);
} else {
builder = new FlowspecL3vpnRouteBuilder();
}
- return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(routeKey.getRouteKey()).setPathId(new PathId(pathId))
+ .setAttributes(attributes).build();
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.Collections;
@Test
public void testRouteIdAddPath() {
final FlowspecRouteKey oldKey = new FlowspecRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.Collections;
@Test
public void testRouteIdAddPath() {
final FlowspecRouteKey oldKey = new FlowspecRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.Collections;
@Test
public void testRouteIdAddPath() {
final FlowspecL3vpnRouteKey oldKey = new FlowspecL3vpnRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.Collections;
public void testRouteIdAddPath() {
final FlowspecL3vpnRouteKey oldRouteKey
= new FlowspecL3vpnRouteKey(new PathId(10L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldRouteKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldRouteKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import javax.annotation.Nonnull;
import org.opendaylight.protocol.bgp.parser.spi.PathIdUtil;
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.inet.rev171207.bgp.rib.rib.loc.rib.tables.routes.Ipv4RoutesCase;
return prefs;
}
- @Nonnull
@Override
- protected DestinationType buildDestination(@Nonnull final Collection<MapEntryNode> routes) {
+ protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
return new DestinationIpv4CaseBuilder().setDestinationIpv4(new DestinationIpv4Builder()
.setIpv4Prefixes(extractPrefixes(routes)).build()).build();
}
- @Nonnull
@Override
- protected DestinationType buildWithdrawnDestination(@Nonnull final Collection<MapEntryNode> routes) {
+ protected DestinationType buildWithdrawnDestination(final Collection<MapEntryNode> routes) {
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.update
.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv4CaseBuilder()
.setDestinationIpv4(new DestinationIpv4Builder().setIpv4Prefixes(extractPrefixes(routes))
}
@Override
- public Ipv4Route createRoute(final Ipv4Route route, final Ipv4RouteKey routeKey, final PathId pathId,
+ public Ipv4Route createRoute(final Ipv4Route route, final Ipv4RouteKey routeKey, final long pathId,
final Attributes attributes) {
final Ipv4RouteBuilder builder;
if (route != null) {
} else {
builder = new Ipv4RouteBuilder();
}
- return builder.setPrefix(routeKey.getPrefix()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setPrefix(routeKey.getPrefix()).setPathId(new PathId(pathId)).setAttributes(attributes).build();
}
@Override
- public Ipv4RouteKey createNewRouteKey(final PathId pathId, final Ipv4RouteKey routeKey) {
- return new Ipv4RouteKey(pathId, routeKey.getPrefix());
+ public Ipv4RouteKey createNewRouteKey(final long pathId, final Ipv4RouteKey routeKey) {
+ return new Ipv4RouteKey(new PathId(pathId), routeKey.getPrefix());
}
}
}
@Override
- public Ipv6Route createRoute(final Ipv6Route route, final Ipv6RouteKey routeKey, final PathId pathId,
+ public Ipv6Route createRoute(final Ipv6Route route, final Ipv6RouteKey routeKey, final long pathId,
final Attributes attributes) {
final Ipv6RouteBuilder builder;
if (route != null) {
} else {
builder = new Ipv6RouteBuilder();
}
- return builder.setPrefix(routeKey.getPrefix()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setPrefix(routeKey.getPrefix()).setPathId(new PathId(pathId)).setAttributes(attributes).build();
}
@Override
- public Ipv6RouteKey createNewRouteKey(final PathId pathId, final Ipv6RouteKey routeKey) {
- return new Ipv6RouteKey(pathId, routeKey.getPrefix());
+ public Ipv6RouteKey createNewRouteKey(final long pathId, final Ipv6RouteKey routeKey) {
+ return new Ipv6RouteKey(new PathId(pathId), routeKey.getPrefix());
}
}
public void testRouteIdAddPath() {
final Ipv4RouteKey expected = new Ipv4RouteKey(new PathId(1L), PREFIX);
final Ipv4RouteKey oldKey = new Ipv4RouteKey(new PathId(100L), PREFIX);
- assertEquals(expected, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ assertEquals(expected, RIB_SUPPORT.createNewRouteKey(expected.getPathId().getValue(), oldKey));
}
@Test
@Test
- public void testEmptyRoute() throws Exception {
+ public void testEmptyRoute() {
final Routes empty = new Ipv6RoutesCaseBuilder().setIpv6Routes(EMPTY_ROUTES).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
public void testRouteIdAddPath() {
final Ipv6RouteKey expected = new Ipv6RouteKey(new PathId(1L), PREFIX);
final Ipv6RouteKey oldKey = new Ipv6RouteKey(new PathId(100L), PREFIX);
- assertEquals(expected, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ assertEquals(expected, RIB_SUPPORT.createNewRouteKey(expected.getPathId().getValue(), oldKey));
}
@Test
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
import org.opendaylight.bgp.concepts.RouteDistinguisherUtil;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.protocol.bgp.labeled.unicast.LUNlriParser;
protected abstract DestinationType getWithdrawnDestinationType(List<VpnDestination> dests);
- @Nonnull
@Override
- protected DestinationType buildDestination(@Nonnull final Collection<MapEntryNode> routes) {
+ protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
return getAdvertisedDestinationType(extractRoutes(routes));
}
- @Nonnull
@Override
- protected DestinationType buildWithdrawnDestination(@Nonnull final Collection<MapEntryNode> routes) {
+ protected DestinationType buildWithdrawnDestination(final Collection<MapEntryNode> routes) {
return getWithdrawnDestinationType(extractRoutes(routes));
}
return routes.stream().map(this::extractVpnDestination).collect(Collectors.toList());
}
- @Nonnull
@Override
public ImmutableCollection<Class<? extends DataObject>> cacheableAttributeObjects() {
return ImmutableSet.of();
}
- @Nonnull
@Override
public ImmutableCollection<Class<? extends DataObject>> cacheableNlriObjects() {
return ImmutableSet.of();
}
@Override
- public final VpnRoute createRoute(
- final VpnRoute route,
- final VpnRouteKey vpnRouteKey,
- final PathId pathId,
- final Attributes attributes) {
+ public final VpnRoute createRoute(final VpnRoute route, final VpnRouteKey vpnRouteKey,
+ final long pathId, final Attributes attributes) {
final VpnRouteBuilder builder;
if (route != null) {
builder = new VpnRouteBuilder(route);
} else {
builder = new VpnRouteBuilder();
}
- return builder.setRouteKey(vpnRouteKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(vpnRouteKey.getRouteKey()).setPathId(new PathId(pathId))
+ .setAttributes(attributes).build();
}
}
import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.IPV4_VPN;
import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.LABEL_STACK;
import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest;
-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.Update;
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.Attributes1;
.setVpnDestination(Collections.singletonList(IPV4_VPN)).build()).build();
private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey("WAABAQIDBAECIgEW");
- private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID))
+ private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
.setAttributes(ATTRIBUTES).setPrefix(IPV4_PREFIX)
.setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
private static final VpnIpv4Routes ROUTES = new VpnIpv4RoutesBuilder()
@Test
public void testRouteIdAddPath() {
- Assert.assertNull(RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, null));
+ Assert.assertNull(RIB_SUPPORT.createNewRouteKey(1L, null));
}
@Test
@Test
public void testExtractPathId() {
- assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.IPV6_VPN;
import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.LABEL_STACK;
import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest;
-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.Update;
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.Attributes1;
.setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
.setVpnDestination(Collections.singletonList(IPV6_VPN)).build()).build();
private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey("cAABAQIDBAECIAEjRVaJ");
- private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID))
+ private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
.setAttributes(ATTRIBUTES).setPrefix(IPV6PREFIX)
.setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
private static final VpnIpv6Routes ROUTES = new VpnIpv6RoutesBuilder()
}
@Test
- public void testEmptyRoute() throws Exception {
+ public void testEmptyRoute() {
final Routes empty = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder()
.setVpnRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
@Test
public void testRouteIdAddPath() {
- Assert.assertNull(RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, null));
+ Assert.assertNull(RIB_SUPPORT.createNewRouteKey(1L, null));
}
@Test
@Test
public void testExtractPathId() {
- assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
* @param route DataContainer
* @return LabeledUnicastDestination Object
*/
- private CLabeledUnicastDestination extractCLabeledUnicastDestination(final DataContainerNode<? extends PathArgument> route) {
+ private CLabeledUnicastDestination extractCLabeledUnicastDestination(
+ final DataContainerNode<? extends PathArgument> route) {
final CLabeledUnicastDestinationBuilder builder = new CLabeledUnicastDestinationBuilder();
builder.setPrefix(extractPrefix(route, PREFIX_TYPE_NID));
builder.setLabelStack(extractLabel(route, LABEL_STACK_NID, LV_NID));
return builder.build();
}
- protected abstract IpPrefix extractPrefix(final DataContainerNode<? extends PathArgument> route, final NodeIdentifier prefixTypeNid);
+ protected abstract IpPrefix extractPrefix(final DataContainerNode<? extends PathArgument> route,
+ final NodeIdentifier prefixTypeNid);
- public static List<LabelStack> extractLabel(final DataContainerNode<? extends PathArgument> route, final NodeIdentifier labelStackNid,
- final NodeIdentifier labelValueNid) {
+ public static List<LabelStack> extractLabel(final DataContainerNode<? extends PathArgument> route,
+ final NodeIdentifier labelStackNid, final NodeIdentifier labelValueNid) {
final List<LabelStack> labels = new ArrayList<>();
final Optional<DataContainerChild<? extends PathArgument, ?>> labelStacks = route.getChild(labelStackNid);
if (labelStacks.isPresent()) {
}
@Override
- public final LabeledUnicastRouteKey createNewRouteKey(final PathId pathId, final LabeledUnicastRouteKey routeKey) {
- return new LabeledUnicastRouteKey(pathId, routeKey.getRouteKey());
+ public final LabeledUnicastRouteKey createNewRouteKey(final long pathId, final LabeledUnicastRouteKey routeKey) {
+ return new LabeledUnicastRouteKey(new PathId(pathId), routeKey.getRouteKey());
}
@Override
- public final LabeledUnicastRoute createRoute(final LabeledUnicastRoute route,
- final LabeledUnicastRouteKey routeKey,
- final PathId pathId,
- final Attributes attributes) {
+ public final LabeledUnicastRoute createRoute(final LabeledUnicastRoute route, final LabeledUnicastRouteKey routeKey,
+ final long pathId, final Attributes attributes) {
final LabeledUnicastRouteBuilder builder;
if (route != null) {
builder = new LabeledUnicastRouteBuilder(route);
} else {
builder = new LabeledUnicastRouteBuilder();
}
- return builder.setRouteKey(routeKey.getRouteKey()).setPathId(pathId).setAttributes(attributes).build();
+ return builder.setRouteKey(routeKey.getRouteKey()).setPathId(new PathId(pathId)).setAttributes(attributes).build();
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
public void testRouteIdAddPath() {
final LabeledUnicastRouteKey oldKey
= new LabeledUnicastRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
public void testRouteIdAddPath() {
final LabeledUnicastRouteKey oldKey
= new LabeledUnicastRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
- Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, oldKey));
+ Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationLinkstateCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.linkstate._case.DestinationLinkstate;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.linkstate._case.DestinationLinkstateBuilder;
-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.yangtools.yang.binding.DataObject;
return SINGLETON;
}
+ private static NodeIdentifierWithPredicates createRouteKey(final UnkeyedListEntryNode linkstate) {
+ final ByteBuf buffer = Unpooled.buffer();
+ final CLinkstateDestination cLinkstateDestination = LinkstateNlriParser.extractLinkstateDestination(linkstate);
+ SimpleNlriTypeRegistry.getInstance().serializeNlriType(cLinkstateDestination, buffer);
+
+ return new NodeIdentifierWithPredicates(LinkstateRoute.QNAME, ROUTE_KEY_QNAME, ByteArray.readAllBytes(buffer));
+ }
+
+ private static List<CLinkstateDestination> extractRoutes(final Collection<MapEntryNode> routes) {
+ return routes.stream().map(LinkstateNlriParser::extractLinkstateDestination).collect(Collectors.toList());
+ }
+
@Override
public ImmutableCollection<Class<? extends DataObject>> cacheableAttributeObjects() {
return ImmutableSet.of();
@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath,
- final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
+ final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
if (destination != null) {
final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes
= destination.getChild(this.nlriRoutesList);
private void processRoute(final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes,
final YangInstanceIdentifier routesPath,
- final ContainerNode attributes, final ApplyRoute function, final DOMDataWriteTransaction tx) {
+ final ContainerNode attributes, final ApplyRoute function, final DOMDataWriteTransaction tx) {
if (maybeRoutes.isPresent()) {
final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
if (routes instanceof UnkeyedListNode) {
}
}
- private static NodeIdentifierWithPredicates createRouteKey(final UnkeyedListEntryNode linkstate) {
- final ByteBuf buffer = Unpooled.buffer();
- final CLinkstateDestination cLinkstateDestination = LinkstateNlriParser.extractLinkstateDestination(linkstate);
- SimpleNlriTypeRegistry.getInstance().serializeNlriType(cLinkstateDestination, buffer);
-
- return new NodeIdentifierWithPredicates(LinkstateRoute.QNAME, ROUTE_KEY_QNAME, ByteArray.readAllBytes(buffer));
- }
-
@Override
protected DestinationType buildDestination(final Collection<MapEntryNode> routes) {
return new DestinationLinkstateCaseBuilder().setDestinationLinkstate(
- new DestinationLinkstateBuilder().setCLinkstateDestination(extractRoutes(routes)).build()).build();
+ new DestinationLinkstateBuilder().setCLinkstateDestination(extractRoutes(routes)).build()).build();
}
@Override
.setCLinkstateDestination(extractRoutes(routes)).build()).build();
}
- private static List<CLinkstateDestination> extractRoutes(final Collection<MapEntryNode> routes) {
- return routes.stream().map(LinkstateNlriParser::extractLinkstateDestination).collect(Collectors.toList());
- }
-
@Override
- public LinkstateRoute createRoute(
- final LinkstateRoute route,
- final LinkstateRouteKey routeKey,
- final PathId pathId,
- final Attributes attributes) {
+ public LinkstateRoute createRoute(final LinkstateRoute route, final LinkstateRouteKey routeKey,
+ final long pathId, final Attributes attributes) {
final LinkstateRouteBuilder builder;
if (route != null) {
builder = new LinkstateRouteBuilder(route);
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableSet;
import io.netty.buffer.ByteBuf;
@Test
public void testRouteIdAddPath() {
- Assert.assertNull(RIB_SUPPORT.createNewRouteKey(AbstractRIBSupportTest.PATH_ID, null));
+ Assert.assertNull(RIB_SUPPORT.createNewRouteKey(1L, null));
}
@Test
@Test
public void testExtractPathId() {
- Assert.assertEquals(NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+ Assert.assertEquals(NON_PATH_ID_VALUE, RIB_SUPPORT.extractPathId(null));
}
@Test
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
public final class PathIdUtil {
- public static final long NON_PATH_ID = 0;
+ public static final long NON_PATH_ID_VALUE = 0;
+ public static final PathId NON_PATH_ID = new PathId(NON_PATH_ID_VALUE);
private PathIdUtil() {
throw new UnsupportedOperationException();
final QName pathIdQname, final Object routeKeyValue,
final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf) {
// FIXME: a cache here would mean we instantiate the same identifier for each route making comparison quicker.
- final Object pathId = maybePathIdLeaf.isPresent() ? maybePathIdLeaf.get().getValue() : NON_PATH_ID;
+ final Object pathId = maybePathIdLeaf.isPresent() ? maybePathIdLeaf.get().getValue() : NON_PATH_ID_VALUE;
return createNodeIdentifierWithPredicates(routeQname, pathIdQname, pathId, routeKeyQname, routeKeyValue);
}
}
package org.opendaylight.protocol.bgp.parser.spi;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Assert;
@Test
public void testWritePathIdZero() {
- PathIdUtil.writePathId(new PathId(0L), this.buffer);
+ PathIdUtil.writePathId(NON_PATH_ID, this.buffer);
Assert.assertEquals(0, this.buffer.readableBytes());
}
*/
package org.opendaylight.protocol.bgp.mode.impl.add;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.Lists;
import com.google.common.primitives.UnsignedInteger;
if (this.removedPaths != null) {
this.removedPaths.forEach(removedPath -> {
final PathArgument routeIdAddPath = ribSupport.getRouteIdAddPath(removedPath.getPathId(), routeIdPA);
- final PathArgument routeIdAddPathDefault = ribSupport.getRouteIdAddPath(NON_PATH_ID, routeIdPA);
+ final PathArgument routeIdAddPathDefault = ribSupport.getRouteIdAddPath(NON_PATH_ID_VALUE, routeIdPA);
fillAdjRibsOut(true, null, null, null,
routeIdAddPathDefault, routeIdAddPath,
RouterIds.createPeerId(removedPath.getRouteId()),
final ContainerNode effectiveAttributes
= peerGroup.effectiveAttributes(fromPeer.getRole(), path.getAttributes());
final NodeIdentifierWithPredicates routeIdAddPath = ribSup
- .getRouteIdAddPath(destPeerSupAddPath ? path.getPathId() : NON_PATH_ID, routeId);
+ .getRouteIdAddPath(destPeerSupAddPath ? path.getPathId() : NON_PATH_ID_VALUE, routeId);
writeRoute(entryInfo.getToPeerId(), getAdjRibOutYII(ribSup, entryInfo.getRootPath(), routeIdAddPath, localTK),
effectiveAttributes, createValue(routeIdAddPath, path), ribSup, tx);
final ExportPolicyPeerTracker peerPT, final DOMDataWriteTransaction tx) {
final RIBSupport ribSup = entryDependencies.getRibSupport();
final NodeIdentifierWithPredicates routeIdAddPath = ribSup.getRouteIdAddPath(path.getPathId(), routeIdPA);
- final NodeIdentifierWithPredicates routeIdAddPathDefault = ribSup.getRouteIdAddPath(NON_PATH_ID, routeIdPA);
+ final NodeIdentifierWithPredicates routeIdAddPathDefault
+ = ribSup.getRouteIdAddPath(NON_PATH_ID_VALUE, routeIdPA);
final YangInstanceIdentifier pathAddPathTarget = ribSup.routePath(entryDependencies.getLocRibTableTarget()
.node(ROUTES_IDENTIFIER), routeIdAddPath);
final MapEntryNode addPathValue = createValue(routeIdAddPath, path);
package org.opendaylight.protocol.bgp.rib.spi;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
* @return pathId The path identifier value
*/
default long extractPathId(@Nonnull NormalizedNode<?, ?> normalizedNode) {
- return NON_PATH_ID;
+ return NON_PATH_ID_VALUE;
}
/**
public final long extractPathId(final NormalizedNode<?, ?> data) {
final Long pathId = PathIdUtil.extractPathId(data, this.routePathIdNid());
if (pathId == null) {
- return PathIdUtil.NON_PATH_ID;
+ return PathIdUtil.NON_PATH_ID_VALUE;
}
return pathId;
}
@Nonnull N newRouteKey);
@Nonnull
- R createRoute(@Nullable R route, N routeKey, @Nullable PathId pathId, @Nonnull Attributes attributes);
+ R createRoute(@Nullable R route, N routeKey, long pathId, @Nonnull Attributes attributes);
/**
* Construct a PathArgument to an AddPathRoute.
* @return routeId PathArgument + pathId or Null in case Add-path is not supported
*/
@Nullable
- default Identifier createNewRouteKey(@Nonnull PathId pathId, @Nonnull N routeKey) {
+ default Identifier createNewRouteKey(long pathId, @Nonnull N routeKey) {
return null;
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
+import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID_VALUE;
import com.google.common.collect.ImmutableMap;
import org.junit.Test;
@Test
public void defaultAddPathRibSupport() {
final AddPathRibSupportLocalTest test = new AddPathRibSupportLocalTest();
- assertEquals(NON_PATH_ID, test.extractPathId(null));
- assertNull(test.getRouteIdAddPath(NON_PATH_ID, null));
+ assertEquals(NON_PATH_ID_VALUE, test.extractPathId(null));
+ assertNull(test.getRouteIdAddPath(NON_PATH_ID_VALUE, null));
assertEquals(QNAME, test.createRouteKeyPathArgument(QNAME));
}
@Test
public void pathIdQName() {
- final MultiPathAbstractTest multiPath = MULTI_PATH_ABSTRACT_TEST;
- assertEquals(PATH_ID_QNAME, multiPath.pathIdQName());
- }
-
- @Test
- public void extractPathId() {
- final NodeIdentifier nii = new NodeIdentifier(PATH_ID_QNAME);
- final ContainerNode cont = ImmutableContainerNodeSchemaAwareBuilder.create().withNodeIdentifier(nii)
- .addChild(new ImmutableLeafNodeBuilder<>().withNodeIdentifier(nii).withValue(PATH_ID).build()).build();
- assertEquals(PATH_ID, MULTI_PATH_ABSTRACT_TEST.extractPathId(cont));
- }
-
- @Test
- public void getRouteIdAddPath() {
- final NodeIdentifierWithPredicates routeIdPa =
- new NodeIdentifierWithPredicates(Ipv4Route.QNAME,
- ImmutableMap.of(PATH_ID_QNAME, PATH_ID, PREFIX_QNAME, PREFIX));
- assertEquals(routeIdPa, MULTI_PATH_ABSTRACT_TEST.getRouteIdAddPath(PATH_ID, PREFIX_NII));
-
+ assertEquals(PATH_ID_QNAME, MULTI_PATH_ABSTRACT_TEST.pathIdQName());
}
@Test
}
@Test
- public void routesCaseClass() throws Exception {
+ public void routesCaseClass() {
assertEquals(Ipv4RoutesCase.class, MULTI_PATH_ABSTRACT_TEST.routesCaseClass());
}
@Test
- public void routesContainerClass() throws Exception {
+ public void routesContainerClass() {
assertEquals(Ipv4Routes.class, MULTI_PATH_ABSTRACT_TEST.routesContainerClass());
}
@Test
- public void routesListClass() throws Exception {
+ public void routesListClass() {
assertEquals(Ipv4Route.class, MULTI_PATH_ABSTRACT_TEST.routesListClass());
}
@Test
- public void routeQName() throws Exception {
+ public void routeQName() {
assertEquals(Ipv4Route.QNAME, MULTI_PATH_ABSTRACT_TEST.routeQName());
}
@Test
- public void emptyRoutes() throws Exception {
+ public void emptyRoutes() {
final ChoiceNode emptyRoutes = Builders.choiceBuilder().withNodeIdentifier(ROUTES_IDENTIFIER)
.addChild(Builders.containerBuilder().withNodeIdentifier(IPV4_ROUTES_IDENTIFIER)
.withChild(ImmutableNodes.mapNodeBuilder(MULTI_PATH_ABSTRACT_TEST.routeQName())
}
@Test
- public void routeNid() throws Exception {
+ public void routeNid() {
assertEquals(new NodeIdentifier(Ipv4Route.QNAME), MULTI_PATH_ABSTRACT_TEST.routeNid());
}
@Test
- public void getAfi() throws Exception {
+ public void getAfi() {
assertEquals(Ipv4AddressFamily.class, MULTI_PATH_ABSTRACT_TEST.getAfi());
}
@Test
- public void getSafi() throws Exception {
+ public void getSafi() {
assertEquals(UnicastSubsequentAddressFamily.class, MULTI_PATH_ABSTRACT_TEST.getSafi());
}
@Test
- public void routesContainerIdentifier() throws Exception {
+ public void routesContainerIdentifier() {
assertEquals(IPV4_ROUTES_IDENTIFIER, MULTI_PATH_ABSTRACT_TEST.routesContainerIdentifier());
}
@Test
- public void routeAttributesIdentifier() throws Exception {
+ public void routeAttributesIdentifier() {
assertEquals(new NodeIdentifier(QName.create(Ipv4Routes.QNAME,
Attributes.QNAME.getLocalName().intern())), MULTI_PATH_ABSTRACT_TEST.routeAttributesIdentifier());
}
@Test
- public void routePath() throws Exception {
+ public void routePath() {
Assert.assertEquals(LOC_RIB_TARGET.node(ROUTES_IDENTIFIER)
.node(Ipv4Routes.QNAME).node(Ipv4Route.QNAME).node(PREFIX_NII),
MULTI_PATH_ABSTRACT_TEST.routePath(LOC_RIB_TARGET.node(Routes.QNAME), PREFIX_NII));
}
@Test
- public void changedRoutes() throws Exception {
+ 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));
}
@Test
- public void putRoutes() throws Exception {
+ public void putRoutes() {
MULTI_PATH_ABSTRACT_TEST.putRoutes(this.tx, LOC_RIB_TARGET, this.nlri, this.attributes);
assertFalse(this.routes.isEmpty());
}
@Test
- public void deleteRoutes() throws Exception {
+ public void deleteRoutes() {
MULTI_PATH_ABSTRACT_TEST.deleteRoutes(this.tx, LOC_RIB_TARGET, this.nlri);
assertTrue(this.routes.isEmpty());
}
@Test
- public void buildUpdate() throws Exception {
+ public void buildUpdate() {
final Ipv4NextHopCase nextHop = new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder()
.setGlobal(new Ipv4Address("10.0.0.2")).build()).build();
final Attributes attr = new AttributesBuilder().setCNextHop(nextHop).build();
import java.util.Collection;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.protocol.bgp.rib.spi.MultiPathAbstractRIBSupport;
-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.Route;
}
@Override
- public Route createRoute(final Route route, final Identifier routeKey, final PathId pathId
+ public Route createRoute(final Route route, final Identifier routeKey, final long pathId
, final Attributes attributes) {
return null;
}