final YangInstanceIdentifier routesPath = effectiveTablePath.node(childIdentifier);
switch (child.getModificationType()) {
case DELETE:
- case DISAPPEARED:
- processDeleteRouteTables(child, childIdentifier, ribSupport, routesPath);
- tx.delete(LogicalDatastoreType.OPERATIONAL, routesPath);
LOG.debug("Route deleted. routeId={}", routesPath);
+ processTableChildenDelete(child, childIdentifier, tx, ribSupport, routesPath);
+ break;
+ case DISAPPEARED:
+ LOG.debug("Route disappeared. routeId={}", routesPath);
+ processTableChildenDelete(child, childIdentifier, tx, ribSupport, routesPath);
break;
case UNMODIFIED:
// No-op
break;
case SUBTREE_MODIFIED:
- processModifiedRouteTables(child, childIdentifier,tx, ribSupport, routesPath, childDataAfter);
+ processModifiedRouteTables(child, childIdentifier, tx, ribSupport, routesPath, childDataAfter);
break;
case APPEARED:
case WRITE:
}
}
+ private void processTableChildenDelete(
+ final DataTreeCandidateNode child,
+ final PathArgument childIdentifier,
+ final DOMDataWriteTransaction tx,
+ final RIBSupport ribSupport,
+ final YangInstanceIdentifier routesPath) {
+ processDeleteRouteTables(child, childIdentifier, ribSupport, routesPath);
+ tx.delete(LogicalDatastoreType.OPERATIONAL, routesPath);
+ }
+
private void processDeleteRouteTables(
final DataTreeCandidateNode child,
final PathArgument childIdentifier,
*/
package org.opendaylight.protocol.bgp.rib.spi;
+import static com.google.common.base.Verify.verify;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
@Override
public R fromNormalizedNode(final YangInstanceIdentifier routePath, final NormalizedNode<?, ?> normalizedNode) {
- return (R) this.mappingService.fromNormalizedNode(routePath, normalizedNode).getValue();
+ final DataObject node = this.mappingService.fromNormalizedNode(routePath, normalizedNode).getValue();
+ verify(node instanceof Route, "node %s is not a Route", node);
+ return (R) node;
}
@Override