Beispiel #1
0
        public int fnLogin(String agentID, String agentPwd, String extension, String peripheralID)
        {
            logwrite.write("", "");
            logwrite.write("fnConnect", "\t ** call fnLogin() ID [" + agentID + "] Password [" + agentPwd + "] extension [" + extension + "] ** ");

            reasonCodeTable = new Hashtable(); // 이석사유코드 정보를 최초 로그인시 메모리에 관리한다.
            //Agent agent = new Agent(agentID , agentPwd, extension , peripheralID);
            Agent agent = Agent.getInstance();

            agent.setAgentID(agentID);
            agent.setAgentPwd(agentPwd);
            agent.setExtension(extension);



            if (FinesseClient != null)
            {
                if (!FinesseClient.isConnected())
                {
                    // Finesse XMPP Socket 이 연결안된 경우
                    if (FinesseClient.startClient() != ERRORCODE.SUCCESS)
                    {
                        logwrite.write("fnConnect", "Finesse Cannot Connect");
                        isFinesseConnected = false;
                        logwrite.write("fnConnect", "\t Return Data : " + ERRORCODE.FAIL);
                        return(ERRORCODE.FAIL);
                    }
                    else
                    {
                        isFinesseConnected = true;
                    }
                }

                if (FinesseClient.login() == ERRORCODE.SUCCESS)
                {
                    // 로그인이 성공하면 Finesse 에 등록된 이석사유코드 리스트를 가져와 메모리에 올린다.
                    string reasonCodeXML = fnGetReasonCodeList();
                    setReasonCodeList(reasonCodeXML);
                    logwrite.write("fnLogin", "\t Return Data : " + ERRORCODE.SUCCESS);
                    return(ERRORCODE.SUCCESS);
                }
                else
                {
                    logwrite.write("fnLogin", "\t Return Data : " + ERRORCODE.FAIL);
                    return(ERRORCODE.FAIL);
                }
            }
            else
            {
                return(ERRORCODE.FAIL);
            }
        }
Beispiel #2
0
        public int fnConnect(String fn_A_IP, String fn_B_IP, String AEMS_A_IP, String AEMS_B_IP, int AEMS_Port, String ISPS_A_IP, String ISPS_B_IP, int ISPS_Port, int loglevel)
        {
            logwrite.write("", "");
            logwrite.write("fnConnect", "\t ** call fnConnect() **");

            StringBuilder sb = new StringBuilder();

            logwrite.write("fnConnect", "Finesse A \t [" + fn_A_IP + "]");
            logwrite.write("fnConnect", "Finesse B \t [" + fn_B_IP + "]");
            logwrite.write("fnConnect", "AEMS A \t [" + AEMS_A_IP + "]");
            logwrite.write("fnConnect", "AEMS B \t [" + AEMS_B_IP + "]");
            logwrite.write("fnConnect", "AEMS Port \t [" + AEMS_Port + "]");
            logwrite.write("fnConnect", "ISPS A \t [" + ISPS_A_IP + "]");
            logwrite.write("fnConnect", "ISPS B \t [" + ISPS_B_IP + "]");
            logwrite.write("fnConnect", "ISPS Port \t [" + ISPS_Port + "]");
            logwrite.write("fnConnect", "Loglevel \t [" + loglevel + "]");

            int finesseport = SERVERINFO.Finesse_PORT;

            // 각 서버정보 객체화
            finesseInfo = new ServerInfo(fn_A_IP, fn_B_IP, finesseport);
            aemsInfo    = new ServerInfo(AEMS_A_IP, AEMS_B_IP, AEMS_Port);
            ispsInfo    = new ServerInfo(ISPS_A_IP, ISPS_B_IP, ISPS_Port);

            /*
             *  finesse 세션 연결
             * */

            if (isFinesseConnected)
            {
                logwrite.write("fnConnect", "Finesse is Already Connected!!");
            }
            else
            {
                FinesseClient = new FinesseClient(logwrite, this);
                FinesseClient.setServerInfo(finesseInfo);
                if (FinesseClient.startClient() != ERRORCODE.SUCCESS)
                {
                    logwrite.write("fnConnect", "Finesse Cannot Connect");
                    isFinesseConnected = false;
                    logwrite.write("fnConnect", "\t Return Data : " + ERRORCODE.FAIL);
                    return(ERRORCODE.FAIL);
                }
                else
                {
                    isFinesseConnected = true;
                }
            }

            if (isAEMSConnected)
            {
                logwrite.write("fnConnect", "AEMS is Already Connected!!");
            }
            else
            {
                AEMSClient = new AEMSClient(logwrite, this);
                AEMSClient.setServerInfo(aemsInfo);

                isAEMSConnected = false;

                /*
                 * if (AEMSClient.aemsConnect() != ERRORCODE.SUCCESS)
                 * {
                 *  logwrite.write("fnConnect", "AEMS Cannot Connect");
                 *  isAEMSConnected = false;
                 *  return ERRORCODE.FAIL;
                 * }
                 * else
                 * {
                 *  isAEMSConnected = true;
                 *  AEMSClient.disconnect();
                 * }
                 * */
            }

            if (isISPSConnected)
            {
                logwrite.write("fnConnect", "ISPS is Already Connected!!");
            }
            else
            {
                ISPSClient = new ISPSClient(logwrite, this);
                ISPSClient.setServerInfo(ispsInfo);
                isISPSConnected = false;

                /*
                 * if (ISPSClient.ispsConnect() != ERRORCODE.SUCCESS)
                 * {
                 *  logwrite.write("fnConnect", "ISPS Cannot Connect");
                 *  isISPSConnected = false;
                 *  return ERRORCODE.FAIL;
                 * }
                 * else
                 * {
                 *  isISPSConnected = true;
                 *  ISPSClient.disconnect();
                 * }
                 * */
            }

            logwrite.write("fnConnect", "\t Return Data : " + ERRORCODE.SUCCESS);

            return(ERRORCODE.SUCCESS);
        }