use of org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode in project bgpcep by opendaylight.
the class EvpnNlriParser method extractDestination.
private static EvpnDestination extractDestination(final DataContainerNode<? extends PathArgument> evpnChoice, final ExtractionInterface extract) {
final EvpnRegistry reg = SimpleEvpnNlriRegistry.getInstance();
final ChoiceNode cont = (ChoiceNode) evpnChoice.getChild(EVPN_CHOICE_NID).get();
final EvpnChoice evpnValue = extract.check(reg, cont);
if (evpnValue == null) {
LOG.warn("Unrecognized Nlri {}", cont);
return null;
}
return new EvpnDestinationBuilder().setRouteDistinguisher(extractRouteDistinguisher(evpnChoice)).setEvpnChoice(evpnValue).build();
}
use of org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode in project bgpcep by opendaylight.
the class RouterIdParserTest method createRouterIdCase.
public static ChoiceNode createRouterIdCase() {
final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> nextHop = Builders.choiceBuilder();
nextHop.withNodeIdentifier(new NodeIdentifier(RouterIdGeneratedCase.QNAME));
return nextHop.addChild(createRouteContainer()).build();
}
use of org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode in project bgpcep by opendaylight.
the class FlowspecIpv4RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() throws Exception {
final Routes empty = new FlowspecRoutesCaseBuilder().setFlowspecRoutes(new FlowspecRoutesBuilder().setFlowspecRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
use of org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() throws Exception {
final Routes empty = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
use of org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode in project bgpcep by opendaylight.
the class IPv6RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() {
final Routes empty = new Ipv6RoutesCaseBuilder().setIpv6Routes(EMPTY_ROUTES).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
Aggregations