client IP/port definition in configuration separation
[controller.git] / opendaylight / netconf / netconf-ssh / src / main / java / org / opendaylight / controller / netconf / osgi / NetconfSSHActivator.java
index d2f6c8c81ce749a234d7ae2d433dad953e2e20c6..b91824866a107ffef75290f3a52af53318dca7a5 100644 (file)
@@ -30,15 +30,16 @@ 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<InetSocketAddress> sshSocketAddressOptional = NetconfConfigUtil.extractSSHNetconfAddress(context);
+        Optional<InetSocketAddress> sshSocketAddressOptional = NetconfConfigUtil.extractSSHNetconfAddress(context,EXCEPTION_MESSAGE);
         InetSocketAddress tcpSocketAddress = NetconfConfigUtil.extractTCPNetconfAddress(context,
-                "TCP is not configured, netconf ssh bridge is not available.");
+                EXCEPTION_MESSAGE, true);
 
         if (sshSocketAddressOptional.isPresent()){
             server = NetconfSSHServer.start(sshSocketAddressOptional.get().getPort(),tcpSocketAddress);