Fix deprecation warnings around addAugmentation() 54/92254/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Aug 2020 08:39:59 +0000 (10:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Aug 2020 09:21:53 +0000 (11:21 +0200)
These are mostly trivial fixes to eliminate warnings reported around
addAugmentation() method.

Change-Id: Ie17450891ed2c75861249a6ccb3f178ca3a8890f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
24 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/GlobalConfigOperationalChangeGetter.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/SwitchConfigOperationalChangeGetter.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/GlobalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalSwitchUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepManagerUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalPortUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepUcastMacsLocalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepUcastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DataChangeListenerTestBase.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionInvokerImplTest.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/ReconciliationTaskManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommandTest.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java
utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java

index e41b00f360b8dda5d31c9f5d900be484038307f7..4b731b9ce4f31dd1e19ce47df200871a87cf0bcc 100644 (file)
@@ -44,8 +44,8 @@ public final class GlobalConfigOperationalChangeGetter {
         //fire removal of local ucast macs so that logical switches will be deleted
         fillLocalMacsToBeRemoved(oldAugmentation, configNode, opNode);
 
-        newNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, newAugmentation.build());
-        oldNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, oldAugmentation.build());
+        newNodeBuilder.addAugmentation(newAugmentation.build());
+        oldNodeBuilder.addAugmentation(oldAugmentation.build());
 
         return new DataTreeModificationImpl<>(nodeId, newNodeBuilder.build(), oldNodeBuilder.build());
     }
index 2c9d93b30d1765386178718a8fc9d4de9731bb24..53c178aaa27b9c1ccfb8c075b9074e8048f0610a 100644 (file)
@@ -80,7 +80,7 @@ public final class SwitchConfigOperationalChangeGetter {
             if (augmentation != null && augmentation.getVlanBindings() != null
                     && !augmentation.getVlanBindings().isEmpty()) {
                 builder.setVlanBindings(augmentation.getVlanBindings());
-                terminationPointBuilder.addAugmentation(HwvtepPhysicalPortAugmentation.class, builder.build());
+                terminationPointBuilder.addAugmentation(builder.build());
 
                 final TerminationPoint newTp = terminationPointBuilder.build();
                 result.put(newTp.key(), newTp);
index 7e94e9cdc43fc55665032d7eeeff10d29db09e55..2cbfe99bbc8e5561e539aafa188916fd208e439a 100644 (file)
@@ -61,7 +61,7 @@ public class GlobalUpdateCommand extends AbstractTransactionCommand {
             NodeBuilder nodeBuilder = new NodeBuilder();
             nodeBuilder.setNodeId(getNodeId(hwvtepGlobal));
             HwvtepGlobalAugmentation hwvtepGlobalAugmentation = hwvtepGlobalBuilder.build();
-            nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, hwvtepGlobalAugmentation);
+            nodeBuilder.addAugmentation(hwvtepGlobalAugmentation);
             transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath, nodeBuilder.build());
             getOvsdbConnectionInstance().setHwvtepGlobalAugmentation(hwvtepGlobalAugmentation);
             addToDeviceUpdate(TransactionType.ADD, hwvtepGlobal);
index 1b1f2cc5f5a026fddf1902483ee6b08e9cb0bf04..15d34e74780beb5a093b527bb5456d1ad49724ea 100644 (file)
@@ -102,9 +102,7 @@ public class HwvtepLogicalRouterUpdateCommand extends AbstractTransactionCommand
 
         List<LogicalRouters> routers = new ArrayList<>();
         routers.add(lrBuilder.build());
-        HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
-        hgAugmentationBuilder.setLogicalRouters(routers);
-        connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+        connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLogicalRouters(routers).build());
         return connectionNode.build();
     }
 
index 2d3386da12af6a7172e111140b46f0df8d4b2511..05e486c7c4f9bb320c03811939973a6f3f94234b 100644 (file)
@@ -101,10 +101,7 @@ public class HwvtepLogicalSwitchUpdateCommand extends AbstractTransactionCommand
         List<LogicalSwitches> switches = new ArrayList<>();
         switches.add(lsBuilder.build());
 
-        HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
-        hgAugmentationBuilder.setLogicalSwitches(switches);
-        connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+        connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLogicalSwitches(switches).build());
         return connectionNode.build();
     }
-
 }
index 96afaac43bc8653f7b8a22623fb46ffa181690ba..5c6a6e7984a597a80f89d2504a120d8d3d6c39b7 100644 (file)
@@ -25,7 +25,6 @@ import org.opendaylight.ovsdb.schema.hardwarevtep.Manager;
 import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-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.HwvtepGlobalAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Managers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ManagersBuilder;
@@ -95,9 +94,7 @@ public class HwvtepManagerUpdateCommand extends AbstractTransactionCommand {
         List<Managers> managersList = new ArrayList<>();
         managersList.add(managersBuilder.build());
 
-        HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
-        hgAugmentationBuilder.setManagers(managersList);
-        connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+        connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setManagers(managersList).build());
         return connectionNode.build();
         // TODO Deletion of other config
     }
index ebe15f42cf7abfe93e1a7595f9e9f206e819aff2..da17e3f759fe26845dac0f35d3587f6096881ae0 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
@@ -71,7 +70,7 @@ public class HwvtepPhysicalLocatorUpdateCommand extends AbstractTransactionComma
                 tpAugmentationBuilder.setPhysicalLocatorUuid(new Uuid(locator.getUuid().toString()));
                 setEncapsType(tpAugmentationBuilder, locator);
                 setDstIp(tpAugmentationBuilder, locator);
-                tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
+                tpBuilder.addAugmentation(tpAugmentationBuilder.build());
                 if (oldPLocRows.containsKey(locUpdate.getKey())) {
                     transaction.merge(LogicalDatastoreType.OPERATIONAL,
                             tpPath, tpBuilder.build());
index 70123b194454cb9e2031ff953baa80936fe23ffc..8c61643e670c2ff387cbc16bc70ed6142d66094a 100644 (file)
@@ -130,7 +130,7 @@ public class HwvtepPhysicalPortUpdateCommand extends AbstractTransactionCommand
                         new HwvtepPhysicalPortAugmentationBuilder();
                 buildTerminationPoint(tpAugmentationBuilder, portUpdate);
                 setPortFaultStatus(tpAugmentationBuilder, portUpdate);
-                tpBuilder.addAugmentation(HwvtepPhysicalPortAugmentation.class, tpAugmentationBuilder.build());
+                tpBuilder.addAugmentation(tpAugmentationBuilder.build());
                 if (oldPPRows.containsKey(portUpdateEntry.getKey())) {
                     transaction.merge(LogicalDatastoreType.OPERATIONAL, tpPath, tpBuilder.build());
                 } else {
index b3e3a9d9e00ec8504efb12d845fe4af7f32dd5e5..d4edea81d5b076db581586a51ad968ab69af08be 100644 (file)
@@ -158,7 +158,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman
         setTunnels(psAugmentationBuilder, phySwitch);
         setSwitchFaultStatus(psAugmentationBuilder, phySwitch);
 
-        psNodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, psAugmentationBuilder.build());
+        psNodeBuilder.addAugmentation(psAugmentationBuilder.build());
 
         LOG.trace("Built with the intent to store PhysicalSwitch data {}", psAugmentationBuilder.build());
         return psNodeBuilder.build();
index d36165a348a3f04bc28eb8f6fe8b5019b96784b6..0d73a3aa07a1778430088a8c8bf860b4c5d9ea13 100644 (file)
@@ -73,11 +73,9 @@ public class HwvtepUcastMacsLocalUpdateCommand extends AbstractTransactionComman
         //Update node with UcastMacsLocal reference
         NodeBuilder connectionNode = new NodeBuilder();
         connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
-        HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
         List<LocalUcastMacs> umclList = new ArrayList<>();
         ucml.forEach(mac -> umclList.add(buildLocalUcastMac(mac)));
-        hgAugmentationBuilder.setLocalUcastMacs(umclList);
-        connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+        connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLocalUcastMacs(umclList).build());
         return connectionNode.build();
     }
 
@@ -93,7 +91,7 @@ public class HwvtepUcastMacsLocalUpdateCommand extends AbstractTransactionComman
             UUID plocUUID = ucml.getLocatorColumn().getData();
             PhysicalLocator physicalLocator = updatedPLocRows.get(plocUUID);
             if (physicalLocator == null) {
-                physicalLocator = (PhysicalLocator) getOvsdbConnectionInstance()
+                physicalLocator = getOvsdbConnectionInstance()
                         .getDeviceInfo().getPhysicalLocator(plocUUID);
             }
             if (physicalLocator != null) {
index 936dc4646ddc6500e799373cfb354265260c1785..158bb578c2cd8319cf307901221e4a7aabee1a90 100644 (file)
@@ -66,11 +66,9 @@ public class HwvtepUcastMacsRemoteUpdateCommand extends AbstractTransactionComma
     private Node buildConnectionNode(final Collection<UcastMacsRemote> macRemotes) {
         NodeBuilder connectionNode = new NodeBuilder();
         connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
-        HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
         List<RemoteUcastMacs> remoteUMacs = new ArrayList<>();
         macRemotes.forEach(mac -> remoteUMacs.add(buildRemoteUcast(mac)));
-        hgAugmentationBuilder.setRemoteUcastMacs(remoteUMacs);
-        connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+        connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setRemoteUcastMacs(remoteUMacs).build());
         return connectionNode.build();
     }
 
@@ -87,8 +85,7 @@ public class HwvtepUcastMacsRemoteUpdateCommand extends AbstractTransactionComma
             UUID locUUID = macRemote.getLocatorColumn().getData();
             PhysicalLocator physicalLocator = updatedPLocRows.get(locUUID);
             if (physicalLocator == null) {
-                physicalLocator = (PhysicalLocator) getOvsdbConnectionInstance()
-                        .getDeviceInfo().getPhysicalLocator(locUUID);
+                physicalLocator = getOvsdbConnectionInstance().getDeviceInfo().getPhysicalLocator(locUUID);
             }
             if (physicalLocator != null) {
                 InstanceIdentifier<TerminationPoint> plIid = HwvtepSouthboundMapper.createInstanceIdentifier(nodeIid,
index 32419e0b22af93a775f1ac7be343f6178bd6447a..c95bdc3bdd07ff294bfb27907244c6fa509d11fa 100644 (file)
@@ -227,9 +227,7 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest {
     }
 
     void addNode(final LogicalDatastoreType logicalDatastoreType) throws Exception {
-        NodeBuilder nodeBuilder = prepareNode(nodeIid);
-        HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
-        nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+        NodeBuilder nodeBuilder = prepareNode(nodeIid).addAugmentation(new HwvtepGlobalAugmentationBuilder().build());
         WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
         transaction.mergeParentStructurePut(logicalDatastoreType, nodeIid, nodeBuilder.build());
         transaction.commit();
@@ -257,7 +255,7 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest {
         if (RemoteMcastMacs.class == dataObject) {
             TestBuilders.addRemoteMcastMacs(nodeIid, builder, data);
         }
-        nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+        nodeBuilder.addAugmentation(builder.build());
         return mergeNode(logicalDatastoreType, nodeIid, nodeBuilder);
     }
 
index 63ac489213f8c67c1a7793da7f57dbbce0570a07..c8427b890f911ec542ae39af551ee131b5304afe 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches;
@@ -111,12 +110,11 @@ public final class TestBuilders {
         if (nodeIid != null) {
             tpBuilder.withKey(tpKey);
             tpBuilder.setTpId(tpKey.getTpId());
-            HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder =
-                    new HwvtepPhysicalLocatorAugmentationBuilder();
-            tpAugmentationBuilder.setPhysicalLocatorUuid(getUUid(ip));
-            tpAugmentationBuilder.setEncapsulationType(HwvtepSouthboundMapper.createEncapsulationType(VXLAN_OVER_IPV4));
-            tpAugmentationBuilder.setDstIp(IpAddressBuilder.getDefaultInstance(ip));
-            tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
+            tpBuilder.addAugmentation(new HwvtepPhysicalLocatorAugmentationBuilder()
+                .setPhysicalLocatorUuid(getUUid(ip))
+                .setEncapsulationType(HwvtepSouthboundMapper.createEncapsulationType(VXLAN_OVER_IPV4))
+                .setDstIp(IpAddressBuilder.getDefaultInstance(ip))
+                .build());
         }
         return tpBuilder.build();
     }
index 2257e128d84eecaf6d0f279d0332280366bc793c..51651b48b858ca668a7f2c50febc338db973c6a9 100644 (file)
@@ -26,7 +26,6 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionCommand;
 import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvokerImpl;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-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.HwvtepGlobalAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
@@ -147,10 +146,8 @@ public class TransactionInvokerImplTest extends AbstractConcurrentDataBrokerTest
         public void execute(final ReadWriteTransaction transaction) {
             NodeBuilder nodeBuilder = new NodeBuilder();
             nodeBuilder.setNodeId(iid.firstKeyOf(Node.class).getNodeId());
-            HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
-            nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+            nodeBuilder.addAugmentation(new HwvtepGlobalAugmentationBuilder().build());
             transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, iid, nodeBuilder.build());
-
         }
     }
 
index d0cb4b76c4309d24fbf37a8d7ba668c3553115da..876bfc054b1e7ee2c1cdf1b7fac38b7c528be20f 100644 (file)
@@ -31,8 +31,8 @@ import org.slf4j.LoggerFactory;
 class ReconciliationTaskManager {
     private static final Logger LOG = LoggerFactory.getLogger(ReconciliationTaskManager.class);
 
-    private final ConcurrentHashMap<ReconciliationTask,Future<?>> reconciliationTaskCache
-            = new ConcurrentHashMap();
+    private final ConcurrentHashMap<ReconciliationTask, Future<?>> reconciliationTaskCache
+            = new ConcurrentHashMap<>();
 
     public boolean isTaskQueued(ReconciliationTask task) {
         return reconciliationTaskCache.containsKey(task);
index a74528a438d773f836977e90b5b15eb8337682ae..22b1e73857a28d1b1774f3c245992efe3c7aa14b 100644 (file)
@@ -89,12 +89,10 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand {
             setOtherConfig(transaction, ovsdbNodeBuilder, oldEntry, openVSwitch);
             ovsdbNodeBuilder.setConnectionInfo(getConnectionInfo());
 
-            NodeBuilder nodeBuilder = new NodeBuilder();
-            nodeBuilder.setNodeId(getNodeId(openVSwitch));
-            nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class,
-                    ovsdbNodeBuilder.build());
-            transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath,
-                    nodeBuilder.build());
+            transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath, new NodeBuilder()
+                .setNodeId(getNodeId(openVSwitch))
+                .addAugmentation(ovsdbNodeBuilder.build())
+                .build());
         }
     }
 
index b45c8d556ea7fb1d6695647ef7eaa9885e2a1602..8fd8f11fcd093347fd400715c142ccd175f0c1d3 100644 (file)
@@ -46,7 +46,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef;
-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.OvsdbNodeAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
@@ -222,7 +221,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         managedBridges.add(managedBridge);
         ovsdbConnectionAugmentationBuilder.setManagedNodeEntry(managedBridges);
 
-        connectionNode.addAugmentation(OvsdbNodeAugmentation.class, ovsdbConnectionAugmentationBuilder.build());
+        connectionNode.addAugmentation(ovsdbConnectionAugmentationBuilder.build());
 
         LOG.debug("Update node with bridge node ref {}",
                 ovsdbConnectionAugmentationBuilder.getManagedNodeEntry().values().iterator().next());
@@ -246,7 +245,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         setManagedBy(ovsdbBridgeAugmentationBuilder);
         setAutoAttach(ovsdbBridgeAugmentationBuilder, bridge);
         setStpEnalbe(ovsdbBridgeAugmentationBuilder,bridge);
-        bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+        bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
 
         LOG.debug("Built with the intent to store bridge data {}",
                 ovsdbBridgeAugmentationBuilder.build());
index 7e9094fa21c64bdf4f16cd9d032c487d8b572234..2ab8bc2fb51bedaf6d75ef6ac1acc890317fba5c 100644 (file)
@@ -153,7 +153,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
                     interfaceUpdatedRows.remove(interfaceUuid);
                     interfaceOldRows.remove(interfaceUuid);
                 }
-                tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
+                tpBuilder.addAugmentation(tpAugmentationBuilder.build());
                 if (portOldRows.containsKey(portUpdate.getKey()) && !portQosCleared(portUpdate)) {
                     updateToDataStore(transaction, tpBuilder, tpPath, true);
                     LOG.info("DEVICE - {} TerminationPoint : {} to Bridge : {}", TransactionType.ADD,
@@ -183,7 +183,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
                 OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
                         new OvsdbTerminationPointAugmentationBuilder();
                 buildTerminationPoint(tpAugmentationBuilder, interfaceUpdate.getValue());
-                tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
+                tpBuilder.addAugmentation(tpAugmentationBuilder.build());
                 NodeId bridgeId = SouthboundMapper.createManagedNodeId(bridgeIid.get());
                 InstanceIdentifier<TerminationPoint> tpPath = InstanceIdentifier
                         .create(NetworkTopology.class)
index f2ef95b07b0d11bcb203c8673f3035e0310ac209..385c5ae856eb42627aea32abd1ffa63ef5db241b 100644 (file)
@@ -88,7 +88,7 @@ public class OvsdbConnectionManagerTest {
         field(OvsdbConnectionManager.class, "entityOwnershipService").set(ovsdbConnManager, entityOwnershipService);
         field(OvsdbConnectionManager.class, "reconciliationManager").set(ovsdbConnManager, reconciliationManager);
         field(OvsdbConnectionManager.class, "ovsdbConnection").set(ovsdbConnManager, ovsdbConnection);
-        field(OvsdbConnectionManager.class, "alreadyProcessedClients").set(ovsdbConnManager, new HashMap());
+        field(OvsdbConnectionManager.class, "alreadyProcessedClients").set(ovsdbConnManager, new HashMap<>());
         entityConnectionMap = new ConcurrentHashMap<>();
 
         OvsdbConnectionInfo info = mock(OvsdbConnectionInfo.class);
index ec887065669b244dd13bee6d6ec2a41714cd9dbc..39be7443772ed9443096e6fd882b77fa34fc93f6 100644 (file)
@@ -142,8 +142,7 @@ public class OpenVSwitchUpdateCommandTest {
                         OpenVSwitch.class));
         when(nodeBuilder.setNodeId(any(NodeId.class))).thenReturn(nodeBuilder);
         when(ovsdbNodeBuilder.build()).thenReturn(mock(OvsdbNodeAugmentation.class));
-        when(nodeBuilder.addAugmentation(eq(OvsdbNodeAugmentation.class), any(OvsdbNodeAugmentation.class)))
-                .thenReturn(nodeBuilder);
+        when(nodeBuilder.addAugmentation(any(OvsdbNodeAugmentation.class))).thenReturn(nodeBuilder);
         when(nodeBuilder.build()).thenReturn(mock(Node.class));
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
         doNothing().when(transaction).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class),
index 6ef657d3077151b202be8290bb7c25a1accf2361..d00400ba6ca4f049d183bfbea75e22798b444179 100644 (file)
@@ -254,8 +254,7 @@ public class OvsdbBridgeUpdateCommandTest {
                 .thenReturn(ovsdbConnectionAugmentationBuilder);
 
         when(ovsdbConnectionAugmentationBuilder.build()).thenReturn(mock(OvsdbNodeAugmentation.class));
-        when(connectionNode.addAugmentation(eq(OvsdbNodeAugmentation.class), any(OvsdbNodeAugmentation.class)))
-                .thenReturn(connectionNode);
+        when(connectionNode.addAugmentation(any(OvsdbNodeAugmentation.class))).thenReturn(connectionNode);
 
         //for logger
         when(ovsdbConnectionAugmentationBuilder.getManagedNodeEntry())
@@ -305,8 +304,7 @@ public class OvsdbBridgeUpdateCommandTest {
                 OvsdbBridgeAugmentationBuilder.class));
 
         when(ovsdbBridgeAugmentationBuilder.build()).thenReturn(mock(OvsdbBridgeAugmentation.class));
-        when(bridgeNodeBuilder.addAugmentation(eq(OvsdbBridgeAugmentation.class), any(OvsdbBridgeAugmentation.class)))
-                .thenReturn(bridgeNodeBuilder);
+        when(bridgeNodeBuilder.addAugmentation(any(OvsdbBridgeAugmentation.class))).thenReturn(bridgeNodeBuilder);
         Node node = mock(Node.class);
         when(bridgeNodeBuilder.build()).thenReturn(node);
         assertEquals(node, Whitebox.invokeMethod(ovsdbBridgeUpdateCommand, "buildBridgeNode", bridge));
index 9fb4475a02ca14389a83c53cbc020f4af76756bb..73c0a8e03e8c9878f8aa80ae0fe8d5d649b8d9b2 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.ovsdb.southbound.transactions.md;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
@@ -229,8 +228,7 @@ public class OvsdbPortUpdateCommandTest {
                 OvsdbTerminationPointAugmentationBuilder.class, Interface.class));
 
         when(tpAugmentationBuilder.build()).thenReturn(mock(OvsdbTerminationPointAugmentation.class));
-        when(tpBuilder.addAugmentation(eq(OvsdbTerminationPointAugmentation.class),
-                any(OvsdbTerminationPointAugmentation.class))).thenReturn(tpBuilder);
+        when(tpBuilder.addAugmentation(any(OvsdbTerminationPointAugmentation.class))).thenReturn(tpBuilder);
         when(tpBuilder.build()).thenReturn(mock(TerminationPoint.class));
         portOldRows = new HashMap<>();
         portOldRows.put(uuid, port);
index 4a89b5dd07a8b146e3323da72cfc04bc0bc761e2..4327effff1e6c7740e77331c9dd700d36ee359fc 100644 (file)
@@ -841,11 +841,9 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         NodeBuilder portNodeBuilder = new NodeBuilder();
         NodeId portNodeId = SouthboundMapper.createManagedNodeId(portIid);
         portNodeBuilder.setNodeId(portNodeId);
-        TerminationPointBuilder entry = new TerminationPointBuilder();
-        entry.withKey(new TerminationPointKey(new TpId(portName)));
-        entry.addAugmentation(
-                OvsdbTerminationPointAugmentation.class,
-                ovsdbTerminationPointAugmentationBuilder.build());
+        TerminationPointBuilder entry = new TerminationPointBuilder()
+                .withKey(new TerminationPointKey(new TpId(portName)))
+                .addAugmentation(ovsdbTerminationPointAugmentationBuilder.build());
         portNodeBuilder.setTerminationPoint(Collections.singletonList(entry.build()));
         boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
                 portIid, portNodeBuilder.build());
@@ -901,7 +899,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             ovsdbBridgeAugmentationBuilder.setBridgeExternalIds(externalIds);
             ovsdbBridgeAugmentationBuilder.setControllerEntry(controllerEntries);
             ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
-            bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+            bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
             LOG.debug("Built with the intent to store bridge data {}", ovsdbBridgeAugmentationBuilder);
             Assert.assertTrue(
                     mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, bridgeNodeBuilder.build()));
@@ -1549,9 +1547,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                     portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
                     TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
                     tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(testBridgeAndPortName)));
-                    tpUpdateBuilder.addAugmentation(
-                            OvsdbTerminationPointAugmentation.class,
-                            tpUpdateAugmentationBuilder.build());
+                    tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
                     portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                     Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
                             portIid, portUpdateNodeBuilder.build()));
@@ -1781,9 +1777,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
             TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
             tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
-            tpUpdateBuilder.addAugmentation(
-                    OvsdbTerminationPointAugmentation.class,
-                    tpUpdateAugmentationBuilder.build());
+            tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
             tpUpdateBuilder.setTpId(new TpId(portName));
             portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
             Assert.assertTrue(
@@ -1849,9 +1843,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
                 TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
                 tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
-                tpUpdateBuilder.addAugmentation(
-                        OvsdbTerminationPointAugmentation.class,
-                        tpUpdateAugmentationBuilder.build());
+                tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
                 tpUpdateBuilder.setTpId(new TpId(portName));
                 portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                 Assert.assertTrue(
@@ -1942,9 +1934,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
                 TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
                 tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
-                tpUpdateBuilder.addAugmentation(
-                        OvsdbTerminationPointAugmentation.class,
-                        tpUpdateAugmentationBuilder.build());
+                tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
                 tpUpdateBuilder.setTpId(new TpId(portName));
                 portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                 Assert.assertTrue(
@@ -2004,9 +1994,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             tpUpdateAugmentationBuilder.setName(portName);
             TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
             tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
-            tpUpdateBuilder.addAugmentation(
-                    OvsdbTerminationPointAugmentation.class,
-                    tpUpdateAugmentationBuilder.build());
+            tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
             tpUpdateBuilder.setTpId(new TpId(portName));
 
             Assert.assertTrue(
@@ -2084,8 +2072,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                         SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"));
                 setManagedBy(bridgeCreateAugmentationBuilder, connectionInfo);
                 helper.writeValues(bridgeCreateAugmentationBuilder, updateFromTestCase.inputValues);
-                bridgeCreateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,
-                        bridgeCreateAugmentationBuilder.build());
+                bridgeCreateNodeBuilder.addAugmentation(bridgeCreateAugmentationBuilder.build());
                 LOG.debug("Built with the intent to store bridge data {}", bridgeCreateAugmentationBuilder);
                 Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid,
                         bridgeCreateNodeBuilder.build()));
@@ -2108,8 +2095,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 final Node bridgeNode = getBridgeNode(connectionInfo, testBridgeName);
                 bridgeUpdateNodeBuilder.setNodeId(bridgeNode.getNodeId());
                 bridgeUpdateNodeBuilder.withKey(bridgeNode.key());
-                bridgeUpdateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,
-                        bridgeUpdateAugmentationBuilder.build());
+                bridgeUpdateNodeBuilder.addAugmentation(bridgeUpdateAugmentationBuilder.build());
                 Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid,
                         bridgeUpdateNodeBuilder.build()));
                 Thread.sleep(OVSDB_UPDATE_TIMEOUT);
index d2e26f18380ed6b7a656c9017dd32338106fb684..955f18e8f70bbae70e5aaf389e50b868a3cd7e8a 100644 (file)
@@ -229,16 +229,14 @@ public class SouthboundUtils {
     }
 
     public static Node createNode(ConnectionInfo key) {
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()));
-        nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class, createOvsdbAugmentation(key));
-        return nodeBuilder.build();
+        return new NodeBuilder()
+                .setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()))
+                .addAugmentation(createOvsdbAugmentation(key))
+                .build();
     }
 
     public static OvsdbNodeAugmentation createOvsdbAugmentation(ConnectionInfo key) {
-        OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = new OvsdbNodeAugmentationBuilder();
-        ovsdbNodeBuilder.setConnectionInfo(key);
-        return ovsdbNodeBuilder.build();
+        return new OvsdbNodeAugmentationBuilder().setConnectionInfo(key).build();
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
@@ -618,7 +616,7 @@ public class SouthboundUtils {
             DatapathId datapathId = new DatapathId(dpid);
             ovsdbBridgeAugmentationBuilder.setDatapathId(datapathId);
         }
-        bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+        bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
         LOG.debug("Built with the intent to store bridge data {}",
                 ovsdbBridgeAugmentationBuilder.toString());
         boolean result = provider.merge(LogicalDatastoreType.CONFIGURATION,
@@ -686,7 +684,7 @@ public class SouthboundUtils {
             if (isOvsdbNodeDpdk(ovsdbNode)) {
                 ovsdbBridgeAugmentationBuilder.setDatapathType(DatapathTypeNetdev.class);
             }
-            bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+            bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
 
             Node node = bridgeNodeBuilder.build();
             result = provider.put(LogicalDatastoreType.CONFIGURATION, bridgeIid, node);
@@ -754,13 +752,12 @@ public class SouthboundUtils {
             return true;
         }
 
-        NodeBuilder nodeBuilder = new NodeBuilder(bridgeNode);
-        OvsdbBridgeAugmentationBuilder augBuilder = new OvsdbBridgeAugmentationBuilder(bridgeAug);
-
-        augBuilder.setControllerEntry(newControllerEntries);
-        nodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, augBuilder.build());
         InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName);
-        return provider.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, nodeBuilder.build());
+        return provider.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, new NodeBuilder(bridgeNode)
+            .addAugmentation(new OvsdbBridgeAugmentationBuilder(bridgeAug)
+                .setControllerEntry(newControllerEntries)
+                .build())
+            .build());
     }
 
     private static void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
@@ -810,11 +807,11 @@ public class SouthboundUtils {
             tpAugmentationBuilder.setInterfaceExternalIds(externalIdsList);
         }
 
-        TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
         InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
-        tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
-        tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
-        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+            .withKey(InstanceIdentifier.keyOf(tpIid))
+            .addAugmentation(tpAugmentationBuilder.build())
+            .build());
     }
 
     public Boolean addTerminationPoint(Node bridgeNode, String portName, String type) {
@@ -840,11 +837,11 @@ public class SouthboundUtils {
         }
         tpAugmentationBuilder.setOptions(optionsList);
 
-        TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
         InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
-        tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
-        tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
-        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+            .withKey(InstanceIdentifier.keyOf(tpIid))
+            .addAugmentation(tpAugmentationBuilder.build())
+            .build());
     }
 
     public Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type) {
@@ -856,10 +853,10 @@ public class SouthboundUtils {
         if (type != null) {
             tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type));
         }
-        TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
-        tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
-        tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
-        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+        return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+            .withKey(InstanceIdentifier.keyOf(tpIid))
+            .addAugmentation(tpAugmentationBuilder.build())
+            .build());
     }
 
     public Boolean addPatchTerminationPoint(Node node, String bridgeName, String portName, String peerPortName) {