package com.eactive.eai.adapter.socket2.tool.admin;



public class NetAdmin {
    static public void main(String[] args) throws Exception {
    	String hostname = "localhost";	
    	int port = 8281;
    	
    	if (args.length == 1) {
    		hostname = args[0];
    	} else if (args.length == 2) {
        	// System.out.println("args[0] " + args[0]);
        	// System.out.println("args[1] " + args[1]);
    		hostname = args[0];
    		port = Integer.parseInt(args[1]);
    	}
    	
    	Shell shell = new Shell(hostname, port);
        shell.loop();
    }
    
    public static void printHelp() {
    	StringBuffer sb = new StringBuffer();
        sb.append("\n\t\t[소켓어뎁터  관리명령 도움말]\n\n");
        sb.append("start          - 소켓어뎁터  기동명령 ( netadmin start adapterGroupName adapterName )");
        sb.append("stop           - 소켓어뎁터  중지명령 ( netadmin stop adapterGroupName adapterName )");
        sb.append("disconnect     - 소켓DISCONNECT명령 ( netadmin disconnect remoteIPAddress remotePort# )");
        sb.append("get connection - Connection정보 조회  ( netadmin get connection [ all | summary | adapterGroupName ] )");
        sb.append("get session    - Session정보 조회  ( netadmin get session [ all | adapterGroupName ] )");
        sb.append("get config     - Adapter Config정보 조회  ( netadmin get config  adapterName )");
        sb.append("set connection - Max Connection 수 조정 ( netadmin set connection adapterName #OfConnection )");
        sb.append("set thread     - Max Thread 수 조정 ( netadmin set thread adapterName #OfSession )");
        sb.append("set trace      - 소켓어뎁터 추적관리 레벨 조정 ( netadmin set trace adapterName [ 0 | 1 | 2] )\n");
        // System.out.println(sb.toString());
    }
}
