package org.opendaylight.controller.config.yang.md.sal.connector.netconf;
import io.netty.channel.EventLoopGroup;
+import io.netty.util.concurrent.GlobalEventExecutor;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import org.opendaylight.controller.netconf.util.handler.ssh.authentication.AuthenticationHandler;
import org.opendaylight.controller.netconf.util.handler.ssh.authentication.LoginPassword;
import org.opendaylight.controller.sal.connect.netconf.NetconfDevice;
+import org.opendaylight.protocol.framework.ReconnectStrategy;
+import org.opendaylight.protocol.framework.TimedReconnectStrategy;
import org.osgi.framework.BundleContext;
import static com.google.common.base.Preconditions.*;
String addressValue = getAddress();
+ int attemptMsTimeout = 60*1000;
+ int connectionAttempts = 5;
/*
* Uncomment after Switch to IP Address
if(getAddress().getIpv4Address() != null) {
}
*/
+ ReconnectStrategy strategy = new TimedReconnectStrategy(GlobalEventExecutor.INSTANCE, attemptMsTimeout, 1000, 1.0, null,
+ Long.valueOf(connectionAttempts), null);
+
+
+ device.setStrategy(strategy);
+
InetAddress addr = InetAddresses.forString(addressValue);
InetSocketAddress socketAddress = new InetSocketAddress(addr , getPort().intValue());
device.setSocketAddress(socketAddress);
EventLoopGroup bossGroup = getBossThreadGroupDependency();
EventLoopGroup workerGroup = getWorkerThreadGroupDependency();
- Optional<SSLContext> maybeContext = Optional.absent();
NetconfClientDispatcher dispatcher = null;
if(getTcpOnly()) {
- dispatcher = new NetconfClientDispatcher(maybeContext , bossGroup, workerGroup);
+ dispatcher = new NetconfClientDispatcher( bossGroup, workerGroup);
} else {
AuthenticationHandler authHandler = new LoginPassword(getUsername(),getPassword());
dispatcher = new NetconfSshClientDispatcher(authHandler , bossGroup, workerGroup);