Fix findbugs violations in hwvtepsouthbound-impl
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-impl / src / main / java / org / opendaylight / ovsdb / hwvtepsouthbound / transactions / md / HwvtepPhysicalSwitchRemoveCommand.java
index d1b682d9b3f938fdaec4e92b1bd6195c138bf684..dc6562a1ce591da398833d4b0a358152e1de8fdb 100644 (file)
@@ -26,7 +26,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class HwvtepPhysicalSwitchRemoveCommand extends AbstractTransactionCommand {
 
-    public HwvtepPhysicalSwitchRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
+    public HwvtepPhysicalSwitchRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates,
+            DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
     }
 
@@ -34,17 +35,16 @@ public class HwvtepPhysicalSwitchRemoveCommand extends AbstractTransactionComman
     public void execute(ReadWriteTransaction transaction) {
         Collection<PhysicalSwitch> deletedPSRows =
                 TyperUtils.extractRowsRemoved(PhysicalSwitch.class, getUpdates(), getDbSchema()).values();
-        for (PhysicalSwitch pSwitch : deletedPSRows) {
+        for (PhysicalSwitch phySwitch : deletedPSRows) {
             InstanceIdentifier<Node> nodeIid = HwvtepSouthboundMapper.createInstanceIdentifier(
-                    getOvsdbConnectionInstance(), pSwitch);
+                    getOvsdbConnectionInstance(), phySwitch);
             InstanceIdentifier<Switches> switchIid = getOvsdbConnectionInstance().getInstanceIdentifier()
                     .augmentation(HwvtepGlobalAugmentation.class)
                     .child(Switches.class, new SwitchesKey(new HwvtepPhysicalSwitchRef(nodeIid)));
             // TODO handle removal of reference to managed switch from model
             transaction.delete(LogicalDatastoreType.OPERATIONAL, nodeIid);
             transaction.delete(LogicalDatastoreType.OPERATIONAL, switchIid);
-            getOvsdbConnectionInstance().getDeviceInfo().removePhysicalSwitch(pSwitch.getUuid());
+            getDeviceInfo().clearDeviceOperData(Node.class, switchIid);
         }
     }
-
 }