Migrate DataTreeCandidateNode methods 22/109922/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 08:17:19 +0000 (09:17 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 09:38:07 +0000 (10:38 +0100)
We have a few users of deprecated methods, let's migrate them.

Change-Id: Ie57ca80e63ff1efd0d864f87ad5acb48306da16c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/LocRibWriter.java

index ddd3069a5b624a34d14c9c62e2805f785d139142..79d4a59cac7d6c8d5f088e0791dd5adb0c6d027a 100644 (file)
@@ -108,8 +108,8 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
     public void onDataTreeChanged(final List<DataTreeCandidate> changes) {
         LOG.debug("Data change received for AdjRibOut {}", changes);
         for (var tc : changes) {
-            LOG.trace("Change {} type {}", tc.getRootNode(), tc.getRootNode().getModificationType());
-            for (var child : tc.getRootNode().getChildNodes()) {
+            LOG.trace("Change {} type {}", tc.getRootNode(), tc.getRootNode().modificationType());
+            for (var child : tc.getRootNode().childNodes()) {
                 for (var route : support.changedRoutes(child)) {
                     processRouteChange(route);
                 }
@@ -124,7 +124,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
 
     private void processRouteChange(final DataTreeCandidateNode route) {
         final Update update;
-        switch (route.getModificationType()) {
+        switch (route.modificationType()) {
             case UNMODIFIED:
                 LOG.debug("Skipping unmodified route {}", route.name());
                 return;
@@ -141,7 +141,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
                 LOG.debug("Advertising routes {}", update);
                 break;
             default:
-                LOG.warn("Ignoring unhandled modification type {}", route.getModificationType());
+                LOG.warn("Ignoring unhandled modification type {}", route.modificationType());
                 return;
         }
         session.write(update);
index 4a73bbec12564b4ef0a7556885400d4d6c1f86c8..f97892a5afc28575f175f5f4807299e2c762498a 100644 (file)
@@ -189,7 +189,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         for (final DataTreeCandidate tc : changes) {
             final YangInstanceIdentifier rootPath = tc.getRootPath();
             final DataTreeCandidateNode root = tc.getRootNode();
-            for (final DataTreeCandidateNode table : root.getChildNodes()) {
+            for (final DataTreeCandidateNode table : root.childNodes()) {
                 if (tx == null) {
                     tx = chain.newWriteOnlyTransaction();
                 }
@@ -289,7 +289,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         }
 
         final YangInstanceIdentifier effectiveTablePath = effectiveTablePath(tableKey);
-        final ModificationType modificationType = root.getModificationType();
+        final ModificationType modificationType = root.modificationType();
         LOG.debug("Effective table {} modification type {}", effectiveTablePath, modificationType);
         switch (modificationType) {
             case DISAPPEARED:
@@ -453,7 +453,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
             final YangInstanceIdentifier routesPath, final DataTreeCandidateNode route, final boolean longLivedStale) {
         LOG.debug("Process route {}", route.name());
         final YangInstanceIdentifier routePath = ribSupport.routePath(routesPath, route.name());
-        switch (route.getModificationType()) {
+        switch (route.modificationType()) {
             case DELETE:
             case DISAPPEARED:
                 deleteRoute(tx, ribSupport, routePath, route.dataBefore());
index 39c74959e19a5d4dc78d9f224a6759e7eacb1b7b..0e217ec6dab37b46cb7a4549c2acccae358fd102 100644 (file)
@@ -66,7 +66,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
@@ -290,7 +289,7 @@ final class LocRibWriter<C extends Routes & DataObject & ChoiceIn<Tables>, S ext
             final Uint32 pathId = ribSupport.extractPathId(routeId);
 
             RouteEntry<C, S> entry;
-            switch (route.getModificationType()) {
+            switch (route.modificationType()) {
                 case DELETE:
                     entry = routeEntries.get(routeKey);
                     if (entry != null) {
@@ -309,7 +308,7 @@ final class LocRibWriter<C extends Routes & DataObject & ChoiceIn<Tables>, S ext
                         entry = createEntry(routeKey);
                     }
 
-                    final NormalizedNode routeAfter = route.getDataAfter();
+                    final var routeAfter = route.getDataAfter();
                     verify(routeAfter instanceof MapEntryNode, "Unexpected route %s", routeAfter);
                     entry.addRoute(routerId, pathId, (MapEntryNode) routeAfter);
                     totalPathsCounter.increment();