This bumps mdsal to 5.0.2 as part of Magnesium MRI.
Change-Id: I93e10e95b7a241d678829afb732e2adef82c1a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>4.0.6</version>
+ <version>5.0.2</version>
<relativePath/>
</parent>
<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>
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);
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;
}
<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>
// 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) {
}
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());
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);
}
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);
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)));
}
}
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;
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()));
}
}
final OvsdbTerminationPointAugmentation terminationPoint,
final Interface ovsInterface) {
- Integer ofPortRequest = terminationPoint.getOfportRequest();
+ Uint16 ofPortRequest = terminationPoint.getOfportRequest();
if (ofPortRequest != null) {
ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
}
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;
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()));
}
}
final OvsdbTerminationPointAugmentation terminationPoint,
final Interface ovsInterface) {
- Integer ofPortRequest = terminationPoint.getOfportRequest();
+ Uint16 ofPortRequest = terminationPoint.getOfportRequest();
if (ofPortRequest != null) {
ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
}
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());
}
}
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;
}
}
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;
// 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);
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
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)
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));
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);
}
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);
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);
}
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);
}
}
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);
}
}
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);
}