- introduced netconf ssh wrapper bundle
[controller.git] / opendaylight / netconf / netconf-ssh / src / main / java / org / opendaylight / controller / netconf / ssh / NetconfSSHServer.java
diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java
new file mode 100644 (file)
index 0000000..dad149f
--- /dev/null
@@ -0,0 +1,32 @@
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */
+package org.opendaylight.controller.netconf.ssh;
+
+import java.net.ServerSocket;
+
+public class NetconfSSHServer  {
+
+    private static boolean acceptMore = true;
+    private static final int SERVER_PORT = 830;
+    private ServerSocket ss = null;
+
+    private NetconfSSHServer() throws Exception{
+        this.ss = new ServerSocket(SERVER_PORT);
+        while (acceptMore) {
+            SocketThread.start(ss.accept());
+        }
+    }
+    public static NetconfSSHServer start() throws Exception {
+        return new NetconfSSHServer();
+    }
+
+    public void stop() throws Exception {
+           ss.close();
+    }
+
+}