X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fssh%2Fosgi%2FNetconfSSHActivator.java;h=fa87b73fad2b10bc977f0d88134c1fe21f5fb676;hp=b098329e4a01b13c33e737cf7315ad4746f13f92;hb=f1ca77023bf3fc98df26214d32360136b196e464;hpb=e28a4a816d824e65d12b81a7d0e7017dd6f4c919 diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java index b098329e4a..fa87b73fad 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java @@ -19,8 +19,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; -import org.apache.commons.io.FilenameUtils; import org.apache.sshd.common.util.ThreadUtils; import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider; import org.opendaylight.controller.netconf.ssh.SshProxyServer; @@ -38,7 +36,7 @@ public class NetconfSSHActivator implements BundleActivator { private static final java.lang.String ALGORITHM = "RSA"; private static final int KEY_SIZE = 4096; public static final int POOL_SIZE = 8; - private static final int DEFAULT_IDLE_TIMEOUT = (int) TimeUnit.MINUTES.toMillis(20); + private static final int DEFAULT_IDLE_TIMEOUT = Integer.MAX_VALUE; private ScheduledExecutorService minaTimerExecutor; private NioEventLoopGroup clientGroup; @@ -86,7 +84,7 @@ public class NetconfSSHActivator implements BundleActivator { private SshProxyServer startSSHServer(final BundleContext bundleContext) throws IOException { final Optional maybeSshSocketAddress = NetconfConfigUtil.extractNetconfServerAddress(bundleContext, InfixProp.ssh); - if (maybeSshSocketAddress.isPresent() == false) { + if (!maybeSshSocketAddress.isPresent()) { LOG.trace("SSH bridge not configured"); return null; } @@ -98,7 +96,8 @@ public class NetconfSSHActivator implements BundleActivator { authProviderTracker = new AuthProviderTracker(bundleContext); - final String path = FilenameUtils.separatorsToSystem(NetconfConfigUtil.getPrivateKeyPath(bundleContext)); + final String path = NetconfConfigUtil.getPrivateKeyPath(bundleContext); + checkState(!Strings.isNullOrEmpty(path), "Path to ssh private key is blank. Reconfigure %s", NetconfConfigUtil.getPrivateKeyKey());