Migrate elanmanager to use LoggingFutures
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / listeners / HwvtepNodeBaseListener.java
index 3c6ed7b857f9b706682d4e69aed921fcccf944ed..d87fe75850dee38ad981886ae936d1ffff836995 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.infrautils.metrics.Labeled;
 import org.opendaylight.infrautils.metrics.Meter;
 import org.opendaylight.infrautils.metrics.MetricDescriptor;
 import org.opendaylight.infrautils.metrics.MetricProvider;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.netvirt.elan.l2gw.ha.HwvtepHAUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation;
@@ -139,7 +139,7 @@ public abstract class HwvtepNodeBaseListener<D extends Datastore>
 
     @Override
     public void onDataTreeChanged(final Collection<DataTreeModification<Node>> changes) {
-        HAJobScheduler.getInstance().submitJob(() -> ListenableFutures.addErrorLogging(
+        HAJobScheduler.getInstance().submitJob(() -> LoggingFutures.addErrorLogging(
             txRunner.callWithNewReadWriteTransactionAndSubmit(datastoreType, tx -> {
                 processConnectedNodes(changes, tx);
                 processUpdatedNodes(changes, tx);
@@ -163,7 +163,7 @@ public abstract class HwvtepNodeBaseListener<D extends Datastore>
                     onGlobalNodeUpdate(key, updated, original, mod, tx);
                     subMod = change.getRootNode().getModifiedAugmentation(HwvtepGlobalAugmentation.class);
                 } else {
-                    onPsNodeUpdate(updated, original, mod, tx);
+                    onPsNodeUpdate(updated, mod, tx);
                     subMod = change.getRootNode().getModifiedAugmentation(PhysicalSwitchAugmentation.class);
                 }
                 if (subMod != null) {
@@ -174,7 +174,8 @@ public abstract class HwvtepNodeBaseListener<D extends Datastore>
     }
 
     private String logicalSwitchNameFromChildMod(DataObjectModification<? extends DataObject> childMod) {
-        DataObject data = childMod.getDataAfter() != null ? childMod.getDataAfter() : childMod.getDataBefore();
+        DataObject dataAfter = childMod.getDataAfter();
+        DataObject data = dataAfter != null ? dataAfter : childMod.getDataBefore();
         return LOGICAL_SWITCH_EXTRACTOR.getOrDefault(childMod.getModificationType().getClass(), noLogicalSwitch)
                 .apply(data);
     }
@@ -290,7 +291,7 @@ public abstract class HwvtepNodeBaseListener<D extends Datastore>
 
     }
 
-    void onPsNodeUpdate(Node updated, Node original,
+    void onPsNodeUpdate(Node updated,
                         DataObjectModification<Node> mod, TypedReadWriteTransaction<D> tx)
             throws ReadFailedException, InterruptedException, ExecutionException {