From 9916153467456756d7f6a8678bb2ee1b990915e5 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 2 Sep 2019 19:30:16 +0200 Subject: [PATCH] Bump mdsal to 5.0.2 This bumps mdsal to 5.0.2 as part of Magnesium MRI. Change-Id: Id9ab45edf28477dca8acf8f7538cfd26f237f6f4 Signed-off-by: Robert Varga --- .../odl-netconf-connector/pom.xml | 2 +- .../src/main/feature/feature.xml | 2 +- features/netconf/odl-netconf-api/pom.xml | 2 +- .../src/main/feature/feature.xml | 4 ++-- .../odl-netconf-notifications-impl/pom.xml | 2 +- features/restconf/odl-restconf-common/pom.xml | 2 +- .../src/main/feature/feature.xml | 2 +- .../restconf/odl-restconf-nb-bierman02/pom.xml | 2 +- .../netconf/callhome/mount/ContextKey.java | 3 ++- .../netconf/callhome/mount/ContextKeyTest.java | 5 +++-- .../impl/ops/NotificationsTransformUtil.java | 3 ++- .../impl/SessionNotificationProducerTest.java | 3 ++- .../rev190107/GetDataInputMaxDepthBuilder.java | 6 ++++-- .../commands/NetconfConnectDeviceCommand.java | 4 ++-- .../console/impl/NetconfCommandsImpl.java | 3 ++- .../console/impl/NetconfCommandsImplTest.java | 6 ++++-- .../netconf/impl/NetconfServerSession.java | 3 ++- .../netconf/impl/NetconfServerSessionTest.java | 6 +++--- ...NetconfCapabilityMonitoringServiceTest.java | 3 ++- .../NetconfSessionMonitoringServiceTest.java | 5 +++-- .../singleton/impl/NetconfTopologyManager.java | 6 +++--- .../impl/RemoteDeviceConnectorImpl.java | 15 ++++++++------- .../impl/utils/NetconfTopologyUtils.java | 2 +- .../singleton/impl/MountPointEndToEndTest.java | 3 ++- .../singleton/impl/NetconfNodeManagerTest.java | 3 ++- .../impl/NetconfTopologyManagerTest.java | 9 +++++---- .../impl/RemoteDeviceConnectorImplTest.java | 7 ++++--- .../impl/utils/NetconfTopologyUtilTest.java | 4 +++- .../topology/AbstractNetconfTopology.java | 18 +++++++++--------- .../impl/NetconfConnectorFactoryImpl.java | 3 ++- .../topology/impl/NetconfTopologyImplTest.java | 13 +++++++------ .../sal/connect/netconf/NetconfDevice.java | 3 ++- .../sal/NetconfDeviceTopologyAdapter.java | 9 +++++---- .../util/NetconfTopologyRPCProviderTest.java | 3 ++- .../tool/monitoring/MonitoringSession.java | 10 +++++----- parent/pom.xml | 2 +- .../restconf/impl/Bierman02RestConfWiring.java | 18 ++++++++++-------- .../restconf/impl/RestconfProviderImpl.java | 2 +- 38 files changed, 112 insertions(+), 86 deletions(-) diff --git a/features/netconf-connector/odl-netconf-connector/pom.xml b/features/netconf-connector/odl-netconf-connector/pom.xml index b7d2f71c19..b07997f252 100644 --- a/features/netconf-connector/odl-netconf-connector/pom.xml +++ b/features/netconf-connector/odl-netconf-connector/pom.xml @@ -28,7 +28,7 @@ org.opendaylight.mdsal mdsal-artifacts - 4.0.6 + 5.0.2 pom import diff --git a/features/netconf-connector/odl-netconf-connector/src/main/feature/feature.xml b/features/netconf-connector/odl-netconf-connector/src/main/feature/feature.xml index 316b72a40f..c7229c63aa 100644 --- a/features/netconf-connector/odl-netconf-connector/src/main/feature/feature.xml +++ b/features/netconf-connector/odl-netconf-connector/src/main/feature/feature.xml @@ -8,6 +8,6 @@ --> - odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal + odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal diff --git a/features/netconf/odl-netconf-api/pom.xml b/features/netconf/odl-netconf-api/pom.xml index 9f52743564..6283e7d48f 100644 --- a/features/netconf/odl-netconf-api/pom.xml +++ b/features/netconf/odl-netconf-api/pom.xml @@ -35,7 +35,7 @@ org.opendaylight.mdsal mdsal-artifacts - 4.0.6 + 5.0.2 pom import diff --git a/features/netconf/odl-netconf-api/src/main/feature/feature.xml b/features/netconf/odl-netconf-api/src/main/feature/feature.xml index a3cc391761..6e41d22b1a 100644 --- a/features/netconf/odl-netconf-api/src/main/feature/feature.xml +++ b/features/netconf/odl-netconf-api/src/main/feature/feature.xml @@ -10,7 +10,7 @@ odl-netty-4 odl-yangtools-parser-api - odl-mdsal-model-rfc7895 - odl-mdsal-model-rfc8342 + odl-mdsal-model-rfc7895 + odl-mdsal-model-rfc8342 diff --git a/features/netconf/odl-netconf-notifications-impl/pom.xml b/features/netconf/odl-netconf-notifications-impl/pom.xml index 15534e46b9..215bf41a5c 100644 --- a/features/netconf/odl-netconf-notifications-impl/pom.xml +++ b/features/netconf/odl-netconf-notifications-impl/pom.xml @@ -28,7 +28,7 @@ org.opendaylight.mdsal mdsal-artifacts - 4.0.6 + 5.0.2 pom import diff --git a/features/restconf/odl-restconf-common/pom.xml b/features/restconf/odl-restconf-common/pom.xml index 8be85a50ee..934e0fb791 100644 --- a/features/restconf/odl-restconf-common/pom.xml +++ b/features/restconf/odl-restconf-common/pom.xml @@ -35,7 +35,7 @@ org.opendaylight.mdsal mdsal-artifacts - 4.0.6 + 5.0.2 pom import diff --git a/features/restconf/odl-restconf-common/src/main/feature/feature.xml b/features/restconf/odl-restconf-common/src/main/feature/feature.xml index 342ceb01e5..fc4b06de98 100644 --- a/features/restconf/odl-restconf-common/src/main/feature/feature.xml +++ b/features/restconf/odl-restconf-common/src/main/feature/feature.xml @@ -10,6 +10,6 @@ odl-karaf-feat-jetty odl-yangtools-export - odl-mdsal-model-rfc7895 + odl-mdsal-model-rfc7895 diff --git a/features/restconf/odl-restconf-nb-bierman02/pom.xml b/features/restconf/odl-restconf-nb-bierman02/pom.xml index f436663069..4d1647aa44 100644 --- a/features/restconf/odl-restconf-nb-bierman02/pom.xml +++ b/features/restconf/odl-restconf-nb-bierman02/pom.xml @@ -28,7 +28,7 @@ org.opendaylight.mdsal mdsal-artifacts - 4.0.6 + 5.0.2 pom import diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/ContextKey.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/ContextKey.java index 9f422d109e..2a08683d3b 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/ContextKey.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/ContextKey.java @@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; +import org.opendaylight.yangtools.yang.common.Uint16; class ContextKey { private final IpAddress address; @@ -77,7 +78,7 @@ class ContextKey { checkArgument(ipAddress instanceof Inet6Address); yangIp = new IpAddress(IetfInetUtil.INSTANCE.ipv6AddressFor(ipAddress)); } - return new ContextKey(yangIp, new PortNumber(inetSocketAddr.getPort())); + return new ContextKey(yangIp, new PortNumber(Uint16.valueOf(inetSocketAddr.getPort()))); } @Override diff --git a/netconf/callhome-provider/src/test/java/org/opendaylight/netconf/callhome/mount/ContextKeyTest.java b/netconf/callhome-provider/src/test/java/org/opendaylight/netconf/callhome/mount/ContextKeyTest.java index ae4ccc8649..09fc7e1ab4 100644 --- a/netconf/callhome-provider/src/test/java/org/opendaylight/netconf/callhome/mount/ContextKeyTest.java +++ b/netconf/callhome-provider/src/test/java/org/opendaylight/netconf/callhome/mount/ContextKeyTest.java @@ -27,6 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. 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.inet.types.rev130715.PortNumber; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; +import org.opendaylight.yangtools.yang.common.Uint16; public class ContextKeyTest { private IpAddress address1; @@ -48,8 +49,8 @@ public class ContextKeyTest { address1 = IpAddressBuilder.getDefaultInstance("1.2.3.4"); address2 = IpAddressBuilder.getDefaultInstance("5.6.7.8"); - port1 = new PortNumber(123); - port2 = new PortNumber(456); + port1 = new PortNumber(Uint16.valueOf(123)); + port2 = new PortNumber(Uint16.valueOf(456)); mockNode = mock(NetconfNode.class); mockSession = mock(NetconfClientSession.class); diff --git a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/ops/NotificationsTransformUtil.java b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/ops/NotificationsTransformUtil.java index f54bc811de..664d6a69f9 100644 --- a/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/ops/NotificationsTransformUtil.java +++ b/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/ops/NotificationsTransformUtil.java @@ -43,7 +43,8 @@ public final class NotificationsTransformUtil { moduleInfoBackedContext.addModuleInfos(Collections.singletonList($YangModuleInfoImpl.getInstance())); moduleInfoBackedContext.addModuleInfos(Collections.singletonList(org.opendaylight.yang.gen.v1.urn.ietf.params .xml.ns.yang.ietf.netconf.notifications.rev120206.$YangModuleInfoImpl.getInstance())); - final Optional schemaContextOptional = moduleInfoBackedContext.tryToCreateSchemaContext(); + final Optional schemaContextOptional = + moduleInfoBackedContext.tryToCreateSchemaContext(); checkState(schemaContextOptional.isPresent()); NOTIFICATIONS_SCHEMA_CTX = schemaContextOptional.get(); diff --git a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/SessionNotificationProducerTest.java b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/SessionNotificationProducerTest.java index 9cf18b9712..759aceca34 100644 --- a/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/SessionNotificationProducerTest.java +++ b/netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/SessionNotificationProducerTest.java @@ -37,6 +37,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.not import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.ZeroBasedCounter32; import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.common.Uint32; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -123,7 +124,7 @@ public class SessionNotificationProducerTest { .setSessionId(id) .setSourceHost(HostBuilder.getDefaultInstance("0.0.0.0")) .setUsername("user") - .setInRpcs(new ZeroBasedCounter32(inRpc)) + .setInRpcs(new ZeroBasedCounter32(Uint32.valueOf(inRpc))) .build(); } diff --git a/netconf/models/ietf-netconf-nmda/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/netconf/nmda/rev190107/GetDataInputMaxDepthBuilder.java b/netconf/models/ietf-netconf-nmda/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/netconf/nmda/rev190107/GetDataInputMaxDepthBuilder.java index 8899520844..eb68018605 100644 --- a/netconf/models/ietf-netconf-nmda/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/netconf/nmda/rev190107/GetDataInputMaxDepthBuilder.java +++ b/netconf/models/ietf-netconf-nmda/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/netconf/nmda/rev190107/GetDataInputMaxDepthBuilder.java @@ -4,11 +4,13 @@ * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html - */package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107; + */ +package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107; import java.util.Optional; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107.GetDataInput.MaxDepth; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107.GetDataInput.MaxDepth.Enumeration; +import org.opendaylight.yangtools.yang.common.Uint16; /** * MaxDepth utilities. @@ -24,6 +26,6 @@ public final class GetDataInputMaxDepthBuilder { return new MaxDepth(optEnum.get()); } // FIXME: consider being stricter about number formats here - return new MaxDepth(Integer.valueOf(defaultValue)); + return new MaxDepth(Uint16.valueOf(defaultValue)); } } diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfConnectDeviceCommand.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfConnectDeviceCommand.java index 578b49a4d3..8476772ac3 100644 --- a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfConnectDeviceCommand.java +++ b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfConnectDeviceCommand.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.netconf.console.commands; import static java.util.Objects.requireNonNull; @@ -31,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.parameters.protocol.specification.tls._case.TlsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder; +import org.opendaylight.yangtools.yang.common.Uint16; @Service @Command(name = "connect-device", scope = "netconf", description = "Connect to a netconf device.") @@ -132,7 +132,7 @@ public class NetconfConnectDeviceCommand implements Action { final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder(); netconfNodeBuilder.setHost(new Host(new IpAddress(new Ipv4Address(deviceIp)))) - .setPort(new PortNumber(Integer.decode(devicePort))) + .setPort(new PortNumber(Uint16.valueOf(Integer.decode(devicePort)))) .setTcpOnly(isTcpOnly) .setSchemaless(isSchemaless); diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java index 7c698b3162..50adf4b200 100644 --- a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java +++ b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java @@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -224,7 +225,7 @@ public class NetconfCommandsImpl implements NetconfCommands { new LoginPasswordBuilder().setPassword(newPassword).setUsername(newUsername).build(); final NetconfNode updatedNetconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address(deviceIp)))) - .setPort(new PortNumber(Integer.decode(devicePort))) + .setPort(new PortNumber(Uint16.valueOf(Integer.decode(devicePort)))) .setTcpOnly(tcpOnly) .setSchemaless(isSchemaless) .setCredentials(credentials) diff --git a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java index f8cb733ee1..e72b32de24 100644 --- a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java +++ b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java @@ -53,6 +53,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. 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.NodeBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; @@ -127,7 +128,8 @@ public class NetconfCommandsImplTest { @Test public void testConnectDisconnectDevice() throws InterruptedException, TimeoutException, ExecutionException { final NetconfNode netconfNode = new NetconfNodeBuilder() - .setPort(new PortNumber(7777)).setHost(HostBuilder.getDefaultInstance("10.10.1.1")).build(); + .setPort(new PortNumber(Uint16.valueOf(7777))).setHost(HostBuilder.getDefaultInstance("10.10.1.1")) + .build(); createTopology(LogicalDatastoreType.CONFIGURATION); netconfCommands.connectDevice(netconfNode, "netconf-ID"); @@ -229,7 +231,7 @@ public class NetconfCommandsImplTest { final NetconfNodeConnectionStatus.ConnectionStatus cs, final String notificationCapabilityPrefix) { final Host host = HostBuilder.getDefaultInstance(ip); - final PortNumber port = new PortNumber(portNumber); + final PortNumber port = new PortNumber(Uint16.valueOf(portNumber)); final List avCapList = new ArrayList<>(); avCapList.add(new AvailableCapabilityBuilder() diff --git a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java index bb0964bb58..97729f99ad 100644 --- a/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java +++ b/netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java @@ -43,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.mon import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.SessionKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.ZeroBasedCounter32; +import org.opendaylight.yangtools.yang.common.Uint32; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -144,7 +145,7 @@ public final class NetconfServerSession extends AbstractNetconfSession deviceHandler) { //setup default values since default value is not supported in mdsal final long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null - ? NetconfTopologyUtils.DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis(); + ? NetconfTopologyUtils.DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis().toJava(); final long keepaliveDelay = node.getKeepaliveDelay() == null - ? NetconfTopologyUtils.DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay(); + ? NetconfTopologyUtils.DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay().toJava(); final boolean reconnectOnChangedSchema = node.isReconnectOnChangedSchema() == null ? NetconfTopologyUtils.DEFAULT_RECONNECT_ON_CHANGED_SCHEMA : node.isReconnectOnChangedSchema(); @@ -215,7 +215,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { final Optional userCapabilities = getUserCapabilities(node); final int rpcMessageLimit = node.getConcurrentRpcLimit() == null - ? NetconfTopologyUtils.DEFAULT_CONCURRENT_RPC_LIMIT : node.getConcurrentRpcLimit(); + ? NetconfTopologyUtils.DEFAULT_CONCURRENT_RPC_LIMIT : node.getConcurrentRpcLimit().toJava(); if (rpcMessageLimit < 1) { LOG.info("{}: Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId); @@ -276,17 +276,18 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { //setup default values since default value is not supported in mdsal final long clientConnectionTimeoutMillis = node.getConnectionTimeoutMillis() == null - ? NetconfTopologyUtils.DEFAULT_CONNECTION_TIMEOUT_MILLIS : node.getConnectionTimeoutMillis(); + ? NetconfTopologyUtils.DEFAULT_CONNECTION_TIMEOUT_MILLIS : node.getConnectionTimeoutMillis().toJava(); final long maxConnectionAttempts = node.getMaxConnectionAttempts() == null - ? NetconfTopologyUtils.DEFAULT_MAX_CONNECTION_ATTEMPTS : node.getMaxConnectionAttempts(); + ? NetconfTopologyUtils.DEFAULT_MAX_CONNECTION_ATTEMPTS : node.getMaxConnectionAttempts().toJava(); final int betweenAttemptsTimeoutMillis = node.getBetweenAttemptsTimeoutMillis() == null - ? NetconfTopologyUtils.DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS : node.getBetweenAttemptsTimeoutMillis(); + ? NetconfTopologyUtils.DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS + : node.getBetweenAttemptsTimeoutMillis().toJava(); final boolean isTcpOnly = node.isTcpOnly() == null ? NetconfTopologyUtils.DEFAULT_IS_TCP_ONLY : node.isTcpOnly(); final BigDecimal sleepFactor = node.getSleepFactor() == null ? NetconfTopologyUtils.DEFAULT_SLEEP_FACTOR : node.getSleepFactor(); - final InetSocketAddress socketAddress = getSocketAddress(node.getHost(), node.getPort().getValue()); + final InetSocketAddress socketAddress = getSocketAddress(node.getHost(), node.getPort().getValue().toJava()); final ReconnectStrategyFactory sf = new TimedReconnectStrategyFactory(netconfTopologyDeviceSetup.getEventExecutor(), maxConnectionAttempts, diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java index 48cf059149..022005d6f5 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java @@ -214,7 +214,7 @@ public final class NetconfTopologyUtils { final IpAddress ipAddress = node.getHost().getIpAddress(); final InetSocketAddress address = new InetSocketAddress(ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue(), - node.getPort().getValue()); + node.getPort().getValue().toJava()); return new RemoteDeviceId(nodeId.getValue(), address); } diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java index baebc74d41..f626164bf4 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java @@ -132,6 +132,7 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcError.ErrorType; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -590,7 +591,7 @@ public class MountPointEndToEndTest { throws InterruptedException, ExecutionException, TimeoutException { final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(1234)) + .setPort(new PortNumber(Uint16.valueOf(1234))) .setActorResponseWaitTime(10) .setTcpOnly(Boolean.TRUE) .setSchemaless(Boolean.FALSE) diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java index 1a1fa38fb2..34ba4e6703 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java @@ -84,6 +84,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier; import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactory; import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; @@ -363,7 +364,7 @@ public class NetconfNodeManagerTest { private NetconfNode newNetconfNode() { return new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setConnectionStatus(NetconfNodeConnectionStatus.ConnectionStatus.Connected) .setClusteredConnectionStatus(new ClusteredConnectionStatusBuilder() .setNetconfMasterNode(masterAddress).build()) diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java index 721795f8b1..e58cbc7276 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java @@ -79,6 +79,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.Uint16; public class NetconfTopologyManagerTest { private static final int ACTOR_RESPONSE_WAIT_TIME = 10; @@ -187,7 +188,7 @@ public class NetconfTopologyManagerTest { final NetconfNode netconfNode1 = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(1111)) + .setPort(new PortNumber(Uint16.valueOf(1111))) .setActorResponseWaitTime(ACTOR_RESPONSE_WAIT_TIME) .build(); final Node node1 = new NodeBuilder().setNodeId(nodeId1).addAugmentation(NetconfNode.class, @@ -201,7 +202,7 @@ public class NetconfTopologyManagerTest { final NetconfNode netconfNode2 = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(2222)) + .setPort(new PortNumber(Uint16.valueOf(2222))) .setActorResponseWaitTime(ACTOR_RESPONSE_WAIT_TIME) .build(); final Node node2 = new NodeBuilder().setNodeId(nodeId2).addAugmentation(NetconfNode.class, @@ -249,7 +250,7 @@ public class NetconfTopologyManagerTest { mockContextMap.clear(); final NetconfNode updatedNetconfNode1 = new NetconfNodeBuilder(netconfNode1) - .setPort(new PortNumber(33333)).build(); + .setPort(new PortNumber(Uint16.valueOf(33333))).build(); final Node updatedNode1 = new NodeBuilder().setNodeId(nodeId1).addAugmentation(NetconfNode.class, updatedNetconfNode1).build(); @@ -345,7 +346,7 @@ public class NetconfTopologyManagerTest { final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(10)) + .setPort(new PortNumber(Uint16.valueOf(10))) .setActorResponseWaitTime(ACTOR_RESPONSE_WAIT_TIME).build(); final Node node = new NodeBuilder().setNodeId(nodeId).addAugmentation(NetconfNode.class, netconfNode).build(); diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImplTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImplTest.java index 5ecfe0cb60..6054a9b19d 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImplTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImplTest.java @@ -62,6 +62,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; 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.NodeBuilder; +import org.opendaylight.yangtools.yang.common.Uint16; import scala.concurrent.duration.Duration; public class RemoteDeviceConnectorImplTest { @@ -140,7 +141,7 @@ public class RemoteDeviceConnectorImplTest { .setPassword("admin").setUsername("admin").build(); final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -175,7 +176,7 @@ public class RemoteDeviceConnectorImplTest { .setPassword("admin").setUsername("admin").build(); final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -203,7 +204,7 @@ public class RemoteDeviceConnectorImplTest { public void testGetClientConfig() { final NetconfClientSessionListener listener = mock(NetconfClientSessionListener.class); final Host host = new Host(new IpAddress(new Ipv4Address("127.0.0.1"))); - final PortNumber portNumber = new PortNumber(9999); + final PortNumber portNumber = new PortNumber(Uint16.valueOf(9999)); final NetconfNode testingNode = new NetconfNodeBuilder() .setConnectionTimeoutMillis(1000L) .setDefaultRequestTimeoutMillis(2000L) diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtilTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtilTest.java index d84ca38dc5..9f95da5779 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtilTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtilTest.java @@ -23,13 +23,15 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. 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.NodeKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; public class NetconfTopologyUtilTest { @Test public void testCreateRemoteDeviceId() { final Host host = new Host(new IpAddress(new Ipv4Address("127.0.0.1"))); - final NetconfNode netconfNode = new NetconfNodeBuilder().setHost(host).setPort(new PortNumber(9999)).build(); + final NetconfNode netconfNode = new NetconfNodeBuilder().setHost(host) + .setPort(new PortNumber(Uint16.valueOf(9999))).build(); final NodeId nodeId = new NodeId("testing-node"); final RemoteDeviceId id = NetconfTopologyUtils.createRemoteDeviceId(nodeId, netconfNode); diff --git a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java index 691707aa84..17de4ef6c4 100644 --- a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java +++ b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java @@ -320,16 +320,16 @@ public abstract class AbstractNetconfTopology implements NetconfTopology { final NetconfNodeAugmentedOptional nodeOptional) { //setup default values since default value is not supported in mdsal final long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null - ? DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis(); + ? DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis().toJava(); final long keepaliveDelay = node.getKeepaliveDelay() == null - ? DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay(); + ? DEFAULT_KEEPALIVE_DELAY : node.getKeepaliveDelay().toJava(); final boolean reconnectOnChangedSchema = node.isReconnectOnChangedSchema() == null ? DEFAULT_RECONNECT_ON_CHANGED_SCHEMA : node.isReconnectOnChangedSchema(); final IpAddress ipAddress = node.getHost().getIpAddress(); final InetSocketAddress address = new InetSocketAddress(ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue(), - node.getPort().getValue()); + node.getPort().getValue().toJava()); final RemoteDeviceId remoteDeviceId = new RemoteDeviceId(nodeId.getValue(), address); RemoteDeviceHandler salFacade = @@ -387,8 +387,8 @@ public abstract class AbstractNetconfTopology implements NetconfTopology { } final Optional userCapabilities = getUserCapabilities(node); - final int rpcMessageLimit = - node.getConcurrentRpcLimit() == null ? DEFAULT_CONCURRENT_RPC_LIMIT : node.getConcurrentRpcLimit(); + final int rpcMessageLimit = node.getConcurrentRpcLimit() == null ? DEFAULT_CONCURRENT_RPC_LIMIT + : node.getConcurrentRpcLimit().toJava(); if (rpcMessageLimit < 1) { LOG.info("Concurrent rpc limit is smaller than 1, no limit will be enforced for device {}", remoteDeviceId); @@ -499,15 +499,15 @@ public abstract class AbstractNetconfTopology implements NetconfTopology { //setup default values since default value is not supported in mdsal final long clientConnectionTimeoutMillis = node.getConnectionTimeoutMillis() == null - ? DEFAULT_CONNECTION_TIMEOUT_MILLIS : node.getConnectionTimeoutMillis(); + ? DEFAULT_CONNECTION_TIMEOUT_MILLIS : node.getConnectionTimeoutMillis().toJava(); final long maxConnectionAttempts = node.getMaxConnectionAttempts() == null - ? DEFAULT_MAX_CONNECTION_ATTEMPTS : node.getMaxConnectionAttempts(); + ? DEFAULT_MAX_CONNECTION_ATTEMPTS : node.getMaxConnectionAttempts().toJava(); final int betweenAttemptsTimeoutMillis = node.getBetweenAttemptsTimeoutMillis() == null - ? DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS : node.getBetweenAttemptsTimeoutMillis(); + ? DEFAULT_BETWEEN_ATTEMPTS_TIMEOUT_MILLIS : node.getBetweenAttemptsTimeoutMillis().toJava(); final boolean useTcp = node.isTcpOnly() == null ? DEFAULT_IS_TCP_ONLY : node.isTcpOnly(); final BigDecimal sleepFactor = node.getSleepFactor() == null ? DEFAULT_SLEEP_FACTOR : node.getSleepFactor(); - final InetSocketAddress socketAddress = getSocketAddress(node.getHost(), node.getPort().getValue()); + final InetSocketAddress socketAddress = getSocketAddress(node.getHost(), node.getPort().getValue().toJava()); final ReconnectStrategyFactory sf = new TimedReconnectStrategyFactory(eventExecutor, maxConnectionAttempts, betweenAttemptsTimeoutMillis, sleepFactor); diff --git a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java index 460da7e300..f605c558e0 100644 --- a/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java +++ b/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java @@ -31,6 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,7 +65,7 @@ public class NetconfConnectorFactoryImpl implements NetconfConnectorFactory { .build()) .build(); final Host host = HostBuilder.getDefaultInstance(address); - final PortNumber portNumber = new PortNumber(port); + final PortNumber portNumber = new PortNumber(Uint16.valueOf(port)); final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(host) .setPort(portNumber) diff --git a/netconf/netconf-topology/src/test/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImplTest.java b/netconf/netconf-topology/src/test/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImplTest.java index 7fd0142965..55acaa519a 100644 --- a/netconf/netconf-topology/src/test/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImplTest.java +++ b/netconf/netconf-topology/src/test/java/org/opendaylight/netconf/topology/impl/NetconfTopologyImplTest.java @@ -68,6 +68,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository; public class NetconfTopologyImplTest { @@ -161,7 +162,7 @@ public class NetconfTopologyImplTest { final NetconfNode testingNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -203,7 +204,7 @@ public class NetconfTopologyImplTest { final NetconfNode testingNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -221,7 +222,7 @@ public class NetconfTopologyImplTest { final NetconfNode testingNode2 = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -239,7 +240,7 @@ public class NetconfTopologyImplTest { final NetconfNode testingNode3 = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -258,7 +259,7 @@ public class NetconfTopologyImplTest { final NetconfNode testingNode4 = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) @@ -306,7 +307,7 @@ public class NetconfTopologyImplTest { final String password = "pa$$word"; final NetconfNode netconfNode = new NetconfNodeBuilder() .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1")))) - .setPort(new PortNumber(9999)) + .setPort(new PortNumber(Uint16.valueOf(9999))) .setReconnectOnChangedSchema(true) .setDefaultRequestTimeoutMillis(1000L) .setBetweenAttemptsTimeoutMillis(100) diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java index 8171764e03..912e2508ba 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java @@ -186,7 +186,8 @@ public class NetconfDevice LOG.info("{} : Try to remount device.", id); onRemoteSessionDown(); salFacade.onDeviceReconnected(remoteSessionCapabilities, node); - }, nodeOptional.getIgnoreMissingSchemaSources().getReconnectTime(), TimeUnit.MILLISECONDS); + }, nodeOptional.getIgnoreMissingSchemaSources().getReconnectTime().toJava(), + TimeUnit.MILLISECONDS); return; } } diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java index d945986b44..208608744e 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java @@ -47,6 +47,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -82,7 +83,7 @@ public class NetconfDeviceTopologyAdapter implements AutoCloseable { NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder(); netconfNodeBuilder.setConnectionStatus(ConnectionStatus.Connecting); netconfNodeBuilder.setHost(id.getHost()); - netconfNodeBuilder.setPort(new PortNumber(id.getAddress().getPort())); + netconfNodeBuilder.setPort(new PortNumber(Uint16.valueOf(id.getAddress().getPort()))); nodeBuilder.addAugmentation(NetconfNode.class, netconfNodeBuilder.build()); Node node = nodeBuilder.build(); @@ -141,7 +142,7 @@ public class NetconfDeviceTopologyAdapter implements AutoCloseable { final NetconfNode data = new NetconfNodeBuilder() .setHost(id.getHost()) - .setPort(new PortNumber(id.getAddress().getPort())) + .setPort(new PortNumber(Uint16.valueOf(id.getAddress().getPort()))) .setConnectionStatus(ConnectionStatus.UnableToConnect).setConnectedMessage(reason).build(); final WriteTransaction writeTx = txChain.newWriteOnlyTransaction(); @@ -168,7 +169,7 @@ public class NetconfDeviceTopologyAdapter implements AutoCloseable { return new NetconfNodeBuilder() .setHost(id.getHost()) - .setPort(new PortNumber(id.getAddress().getPort())) + .setPort(new PortNumber(Uint16.valueOf(id.getAddress().getPort()))) .setConnectionStatus(connectionStatus) .setAvailableCapabilities(avCapabalitiesBuilder.build()) .setUnavailableCapabilities(unavailableCapabilities(capabilities.getUnresolvedCapabilites())) @@ -185,7 +186,7 @@ public class NetconfDeviceTopologyAdapter implements AutoCloseable { final NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder() .setHost(id.getHost()) - .setPort(new PortNumber(id.getAddress().getPort())) + .setPort(new PortNumber(Uint16.valueOf(id.getAddress().getPort()))) .setConnectionStatus(up ? ConnectionStatus.Connected : ConnectionStatus.Connecting) .setAvailableCapabilities(avCapabalitiesBuilder.build()) .setUnavailableCapabilities(unavailableCapabilities(capabilities.getUnresolvedCapabilites())) diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfTopologyRPCProviderTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfTopologyRPCProviderTest.java index 06b5bb78c4..9e711ad29a 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfTopologyRPCProviderTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfTopologyRPCProviderTest.java @@ -33,6 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev15 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.login.pw.LoginPasswordBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.common.Uint16; public class NetconfTopologyRPCProviderTest { private static final NodeId NODE_ID = new NodeId("testing-node"); @@ -91,7 +92,7 @@ public class NetconfTopologyRPCProviderTest { builder.setCredentials(credentials); builder.setHost(new Host(new IpAddress(new Ipv4Address("10.18.16.188")))); - builder.setPort(new PortNumber(830)); + builder.setPort(new PortNumber(Uint16.valueOf(830))); builder.setTcpOnly(Boolean.FALSE); builder.setNodeId(NODE_ID.toString()); return builder.build(); diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/monitoring/MonitoringSession.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/monitoring/MonitoringSession.java index c10784c3ba..94d46c18cc 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/monitoring/MonitoringSession.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/monitoring/MonitoringSession.java @@ -33,7 +33,7 @@ final class MonitoringSession { @XmlElement(name = "session-id") public long getId() { - return managementSession.getSessionId(); + return managementSession.getSessionId().longValue(); } @XmlElement(name = "source-host") @@ -53,22 +53,22 @@ final class MonitoringSession { @XmlElement(name = "in-bad-rpcs") public Long getInBadRpcs() { - return managementSession.getInBadRpcs().getValue(); + return managementSession.getInBadRpcs().getValue().longValue(); } @XmlElement(name = "in-rpcs") public Long getInRpcs() { - return managementSession.getInRpcs().getValue(); + return managementSession.getInRpcs().getValue().longValue(); } @XmlElement(name = "out-notifications") public Long getOutNotifications() { - return managementSession.getOutNotifications().getValue(); + return managementSession.getOutNotifications().getValue().longValue(); } @XmlElement(name = "out-rpc-errors") public Long getOutRpcErrors() { - return managementSession.getOutRpcErrors().getValue(); + return managementSession.getOutRpcErrors().getValue().longValue(); } @XmlElement(name = "transport") diff --git a/parent/pom.xml b/parent/pom.xml index 13ffc4399d..a1dd09099c 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.mdsal binding-parent - 4.0.6 + 5.0.2 diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/Bierman02RestConfWiring.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/Bierman02RestConfWiring.java index 1615e63fc0..18d19e4eaa 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/Bierman02RestConfWiring.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/Bierman02RestConfWiring.java @@ -22,6 +22,7 @@ import org.opendaylight.netconf.sal.restconf.web.WebInitializer; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; 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.inet.types.rev130715.PortNumber; +import org.opendaylight.yangtools.yang.common.Uint16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,18 +48,19 @@ public class Bierman02RestConfWiring { @Inject // The point of all the arguments here is simply to make your chosen Dependency Injection (DI) framework init. them - public Bierman02RestConfWiring(RestConfConfig config, - DOMSchemaService domSchemaService, DOMMountPointService domMountPointService, DOMRpcService domRpcService, - DOMDataBroker domDataBroker, DOMNotificationService domNotificationService, - ControllerContext controllerContext, RestconfApplication application, - BrokerFacade broker, RestconfImpl restconf, StatisticsRestconfServiceWrapper stats, - JSONRestconfServiceImpl jsonRestconfServiceImpl, - WebInitializer webInitializer) { + public Bierman02RestConfWiring(final RestConfConfig config, + final DOMSchemaService domSchemaService, final DOMMountPointService domMountPointService, + final DOMRpcService domRpcService, final DOMDataBroker domDataBroker, + final DOMNotificationService domNotificationService, final ControllerContext controllerContext, + final RestconfApplication application, final BrokerFacade broker, final RestconfImpl restconf, + final StatisticsRestconfServiceWrapper stats, final JSONRestconfServiceImpl jsonRestconfServiceImpl, + final WebInitializer webInitializer) { // WebSocket LOG.info("webSocketAddress = {}, webSocketPort = {}", config.webSocketAddress(), config.webSocketPort()); IpAddress wsIpAddress = IpAddressBuilder.getDefaultInstance(config.webSocketAddress().getHostAddress()); - this.webSocketServer = new RestconfProviderImpl(stats, wsIpAddress, new PortNumber(config.webSocketPort())); + this.webSocketServer = new RestconfProviderImpl(stats, wsIpAddress, + new PortNumber(Uint16.valueOf(config.webSocketPort()))); } @PostConstruct diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java index a78b9cc285..90abb177db 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java @@ -40,7 +40,7 @@ public class RestconfProviderImpl extends AbstractMXBean public void start() { this.webSocketServerThread = new Thread(WebSocketServer.createInstance( - websocketAddress.stringValue(), websocketPort.getValue())); + websocketAddress.stringValue(), websocketPort.getValue().toJava())); this.webSocketServerThread.setName("Web socket server on port " + websocketPort); this.webSocketServerThread.start(); -- 2.36.6