@Nonnull @Override public final PathArgument getRouteIdAddPath(final long pathId, final PathArgument routeId) { return PathIdUtil.createNidKey(pathId, routeId, routeQName(), pathIdQName(), routeKeyQName()); }
/** * Prefix and Path Id are the route key * * @param prefixes UnkeyedListEntryNode containing route * @return Nid with Route Key */ private NodeIdentifierWithPredicates createRouteKey(final UnkeyedListEntryNode prefixes) { final Optional<DataContainerChild<? extends PathArgument, ?>> maybePrefixLeaf = prefixes.getChild(routePrefixIdentifier()); final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf = prefixes.getChild(routePathIdNid()); Preconditions.checkState(maybePrefixLeaf.isPresent()); final Object prefixValue = (maybePrefixLeaf.get()).getValue(); return PathIdUtil.createNidKey(routeQName(), routeKeyQName(), pathIdQName(), prefixValue, maybePathIdLeaf); } }
@Override protected final void processDestination( final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath, final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function ) { if (destination != null) { final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeQName()); final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf = destination.getChild(routePathIdNid()); final String routeKeyValue = this.nlriParser.stringNlri(destination); final NodeIdentifierWithPredicates routeKey = PathIdUtil.createNidKey(routeQName(), routeKeyQName(), pathIdQName(), routeKeyValue, maybePathIdLeaf); function.apply(tx, base, routeKey, destination, attributes); } } }