use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class IPv4RIBSupportTest method testRoutePath.
@Test
public void testRoutePath() {
final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(ROUTES);
assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class IPv6RIBSupportTest method testRoutePath.
@Test
public void testRoutePath() {
final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(ROUTES);
assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class AbstractIPRibSupport method processDestination.
@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath, final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
if (destination != null) {
final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination.getChild(this.nlriRoutesList);
if (maybeRoutes.isPresent()) {
final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
if (routes instanceof UnkeyedListNode) {
// Instance identifier to table/(choice routes)/(map of route)
// FIXME: cache on per-table basis (in TableContext, for example)
final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeNid());
for (final UnkeyedListEntryNode e : ((UnkeyedListNode) routes).getValue()) {
final NodeIdentifierWithPredicates routeKey = createRouteKey(e);
function.apply(tx, base, routeKey, e, attributes);
}
} else {
LOG.warn("Routes {} are not a map", routes);
}
}
}
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class VpnIpv4RIBSupportTest method testRoutePath.
@Test
public void testRoutePath() {
final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(ROUTES);
assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class AbstractVpnRIBSupport method processDestination.
@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath, final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
if (destination != null) {
final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination.getChild(this.nlriRoutesListNid);
if (maybeRoutes.isPresent()) {
final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
if (routes instanceof UnkeyedListNode) {
final UnkeyedListNode routeListNode = (UnkeyedListNode) routes;
LOG.debug("{} routes are found", routeListNode.getSize());
final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeNid());
for (final UnkeyedListEntryNode e : routeListNode.getValue()) {
final NodeIdentifierWithPredicates key = createRouteKey(e);
LOG.debug("Route {} is processed.", key);
function.apply(tx, base, key, e, attributes);
}
} else {
LOG.warn("Routes {} are not a map", routes);
}
}
} else {
LOG.debug("Destination is null.");
}
}
Aggregations