private static final Logger LOG = LoggerFactory.getLogger(LocRibWriter.class);
private static final LeafNode<Boolean> ATTRIBUTES_UPTODATE_TRUE = ImmutableNodes.leafNode(QName.create(Attributes.QNAME, "uptodate"), Boolean.TRUE);
+ private static final NodeIdentifier ROUTES_IDENTIFIER = new NodeIdentifier(Routes.QNAME);
private final Map<PathArgument, AbstractRouteEntry> routeEntries = new HashMap<>();
private final YangInstanceIdentifier locRibTarget;
final RIBSupportContext ribCtx = this.registry.getRIBSupportContext(this.tableKey);
// FIXME: the table should be created for a peer only once
ribCtx.clearTable(tx, pid.getValue().node(AdjRibOut.QNAME).node(Tables.QNAME).node(this.tableKey));
- final YangInstanceIdentifier routeTarget = this.ribSupport.routePath(pid.getValue().node(AdjRibOut.QNAME).node(Tables.QNAME).node(this.tableKey).node(Routes.QNAME), key.getRouteId());
+ final YangInstanceIdentifier routeTarget = this.ribSupport.routePath(pid.getValue().node(AdjRibOut.QNAME).node(Tables.QNAME).node(this.tableKey).node(ROUTES_IDENTIFIER), key.getRouteId());
if (effectiveAttributes != null && value != null && !peerId.equals(pid.getKey())) {
LOG.debug("Write route to AdjRibsOut {}", value);
tx.put(LogicalDatastoreType.OPERATIONAL, routeTarget, value);
* @param listClass Binding class of the route list, nust not be null;
*/
protected AbstractRIBSupport(final Class<? extends Routes> cazeClass, final Class<? extends DataObject> containerClass, final Class<? extends Route> listClass) {
- final QName qname = BindingReflections.findQName(containerClass);
+ final QName qname = QName.cachedReference(BindingReflections.findQName(containerClass));
this.routesContainerIdentifier = new NodeIdentifier(qname);
this.routeAttributesIdentifier = new NodeIdentifier(QName.cachedReference(QName.create(qname, Attributes.QNAME.getLocalName())));
this.cazeClass = Preconditions.checkNotNull(cazeClass);
this.containerClass = Preconditions.checkNotNull(containerClass);
this.listClass = Preconditions.checkNotNull(listClass);
- this.routesListIdentifier = new NodeIdentifier(BindingReflections.findQName(listClass));
+ this.routesListIdentifier = new NodeIdentifier(QName.cachedReference(BindingReflections.findQName(listClass)));
}
@Override