Bump upstreams
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / listener / DsbenchmarkListener.java
index 75523eff7a7f61dc0bb093bde2563596ccd3ec5f..34c2bfdb68c3984dde2acc600946b594dc8b0f20 100644 (file)
@@ -7,15 +7,11 @@
  */
 package org.opendaylight.dsbenchmark.listener;
 
-import java.util.Collection;
+import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-import org.opendaylight.mdsal.binding.api.DataObjectModification;
-import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -25,8 +21,7 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
     private final AtomicInteger numDataChanges = new AtomicInteger(0);
 
     @Override
-    public void onDataTreeChanged(
-            final Collection<DataTreeModification<TestExec>> changes) {
+    public void onDataTreeChanged(final List<DataTreeModification<TestExec>> changes) {
         // Since we're registering the same DsbenchmarkListener object for both
         // OPERATIONAL and CONFIG, the onDataTreeChanged() method can be called
         // from different threads, and we need to use atomic counters.
@@ -40,20 +35,19 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
     }
 
     private static synchronized void logDataTreeChangeEvent(final int eventNum,
-            final Collection<DataTreeModification<TestExec>> changes) {
+            final List<DataTreeModification<TestExec>> changes) {
         LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
 
-        for (DataTreeModification<TestExec> change : changes) {
-            final DataObjectModification<TestExec> rootNode = change.getRootNode();
-            final ModificationType modType = rootNode.getModificationType();
-            final PathArgument changeId = rootNode.getIdentifier();
-            final Collection<? extends DataObjectModification<? extends DataObject>> modifications =
-                    rootNode.getModifiedChildren();
+        for (var change : changes) {
+            final var rootNode = change.getRootNode();
+            final var modType = rootNode.modificationType();
+            final var changeId = rootNode.step();
+            final var modifications = rootNode.modifiedChildren();
 
             LOG.debug("    changeId {}, modType {}, mods: {}", changeId, modType, modifications.size());
 
-            for (DataObjectModification<? extends DataObject> mod : modifications) {
-                LOG.debug("      mod-getDataAfter: {}", mod.getDataAfter());
+            for (var mod : modifications) {
+                LOG.debug("      mod-getDataAfter: {}", mod.dataAfter());
             }
         }
     }