Fix findbugs violations in hwvtepsouthbound-impl
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-impl / src / main / java / org / opendaylight / ovsdb / hwvtepsouthbound / transactions / md / HwvtepPhysicalLocatorRemoveCommand.java
index 78872c8d45ea2c9f6d60b5aac961b7e89625b38c..4b59ab9e7d19e93909db8aaca3a961a6e043971b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2015 - 2017 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,7 +9,6 @@
 package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md;
 
 import java.util.Collection;
-
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance;
@@ -24,7 +23,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class HwvtepPhysicalLocatorRemoveCommand extends AbstractTransactionCommand {
 
-    public HwvtepPhysicalLocatorRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) {
+    public HwvtepPhysicalLocatorRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates,
+            DatabaseSchema dbSchema) {
         super(key, updates, dbSchema);
     }
 
@@ -32,14 +32,14 @@ public class HwvtepPhysicalLocatorRemoveCommand extends AbstractTransactionComma
     public void execute(ReadWriteTransaction transaction) {
         Collection<PhysicalLocator> deletedPLRows =
                 TyperUtils.extractRowsRemoved(PhysicalLocator.class, getUpdates(), getDbSchema()).values();
-        for (PhysicalLocator pLoc : deletedPLRows) {
+        for (PhysicalLocator locator : deletedPLRows) {
             final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier();
             final InstanceIdentifier<TerminationPoint> nodePath = HwvtepSouthboundMapper
-                    .createInstanceIdentifier(connectionIId, pLoc);
+                    .createInstanceIdentifier(connectionIId, locator);
             transaction.delete(LogicalDatastoreType.OPERATIONAL, nodePath);
-            getOvsdbConnectionInstance().getDeviceInfo().removePhysicalLocator(pLoc.getUuid());
+            getOvsdbConnectionInstance().getDeviceInfo().clearDeviceOperData(TerminationPoint.class, nodePath);
+
             //TODO: Check if any cleanup is required
         }
     }
-
 }