Merge "- introduced netconf ssh wrapper bundle - incorporation of Tomas's notes ...
[controller.git] / opendaylight / netconf / netconf-ssh / src / main / java / org / opendaylight / controller / netconf / ssh / NetconfSSHServer.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */
8 package org.opendaylight.controller.netconf.ssh;
9
10 import java.net.ServerSocket;
11
12 public class NetconfSSHServer  {
13
14     private static boolean acceptMore = true;
15     private static final int SERVER_PORT = 830;
16     private ServerSocket ss = null;
17
18     private NetconfSSHServer() throws Exception{
19         this.ss = new ServerSocket(SERVER_PORT);
20         while (acceptMore) {
21             SocketThread.start(ss.accept());
22         }
23     }
24     public static NetconfSSHServer start() throws Exception {
25         return new NetconfSSHServer();
26     }
27
28     public void stop() throws Exception {
29            ss.close();
30     }
31
32 }