Convert dsbenchmark to mdsal APIs
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / listener / DsbenchmarkListener.java
index fcd2c1110b278701f59348fba511df4b10374d3c..75523eff7a7f61dc0bb093bde2563596ccd3ec5f 100644 (file)
@@ -5,16 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.dsbenchmark.listener;
 
 import java.util.Collection;
 import java.util.concurrent.atomic.AtomicInteger;
-
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+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;
@@ -23,12 +21,12 @@ import org.slf4j.LoggerFactory;
 
 public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
     private static final Logger LOG = LoggerFactory.getLogger(DsbenchmarkListener.class);
-    private AtomicInteger numEvents = new AtomicInteger(0);
-    private AtomicInteger numDataChanges = new AtomicInteger(0);
+    private final AtomicInteger numEvents = new AtomicInteger(0);
+    private final AtomicInteger numDataChanges = new AtomicInteger(0);
 
     @Override
     public void onDataTreeChanged(
-            Collection<DataTreeModification<TestExec>> changes) {
+            final Collection<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.
@@ -41,15 +39,15 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
         }
     }
 
-    private static synchronized void logDataTreeChangeEvent(int eventNum,
-            Collection<DataTreeModification<TestExec>> changes) {
+    private static synchronized void logDataTreeChangeEvent(final int eventNum,
+            final Collection<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<DataObjectModification<? extends DataObject>> modifications =
+            final Collection<? extends DataObjectModification<? extends DataObject>> modifications =
                     rootNode.getModifiedChildren();
 
             LOG.debug("    changeId {}, modType {}, mods: {}", changeId, modType, modifications.size());