+ for (final DataTreeCandidateNode node : tablesChange.getChildNodes()) {
+ final boolean supportedTableAdded = this.peerPolicyTracker.onTablesChanged(peerIdOfNewPeer, node);
+ if (supportedTableAdded) {
+ for (Map.Entry<PathArgument, AbstractRouteEntry> entry : this.routeEntries.entrySet()) {
+ if(isTableSupported(peerIdOfNewPeer)) {
+ final AbstractRouteEntry routeEntry = entry.getValue();
+ final ContainerNode attributes = routeEntry.attributes();
+ final PathArgument routeId = entry.getKey();
+ final YangInstanceIdentifier routeTarget = getRouteTarget(rootPath, routeId);
+ final NormalizedNode<?, ?> value = routeEntry.createValue(routeId);
+ final PeerId routePeerId = RouterIds.createPeerId(routeEntry.getBestRouterId());
+ final ContainerNode effectiveAttributes = peerGroup.effectiveAttributes(routePeerId, attributes);
+
+ if (effectiveAttributes != null && value != null) {
+ LOG.debug("Write route {} to peer AdjRibsOut {}", value, peerIdOfNewPeer);
+ tx.put(LogicalDatastoreType.OPERATIONAL, routeTarget, value);
+ tx.put(LogicalDatastoreType.OPERATIONAL, routeTarget.node(this.attributesIdentifier), effectiveAttributes);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private YangInstanceIdentifier getRouteTarget(final YangInstanceIdentifier rootPath, final PathArgument routeId) {
+ return this.ribSupport.routePath(rootPath.node(AdjRibOut.QNAME).node(Tables.QNAME).node(this.tableKey).node(ROUTES_IDENTIFIER), routeId);
+ }
+
+ private void filterOutPeerRole(final DataTreeCandidateNode rootNode, final YangInstanceIdentifier rootPath) {
+ final DataTreeCandidateNode roleChange = rootNode.getModifiedChild(AbstractPeerRoleTracker.PEER_ROLE_NID);
+ if (roleChange != null) {
+ this.peerPolicyTracker.onDataTreeChanged(roleChange, IdentifierUtils.peerPath(rootPath));
+ }
+ }
+
+ private void updateNodes(final DataTreeCandidateNode table, final PeerId peerId, final DOMDataWriteTransaction tx, final Map<RouteUpdateKey, AbstractRouteEntry> routes) {
+ for (final DataTreeCandidateNode child : table.getChildNodes()) {
+ LOG.debug("Modification type {}", child.getModificationType());
+ if ((Attributes.QNAME).equals(child.getIdentifier().getNodeType())) {
+ if (child.getDataAfter().isPresent()) {
+ // putting uptodate attribute in
+ LOG.trace("Uptodate found for {}", child.getDataAfter());
+ tx.put(LogicalDatastoreType.OPERATIONAL, this.locRibTarget.node(child.getIdentifier()), child.getDataAfter().get());