From 342993c76488c53c53760a0ff1ad603aa6bf007b Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Wed, 20 Jun 2018 14:27:56 +0200 Subject: [PATCH] remove apparently un-used methods in AbstractTranscriberInterface These methods seems left overs; they have functionality comparable to other existing methods which are actually used, but these do not have the dependency checks hooks I've added; so just remove them: * addMd() * updateMd() * removeMd() JIRA: NEUTRON-158 Change-Id: If53bb7bce6c9cfcc2bd9fa640de3fd11e76c6513 Signed-off-by: Michael Vorburger --- .../AbstractTranscriberInterface.java | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractTranscriberInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractTranscriberInterface.java index 7ac1ba3c1..987d47816 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractTranscriberInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractTranscriberInterface.java @@ -343,17 +343,6 @@ public abstract class AbstractTranscriberInterface< updateMd(neutronObject, tx); } - protected boolean addMd(S neutronObject) { - try { - final WriteTransaction tx = getDataBroker().newWriteOnlyTransaction(); - addMd(neutronObject, tx); - return true; - } catch (InterruptedException | ExecutionException e) { - LOG.warn("Transaction failed", e); - } - return false; - } - private void updateMd(S neutronObject, WriteTransaction tx) throws InterruptedException, ExecutionException { Preconditions.checkNotNull(tx); @@ -365,26 +354,6 @@ public abstract class AbstractTranscriberInterface< future.get(); } - protected boolean updateMd(S neutronObject) { - int retries = RETRY_MAX; - while (retries-- >= 0) { - try { - final WriteTransaction tx = getDataBroker().newWriteOnlyTransaction(); - updateMd(neutronObject, tx); - return true; - } catch (InterruptedException | ExecutionException e) { - if (e.getCause() instanceof OptimisticLockFailedException) { - LOG.warn("Got OptimisticLockFailedException - {} {}", neutronObject, retries); - continue; - } - // TODO: rethrow exception. don't mask exception - LOG.error("Transaction failed", e); - } - break; - } - return false; - } - private void removeMd(T item, WriteTransaction tx) throws InterruptedException, ExecutionException { Preconditions.checkNotNull(tx); final InstanceIdentifier iid = createInstanceIdentifier(item); @@ -394,17 +363,6 @@ public abstract class AbstractTranscriberInterface< future.get(); } - protected boolean removeMd(T item) { - final ReadWriteTransaction tx = getDataBroker().newReadWriteTransaction(); - try { - removeMd(item, tx); - return true; - } catch (InterruptedException | ExecutionException e) { - LOG.warn("Transaction failed", e); - } - return false; - } - protected static Uuid toUuid(String uuid) { Preconditions.checkNotNull(uuid, "uuid"); Uuid result; -- 2.36.6