Remove SouthboundUtil::deleteNode() 26/33626/1
authorStephen Kitt <skitt@redhat.com>
Wed, 27 Jan 2016 12:41:53 +0000 (13:41 +0100)
committerStephen Kitt <skitt@redhat.com>
Wed, 27 Jan 2016 12:41:53 +0000 (13:41 +0100)
This method is unused and, since it doesn't use the transaction
invoker, potentially dangerous.

Change-Id: Ibbc674a5983d8e52094888a58eb6c7382daac467
Signed-off-by: Stephen Kitt <skitt@redhat.com>
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundUtil.java

index 2b80cdd3adcaad2d8e93c4d45568baff6b079f24..a62820cac51127402c420c992345834f2b3ee41f 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAttributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
@@ -117,20 +116,6 @@ public class SouthboundUtil {
         return node;
     }
 
-    public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean deleteNode(
-            ReadWriteTransaction transaction, final InstanceIdentifier<D> connectionIid) {
-        boolean result = false;
-        transaction.delete(LogicalDatastoreType.OPERATIONAL, connectionIid);
-        CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
-        try {
-            future.checkedGet();
-            result = true;
-        } catch (TransactionCommitFailedException e) {
-            LOG.warn("Failed to delete {} ", connectionIid, e);
-        }
-        return result;
-    }
-
     private static String getLocalControllerHostIpAddress() {
         String ipaddress = null;
         try {