示例#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);
            }
        }