Bump upstreams to SNAPSHOTs
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / RemoteDeviceConnectorImpl.java
index a440979a562e46937995eb3e111260ca19b3026f..2546015548a91409c9ad446280f7d91b3bcd45dc 100644 (file)
@@ -68,6 +68,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.LoginPassword;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencrypted;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
@@ -99,9 +100,9 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
         this.netconfTopologyDeviceSetup = requireNonNull(netconfTopologyDeviceSetup);
         this.remoteDeviceId = remoteDeviceId;
         this.deviceActionFactory = requireNonNull(deviceActionFactory);
-        this.privateKeyPath = netconfTopologyDeviceSetup.getPrivateKeyPath();
-        this.privateKeyPassphrase = netconfTopologyDeviceSetup.getPrivateKeyPassphrase();
-        this.encryptionService = netconfTopologyDeviceSetup.getEncryptionService();
+        privateKeyPath = netconfTopologyDeviceSetup.getPrivateKeyPath();
+        privateKeyPassphrase = netconfTopologyDeviceSetup.getPrivateKeyPassphrase();
+        encryptionService = netconfTopologyDeviceSetup.getEncryptionService();
         keystoreAdapter = new NetconfKeystoreAdapter(netconfTopologyDeviceSetup.getDataBroker());
     }
 
@@ -113,7 +114,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
         requireNonNull(netconfNode.getHost());
         requireNonNull(netconfNode.getPort());
 
-        this.deviceCommunicatorDTO = createDeviceCommunicator(nodeId, netconfNode, deviceHandler);
+        deviceCommunicatorDTO = createDeviceCommunicator(nodeId, netconfNode, deviceHandler);
         final NetconfDeviceCommunicator deviceCommunicator = deviceCommunicatorDTO.getCommunicator();
         final NetconfClientSessionListener netconfClientSessionListener = deviceCommunicatorDTO.getSessionListener();
         final NetconfReconnectingClientConfiguration clientConfig =
@@ -282,14 +283,14 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
                 : node.getBetweenAttemptsTimeoutMillis().toJava();
         final boolean isTcpOnly = node.getTcpOnly() == null
                 ? NetconfTopologyUtils.DEFAULT_IS_TCP_ONLY : node.getTcpOnly();
-        final BigDecimal sleepFactor = node.getSleepFactor() == null
+        final Decimal64 sleepFactor = node.getSleepFactor() == null
                 ? NetconfTopologyUtils.DEFAULT_SLEEP_FACTOR : node.getSleepFactor();
 
         final InetSocketAddress socketAddress = getSocketAddress(node.getHost(), node.getPort().getValue().toJava());
 
         final ReconnectStrategyFactory sf =
-                new TimedReconnectStrategyFactory(netconfTopologyDeviceSetup.getEventExecutor(), maxConnectionAttempts,
-                        betweenAttemptsTimeoutMillis, sleepFactor);
+            new TimedReconnectStrategyFactory(netconfTopologyDeviceSetup.getEventExecutor(), maxConnectionAttempts,
+                betweenAttemptsTimeoutMillis, BigDecimal.valueOf(sleepFactor.unscaledValue(), sleepFactor.scale()));
 
 
         final NetconfReconnectingClientConfigurationBuilder reconnectingClientConfigurationBuilder;
@@ -326,7 +327,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
 
     private static List<Uri> getOdlHelloCapabilities(final NetconfNode node) {
         final OdlHelloMessageCapabilities helloCapabilities = node.getOdlHelloMessageCapabilities();
-        return helloCapabilities != null ? helloCapabilities.getCapability() : null;
+        return helloCapabilities != null ? List.copyOf(helloCapabilities.getCapability()) : null;
     }
 
     private AuthenticationHandler getHandlerFromCredentials(final Credentials credentials) {