Bump mdsal to 5.0.2 42/84442/8
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 14 Sep 2019 06:57:45 +0000 (08:57 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 10 Oct 2019 08:02:54 +0000 (10:02 +0200)
This bumps mdsal to 5.0.2 as part of Magnesium MRI.

Change-Id: I93e10e95b7a241d678829afb732e2adef82c1a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 files changed:
commons/binding-parent/pom.xml
hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundUtil.java
southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/SouthboundMapperTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommandTest.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java

index 499ea4fa3c183dd97403cf5cd2169d42d1d128e4..5a7fc5d6a96be975d50801ed25f9dc068d9d6fff 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>4.0.6</version>
+    <version>5.0.2</version>
     <relativePath/>
   </parent>
 
index 1484918a442466acf7da6e128e1907bb9b60439d..f512295f3b35bbffa43337c84dc42b051e557d37 100644 (file)
@@ -22,7 +22,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>4.0.6</version>
+                <version>5.0.2</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 39ac1e7eca558c1bea179cfd43946789e19139f4..349188345acb3c75d856d6abb3e39260773d217a 100644 (file)
@@ -184,7 +184,7 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo
         LOG.info("Connecting to {}", HwvtepSouthboundUtil.connectionInfoToString(hwvtepGlobal.getConnectionInfo()));
         InetAddress ip = HwvtepSouthboundMapper.createInetAddress(hwvtepGlobal.getConnectionInfo().getRemoteIp());
         OvsdbClient client = ovsdbConnectionService
-                        .connect(ip, hwvtepGlobal.getConnectionInfo().getRemotePort().getValue());
+                        .connect(ip, hwvtepGlobal.getConnectionInfo().getRemotePort().getValue().toJava());
         if (client != null) {
             putInstanceIdentifier(hwvtepGlobal.getConnectionInfo(), iid.firstIdentifierOf(Node.class));
             HwvtepConnectionInstance hwvtepConnectionInstance = connectedButCallBacksNotRegistered(client);
index bb98aa1df0acfd37021872453004e9417d567f3e..e7023b43d02be7d3a5bea0de14add17788ff3b7d 100644 (file)
@@ -217,7 +217,7 @@ public final class HwvtepSouthboundUtil {
     public static Integer getRemotePort(Node node) {
         HwvtepGlobalAugmentation augmentation = node.augmentation(HwvtepGlobalAugmentation.class);
         if (augmentation != null && augmentation.getConnectionInfo() != null) {
-            return augmentation.getConnectionInfo().getRemotePort().getValue();
+            return augmentation.getConnectionInfo().getRemotePort().getValue().toJava();
         }
         return 0;
     }
index 3599852e6d70d2029788c4eb14e7676aff72f200..c6f5eb42f904c1ae4b5ae872bac7809889b9f886 100644 (file)
@@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>4.0.6</version>
+                <version>5.0.2</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 8ba2a3011483847df08a74133e2bc17e5e928b81..30b17a64a2121f1bf074fee97da9e02839b82c25 100644 (file)
@@ -226,7 +226,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         // TODO and connected when writing to the operational store
         InetAddress ip = SouthboundMapper.createInetAddress(ovsdbNode.getConnectionInfo().getRemoteIp());
         OvsdbClient client = ovsdbConnection.connect(ip,
-                ovsdbNode.getConnectionInfo().getRemotePort().getValue());
+                ovsdbNode.getConnectionInfo().getRemotePort().getValue().toJava());
         // For connections from the controller to the ovs instance, the library doesn't call
         // this method for us
         if (client != null) {
@@ -624,7 +624,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
                 }
                 Futures.addCallback(readNodeFuture, new FutureCallback<Optional<Node>>() {
                     @Override
-                    public void onSuccess(@NonNull Optional<Node> node) {
+                    public void onSuccess(Optional<Node> node) {
                         if (node.isPresent()) {
                             LOG.info("Disconnected/Failed connection {} was controller initiated, attempting "
                                     + "reconnection", ovsdbNode.getConnectionInfo());
index 06ec6bdb2952d095be8dd4a2d1fbe0dfc3085883..fbc512d9cae2cada4faf4a526f4d876d8056bb9c 100644 (file)
@@ -108,7 +108,7 @@ public class AutoAttachUpdateCommand implements TransactCommand {
                     final Map<Long, Long> newMappings = new HashMap<>();
                     for (final Mappings mappings : mappingsList) {
                         final Long mappingsValue = new Long(mappings.getMappingsValue().toString());
-                        newMappings.put(mappings.getMappingsKey(), mappingsValue);
+                        newMappings.put(mappings.getMappingsKey().toJava(), mappingsValue);
                     }
                     autoAttachWrapper.setMappings(newMappings);
                 }
index 736fe4dbc1418c27b3943aabb8fe5a1b6bd1d267..18067b8e1cdd18eb12ef7938e4526d8ffd8f0bac 100644 (file)
@@ -70,10 +70,11 @@ public class ControllerUpdateCommand implements TransactCommand {
                             TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Controller.class);
                     controller.setTarget(controllerEntry.getTarget().getValue());
                     if (controllerEntry.getMaxBackoff() != null) {
-                        controller.setMaxBackoff(Collections.singleton(controllerEntry.getMaxBackoff()));
+                        controller.setMaxBackoff(Collections.singleton(controllerEntry.getMaxBackoff().toJava()));
                     }
                     if (controllerEntry.getInactivityProbe() != null) {
-                        controller.setInactivityProbe(Collections.singleton(controllerEntry.getInactivityProbe()));
+                        controller.setInactivityProbe(Collections.singleton(
+                            controllerEntry.getInactivityProbe().toJava()));
                     }
                     String controllerNamedUuidString = SouthboundMapper.getRandomUuid();
                     UUID controllerNamedUuid = new UUID(controllerNamedUuidString);
index 210429c11e845e94835454fc4f7005bcb1ae6724..46703757584767073f866cadf71dc253e802516d 100644 (file)
@@ -81,7 +81,7 @@ public class QosUpdateCommand implements TransactCommand {
             if (queueList != null && !queueList.isEmpty()) {
                 for (QueueList queue : queueList) {
                     if (queue.getQueueRef() != null) {
-                        newQueueList.put(queue.getQueueNumber(),
+                        newQueueList.put(queue.getQueueNumber().toJava(),
                                 new UUID(getQueueUuid(queue.getQueueRef(), operNode)));
                     }
                 }
index de0758134941d5c12794189b70278f24cf75fabf..be357416ec4d3e3a0164d66f84eb2ff75f62606f 100644 (file)
@@ -54,6 +54,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 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;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -163,9 +165,9 @@ public class TerminationPointCreateCommand implements TransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Interface ovsInterface) {
 
-        Long ofPort = terminationPoint.getOfport();
+        Uint32 ofPort = terminationPoint.getOfport();
         if (ofPort != null) {
-            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
+            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort.toJava()));
         }
     }
 
@@ -173,7 +175,7 @@ public class TerminationPointCreateCommand implements TransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Interface ovsInterface) {
 
-        Integer ofPortRequest = terminationPoint.getOfportRequest();
+        Uint16 ofPortRequest = terminationPoint.getOfportRequest();
         if (ofPortRequest != null) {
             ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
         }
index f06b982a0ca85b05e3fcff9deeabc350c708396d..76f2544d7e82ae52873797321a70516bcab4f7da 100644 (file)
@@ -53,6 +53,8 @@ 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.ovsdb.port._interface.attributes.Trunks;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -210,9 +212,9 @@ public class TerminationPointUpdateCommand implements TransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Interface ovsInterface) {
 
-        Long ofPort = terminationPoint.getOfport();
+        Uint32 ofPort = terminationPoint.getOfport();
         if (ofPort != null) {
-            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
+            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort.toJava()));
         }
     }
 
@@ -220,7 +222,7 @@ public class TerminationPointUpdateCommand implements TransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Interface ovsInterface) {
 
-        Integer ofPortRequest = terminationPoint.getOfportRequest();
+        Uint16 ofPortRequest = terminationPoint.getOfportRequest();
         if (ofPortRequest != null) {
             ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
         }
@@ -321,13 +323,13 @@ public class TerminationPointUpdateCommand implements TransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Interface ovsInterface) {
 
-        Long ingressPolicingRate = terminationPoint.getIngressPolicingRate();
+        Uint32 ingressPolicingRate = terminationPoint.getIngressPolicingRate();
         if (ingressPolicingRate != null) {
-            ovsInterface.setIngressPolicingRate(ingressPolicingRate);
+            ovsInterface.setIngressPolicingRate(ingressPolicingRate.toJava());
         }
-        Long ingressPolicingBurst = terminationPoint.getIngressPolicingBurst();
+        Uint32 ingressPolicingBurst = terminationPoint.getIngressPolicingBurst();
         if (ingressPolicingBurst != null) {
-            ovsInterface.setIngressPolicingBurst(ingressPolicingBurst);
+            ovsInterface.setIngressPolicingBurst(ingressPolicingBurst.toJava());
         }
     }
 
index caf634d576b52836e8a9e988d0b601f76dd36c81..df19a15b17fb22f8b866c2cea6d5063c20d52acf 100644 (file)
@@ -94,7 +94,7 @@ public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
             This is to handle the controller initiated connection scenario, where all the controller will connect, but
             switch will have only one manager.
             */
-            if (onlyConnectedManager.getNumberOfConnections() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
+            if (onlyConnectedManager.getNumberOfConnections().toJava() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
                 return false;
             }
         }
index 0eaab99ab479a9757fe231333007b5914bfd5f77..53754cce5be3b458092cf9955314f9dc6be873ee 100644 (file)
@@ -54,6 +54,7 @@ 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.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.powermock.api.mockito.PowerMockito;
 import org.powermock.api.support.membermodification.MemberMatcher;
 import org.powermock.api.support.membermodification.MemberModifier;
@@ -336,7 +337,7 @@ public class OvsdbConnectionManagerTest {
 //        when(OvsdbConnectionService.getService()).thenReturn(ovsdbConnection);
         PortNumber port = mock(PortNumber.class);
         when(connectionInfo.getRemotePort()).thenReturn(port);
-        when(port.getValue()).thenReturn(8080);
+        when(port.getValue()).thenReturn(Uint16.valueOf(8080));
         OvsdbClient client = mock(OvsdbClient.class);
         when(ovsdbConnection.connect(any(InetAddress.class), anyInt())).thenReturn(client);
 
index 46531545821b1ebf136bd3f08a47b87307dbd931..c4898229a117339b14eb0b3d2d574a68c7f7b4eb 100644 (file)
@@ -304,9 +304,9 @@ public class SouthboundMapperTest {
 
         ConnectionInfo returnedConnectionInfo = SouthboundMapper.createConnectionInfo(client);
         assertEquals(IpAddressBuilder.getDefaultInstance("1.2.3.4"), returnedConnectionInfo.getRemoteIp());
-        assertEquals(8080, (int) returnedConnectionInfo.getRemotePort().getValue());
+        assertEquals(8080, returnedConnectionInfo.getRemotePort().getValue().toJava());
         assertEquals(IpAddressBuilder.getDefaultInstance("1.2.3.5"), returnedConnectionInfo.getLocalIp());
-        assertEquals(8081, (int) returnedConnectionInfo.getLocalPort().getValue());
+        assertEquals(8081, returnedConnectionInfo.getLocalPort().getValue().toJava());
     }
 
     @Test
index 63254eecc493aaddc079eeb4d468c618bf7a7f55..8d9e5219dfe986f2ff4b6dee619dfd841755b4e7 100644 (file)
@@ -38,6 +38,7 @@ 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.ovsdb.node.attributes.ManagerEntry;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.powermock.reflect.Whitebox;
 
 @RunWith(MockitoJUnitRunner.class)
@@ -110,6 +111,7 @@ public class OvsdbNodeRemoveCommandTest {
         when(ovsdbNodeAugmentation.getManagerEntry()).thenReturn(listManagerEntry);
         when(manager.isConnected()).thenReturn(true, false, true);
         when(manager1.isConnected()).thenReturn(true, false, true);
+        when(manager.getNumberOfConnections()).thenReturn(Uint32.valueOf(0));
         assertEquals(false,
                 Whitebox.invokeMethod(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", ovsdbNodeAugmentation));
 
index f7bb1d373f433da95eca498a9969775c8d873398..e64f10ee4b698f9831c1d1f62396a40b1cbb6ce1 100644 (file)
@@ -1351,7 +1351,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                         terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
                 if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
-                    Long ifIndex = ovsdbTerminationPointAugmentation.getIfindex();
+                    Long ifIndex = ovsdbTerminationPointAugmentation.getIfindex().toJava();
                     Assert.assertNotNull(ifIndex);
                     LOG.info("ifIndex: {} for the port:{}", ifIndex, portName);
                 }
@@ -1389,7 +1389,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                         terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
                 if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
-                    Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
+                    Long ofPort = ovsdbTerminationPointAugmentation.getOfport().toJava();
                     // if ephemeral port 45002 is in use, ofPort is set to 1
                     Assert.assertTrue(ofPort.equals(ofportExpected) || ofPort.equals(1L));
                     LOG.info("ofPort: {}", ofPort);
@@ -1435,12 +1435,12 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                         terminationPoint.augmentation(OvsdbTerminationPointAugmentation.class);
                 if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
-                    Long ofPort = ovsdbTerminationPointAugmentation.getOfport();
+                    Long ofPort = ovsdbTerminationPointAugmentation.getOfport().toJava();
                     // if ephemeral port 45008 is in use, ofPort is set to 1
                     Assert.assertTrue(ofPort.equals(ofportExpected) || ofPort.equals(1L));
                     LOG.info("ofPort: {}", ofPort);
 
-                    Integer ofPortRequest = ovsdbTerminationPointAugmentation.getOfportRequest();
+                    Integer ofPortRequest = ovsdbTerminationPointAugmentation.getOfportRequest().toJava();
                     Assert.assertTrue(ofPortRequest.equals(ofPortRequestExpected));
                     LOG.info("ofPortRequest: {}", ofPortRequest);
                 }
@@ -1750,7 +1750,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
                     VlanId actualVlanId = ovsdbTerminationPointAugmentation.getVlanTag();
                     Assert.assertNotNull(actualVlanId);
-                    Integer actualVlanIdInt = actualVlanId.getValue();
+                    Integer actualVlanIdInt = actualVlanId.getValue().toJava();
                     Assert.assertEquals(createdVlanId, actualVlanIdInt);
                 }
             }
@@ -1783,7 +1783,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 if (ovsdbTerminationPointAugmentation.getName().equals(portName)) {
                     VlanId actualVlanId = ovsdbTerminationPointAugmentation.getVlanTag();
                     Assert.assertNotNull(actualVlanId);
-                    Integer actualVlanIdInt = actualVlanId.getValue();
+                    Integer actualVlanIdInt = actualVlanId.getValue().toJava();
                     Assert.assertEquals(updatedVlanId, actualVlanIdInt);
                 }
             }
@@ -2380,7 +2380,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                         LogicalDatastoreType.OPERATIONAL);
                 Queues operQueue = getQueue(new Uri(testQueueId), ovsdbNodeAugmentation);
                 Assert.assertNotNull(operQueue);
-                Short operDscp = operQueue.getDscp();
+                Short operDscp = operQueue.getDscp().toJava();
                 Assert.assertNotNull(operDscp);
                 Assert.assertEquals(dscp, operDscp);
             }