X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fosgi%2FNetconfSSHActivator.java;h=6f164f93d9c9482613a286352a6868e41cf649c3;hb=c73c1861af3d5eaab53843a82f021ccedac4a0f0;hp=6626f47b0375e4a7a0e503f78cd862ab647f2f62;hpb=549b3260a884bf1801d6ea1a0f4ffb7bb5ed2bf5;p=controller.git diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/osgi/NetconfSSHActivator.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/osgi/NetconfSSHActivator.java index 6626f47b03..6f164f93d9 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/osgi/NetconfSSHActivator.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/osgi/NetconfSSHActivator.java @@ -30,17 +30,18 @@ public class NetconfSSHActivator implements BundleActivator{ private NetconfSSHServer server; private static final Logger logger = LoggerFactory.getLogger(NetconfSSHActivator.class); + private static final String EXCEPTION_MESSAGE = "Netconf ssh bridge is not available."; @Override public void start(BundleContext context) throws Exception { logger.trace("Starting netconf SSH bridge."); - Optional sshSocketAddressOptional = NetconfConfigUtil.extractSSHNetconfAddress(context); - Optional tcpSocketAddressOptional = NetconfConfigUtil.extractTCPNetconfAddress(context); + Optional sshSocketAddressOptional = NetconfConfigUtil.extractSSHNetconfAddress(context,EXCEPTION_MESSAGE); + InetSocketAddress tcpSocketAddress = NetconfConfigUtil.extractTCPNetconfAddress(context,EXCEPTION_MESSAGE); - if (sshSocketAddressOptional.isPresent() && tcpSocketAddressOptional.isPresent()){ - server = NetconfSSHServer.start(sshSocketAddressOptional.get().getPort(),tcpSocketAddressOptional.get()); + if (sshSocketAddressOptional.isPresent()){ + server = NetconfSSHServer.start(sshSocketAddressOptional.get().getPort(),tcpSocketAddress); Thread serverThread = new Thread(server,"netconf SSH server thread"); serverThread.setDaemon(true); serverThread.start();