use of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode 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.schema.UnkeyedListNode 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.");
}
}
use of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode in project bgpcep by opendaylight.
the class LinkstateRIBSupport method processRoute.
private void processRoute(final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes, final YangInstanceIdentifier routesPath, final ContainerNode attributes, final ApplyRoute function, final DOMDataWriteTransaction tx) {
if (maybeRoutes.isPresent()) {
final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
if (routes instanceof UnkeyedListNode) {
final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(this.route);
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);
}
}
}
Aggregations