package th.co.ais.ssbsrfc.substate; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import th.co.ais.ssbsrfc.config.Constant; import th.co.ais.ssbsrfc.config.Invoke; import th.co.ais.ssbsrfc.config.StateConfig; import th.co.ais.ssbsrfc.instance.ChargeReportIns; import th.co.ais.ssbsrfc.instance.ChargeResponseIns; import th.co.ais.ssbsrfc.instance.EC02Instance; import th.co.ais.ssbsrfc.instance.EQXRawInstance; import th.co.ais.ssbsrfc.instance.ListE01Data; import th.co.ais.ssbsrfc.instance.LogError; import th.co.ais.ssbsrfc.instance.ManageTime; import th.co.ais.ssbsrfc.instance.ResIns; import th.co.ais.ssbsrfc.interfaces.EQXMsg; import th.co.ais.ssbsrfc.interfaces.IAFSubState; import th.co.ais.ssbsrfc.message.EC02Builder; import th.co.ais.ssbsrfc.message.MessageParser; import th.co.ais.ssbsrfc.utils.EqxStringUtils; import th.co.ais.ssbsrfc.utils.Global; import th.co.ais.ssbsrfc.utils.Log; import ais.mmt.sand.comlog.DetailsLogPrototype; import ais.mmt.sand.comlog.bean.DataBean; import ais.mmt.sand.comlog.bean.DataBean.TYPE; import ais.mmt.sand.comlog.exception.CommonLogException; import ec02.af.abstracts.AbstractAF; import ec02.af.data.EquinoxRawData; import ec02.af.data.GlobalData; import ec02.utils.AppLog; import sun.applet.AppletPanel; public class WaitSubState implements IAFSubState { protected int type = -1; protected EC02Builder ec02Builder = new EC02Builder(); protected List equinoxRawDataList = new ArrayList(); protected int _stateType = Constant.SUBSTATE_TYPE_UNKNOWN; protected String _state = ""; protected String _eventType = ""; protected Object _objIns = null; protected String _resultCode = "null"; protected String _resultDescription = "null"; protected List _listResult = new ArrayList(); protected boolean isStat = true; protected HashMap disRespone = new HashMap(); protected String _invokeTimeout = null; protected boolean isRetry = false; private boolean isIdle = true; int flow = 0; @Override public List doActionSubState(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { this.isIdle = (ec02Instance.getAFInstance().getFlow() != 0) ? false : true; configSubstate(ec02Instance, equinoxRawData); AppLog.d("#### FLOWMANAGER CURRENTFLOW: " + Global.getFlowName(ec02Instance.getAFInstance().getFlow())); // try { switch (this._stateType) { case Constant.SUBSTATE_TYPE_W_REQUEST: initRequest(abstractAF, ec02Instance, equinoxRawData); break; case Constant.SUBSTATE_TYPE_W_RESPONSE: initResponse(abstractAF, ec02Instance, equinoxRawData); break; case Constant.SUBSTATE_TYPE_W_E01: initE01(abstractAF, ec02Instance, equinoxRawData); break; case Constant.SUBSTATE_TYPE_UNKNOWN: default: break; } if (this._invokeTimeout == null) { this.summaryLog(ec02Instance, equinoxRawData); } // } catch (Exception e) { // AppLog.d("## EXCEPTION(MESSAGE): " + e.getMessage()); // AppLog.d("## EXCEPTION(STACKTRACE): " + e.getStackTrace()); // AppLog.d("## EXCEPTION(E): " + e); // ec02Instance.getAFInstance().setCurrentState(StateConfig.SSTATE_END); // } return this.equinoxRawDataList; } protected void configSubstate(EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { } protected boolean checkRejectApplication(EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { String currentState = ec02Instance.getAFInstance().getCurrentState(); boolean bool = false; if (!currentState.equals(_state) && !currentState.equals(StateConfig.SSTATE_END)) { bool = true; } else { // case is IDLE if (currentState.equals(StateConfig.SSTATE_END)) { boolean first = StateConfig.isFirstState(_state); AppLog.d("State"+first); if (!first) { bool = true; } } else { ec02Instance.getAFInstance().setCurrentState(_state); } } return bool; } protected void initRequest(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(START) ####]"); this.ec02Builder.setEquinoxRawData(equinoxRawData, abstractAF, ec02Instance); Global.setEc02Builder(this.ec02Builder); if (equinoxRawData == null) { // TIMEOUT ManageTime mt = new ManageTime(ec02Instance); List listTimeout = mt.getState(); for (String invoke : listTimeout) { Invoke _iv = new Invoke(invoke); String eventType = _iv.eventType; String cmd = _iv.cmd; this.timeout(abstractAF, ec02Instance, invoke, eventType, Constant.REQUEST.toLowerCase(), null); String subState = StateConfig.getSubStateFromEventType(eventType); // SET LOG Log.results(ec02Instance, subState, this.equinoxRawDataList, this.type, cmd, this.isStat); // summary for timeout this._invokeTimeout = invoke; this.summaryLog(ec02Instance, equinoxRawData); } } else { // CHECK EVENT TYPE/ CURRENTSTATE String eventType = equinoxRawData.getRawEventType(); ec02Instance.getAFInstance().listTimeoutRemoveForEventType(eventType); if (eventType.equals(_eventType)) { String ret = equinoxRawData.getRet(); Log.dev(" initRequest RET: " + ret); AppLog.d("ret Value:"+ret); if (ret.equals("4")) { String invoke = equinoxRawData.getInvoke(); String messageType = equinoxRawData.getType(); String cmd = new Invoke(invoke).cmd; Log.dev(" initRequest TIMEOUT: " + invoke + ":" + messageType + ":" + cmd); this.timeout(abstractAF, ec02Instance, invoke, eventType, messageType, null); // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, cmd, this.isStat); // summary for timeout this._invokeTimeout = invoke; this.summaryLog(ec02Instance, equinoxRawData); } else { // MAIN this.action(abstractAF, ec02Instance, equinoxRawData); // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, this.isStat); } } else { this.rejectApplication(abstractAF, ec02Instance, equinoxRawData, this._objIns); // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, this.isStat); } } AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(END) ####]"); AppLog.d("#### NEXTSUBSTATE: " + ec02Instance.getAFInstance().getCurrentState()); } protected void initResponse(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(START) ####]"); this.ec02Builder.setEquinoxRawData(equinoxRawData, abstractAF, ec02Instance); Global.setEc02Builder(this.ec02Builder); if (equinoxRawData == null) { // TIMEOUT ManageTime mt = new ManageTime(ec02Instance); List listTimeout = mt.getState(); List eqxTmpList = new ArrayList(); for (String invoke : listTimeout) { String eventType = new Invoke(invoke).eventType; String cmd = new Invoke(invoke).cmd; this.timeout(abstractAF, ec02Instance, invoke, eventType, Constant.RESPONSE.toLowerCase(), null); String subState = StateConfig.getSubStateFromEventType(eventType); // SET LOG for (EquinoxRawData eqxxRawlist : this.equinoxRawDataList) { eqxTmpList.add(eqxxRawlist); } Log.results(ec02Instance, subState, this.equinoxRawDataList, this.type, cmd, this.isStat); this.equinoxRawDataList = new ArrayList(); // summary for timeout this._invokeTimeout = invoke; this.summaryLog(ec02Instance, equinoxRawData); } this.equinoxRawDataList = eqxTmpList; } else { String eventType = equinoxRawData.getRawEventType(); if (eventType.equals(_eventType)) { // CASE SUCCESS, ERROR, REJECT, ABORT, TIMEOUT String invoke = equinoxRawData.getInvoke(); String messageType = equinoxRawData.getType(); String cmd = new Invoke(invoke).cmd; // CHECK EVENT TYPE/ CURRENTSTATE String ret = equinoxRawData.getRet(); if (ret.equals("1")) { // ERROR this.error(abstractAF, ec02Instance, invoke, eventType, messageType, null); } else if (ret.equals("2")) { // REJECT this.reject(abstractAF, ec02Instance, invoke, eventType, messageType, null); } else if (ret.equals("3")) { // ABORT this.abort(abstractAF, ec02Instance, invoke, eventType, messageType, null); } else if (ret.equals("4")) { // TIMEOUT this.timeout(abstractAF, ec02Instance, invoke, eventType, messageType, null); } else { // SUCCESS this.action(abstractAF, ec02Instance, equinoxRawData); } // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, cmd, this.isStat); } else { this.rejectApplication(abstractAF, ec02Instance, equinoxRawData, this._objIns); // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, this.isStat); } this.summaryLog(ec02Instance, equinoxRawData); } AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(END) ####]"); AppLog.d("#### NEXTSUBSTATE: " + ec02Instance.getAFInstance().getCurrentState()); } protected void initE01(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(START) ####]"); this.ec02Builder.setEquinoxRawData(equinoxRawData, abstractAF, ec02Instance); Global.setEc02Builder(this.ec02Builder); GlobalData e01 = abstractAF.getUtils().getGlobalData(); if (e01.isRecieve()) { String messageType = Constant.RESPONSE.toLowerCase(); String invoke = null; // try { int ret = e01.getGlobaldataMessageType().getCode(); if (ret == 1) { // ERROR this.error(abstractAF, ec02Instance, invoke, this._eventType, messageType, e01); } else if (ret == 2) { // REJECT this.reject(abstractAF, ec02Instance, invoke, this._eventType, messageType, e01); } else if (ret == 3) { // ABORT this.abort(abstractAF, ec02Instance, invoke, this._eventType, messageType, e01); } else if (ret == 4) { // TIMEOUT this.timeout(abstractAF, ec02Instance, invoke, this._eventType, messageType, e01); } else { // SUCCESS // REJECT APPICATION if (e01.isRecieve()) { invoke = e01.getTransactionId(); ec02Instance.getAFInstance().listTimeoutRemove(invoke); EquinoxRawData eqxRawData = new EquinoxRawData(); ListE01Data ins = new ListE01Data(e01.getDataResultSet()); String rawData = MessageParser.toJson(ins); // AppLog.d("E01 RAWDATA: " + rawData); eqxRawData.getRawDataAttributes().put("val", rawData); eqxRawData.setRawEventType(this._eventType); eqxRawData.setRet("0"); eqxRawData.setInvoke(invoke); eqxRawData.setCType(EQXMsg.TEXTPLAIN); eqxRawData.setType(Constant.RESPONSE.toLowerCase()); this.action(abstractAF, ec02Instance, eqxRawData); } } // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, this.type, this.isStat); // } catch (Exception e) { // AppLog.e("## E01(GET RET):" + e.getMessage()); // } } else { // TIMEOUT if (equinoxRawData == null) { ManageTime mt = new ManageTime(ec02Instance); List listTimeout = mt.getState(); for (String invoke : listTimeout) { String cmd = new Invoke(invoke).cmd; String eventType = new Invoke(invoke).eventType; this.timeout(abstractAF, ec02Instance, invoke, eventType, Constant.RESPONSE.toLowerCase(), null); String subState = StateConfig.getSubStateFromEventType(eventType); // SET LOG Log.results(ec02Instance, subState, this.equinoxRawDataList, this.type, cmd, this.isStat); // summary for timeout this._invokeTimeout = invoke; this.summaryLog(ec02Instance, equinoxRawData); } } else { String ret = equinoxRawData.getRet(); String invoke = equinoxRawData.getInvoke(); String messageType = equinoxRawData.getType(); if (ret.equals("4")) { // TIMEOUT String eventType = new Invoke(invoke).eventType; this.timeout(abstractAF, ec02Instance, invoke, eventType, messageType, e01); // SET LOG Log.results(ec02Instance, _state, this.equinoxRawDataList, Constant.TYPE_TIMEOUT, this.isStat); } else { // REJECT APPICATION this.action(abstractAF, ec02Instance, equinoxRawData); } } } AppLog.d("[#### CURRENTSUBSTATE: " + _state + "(END) ####]"); AppLog.d("#### NEXTSUBSTATE: " + ec02Instance.getAFInstance().getCurrentState()); } protected void action(AbstractAF abstractAF,EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { // try { this._objIns = this.getMessage(ec02Instance, equinoxRawData); ec02Instance.getAFInstance().setResultCode(this._resultCode); ec02Instance.getAFInstance().setResultDescription(this._resultDescription); boolean isReject = this.checkRejectApplication(ec02Instance, equinoxRawData); if(isReject) { this.rejectApplication(abstractAF, ec02Instance, equinoxRawData, this._objIns); } else { // set type this.verifyMessage(abstractAF, ec02Instance, equinoxRawData); if (this.type == Constant.TYPE_REJECT_APPLICATION) { this.rejectApplication(abstractAF, ec02Instance, equinoxRawData, this._objIns); } else { //Detail Log Input String value = EqxStringUtils.getMessage(equinoxRawData, null, false); String invoke = equinoxRawData.getInvoke(); String eventType = ec02Instance.getAFInstance().getEvent(); String messageType = equinoxRawData.getType(); this.detailLogInput(ec02Instance, invoke, eventType, messageType, this._objIns, value); this.buildMessage(abstractAF, ec02Instance, equinoxRawData); } } // } catch (Exception e) { // AppLog.e("## EXCEPTION(MESSAGE): " + e.getMessage()); // AppLog.e("## EXCEPTION(STACKTRACE): " + e.getStackTrace().toString()); // AppLog.e("## EXCEPTION(E): " + e.toString()); // AppLog.e("## GETMESSAGE EQUINOX: ERROR"); // AppLog.d("## VERIFY(PARAMETER) :INVALID PARAMETER"); // this.type = Constant.TYPE_INVALID; // // //Detail Log Input // String value = EqxStringUtils.getMessage(equinoxRawData, null, false); // String invoke = equinoxRawData.getInvoke(); // String eventType = equinoxRawData.getRawEventType(); // String messageType = equinoxRawData.getType(); // this.detailLogInput(ec02Instance, invoke, eventType, messageType, this._objIns, value); // // this.buildMessage(abstractAF, ec02Instance, equinoxRawData); // } } protected void rejectApplication(AbstractAF abstractAF,EC02Instance ec02Instance, EquinoxRawData equinoxRawData, Object ins) { AppLog.d("REJECTED BY APPLICATION"); this.type = Constant.TYPE_REJECT_APPLICATION; String eventType = equinoxRawData.getRawEventType(); String currentState = ec02Instance.getAFInstance().getCurrentState(); String invoke = equinoxRawData.getInvoke(); String messageType = equinoxRawData.getType(); String value = EqxStringUtils.getMessage(equinoxRawData, null, false); AppLog.d("REJECT [" + eventType + "]: IN [" + currentState + "]"); Global.setRejectByApplication(true); ec02Instance.getAFInstance().getBackupSummary().backup(ec02Instance, equinoxRawData); this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins, value); if (messageType.toLowerCase().equals(Constant.REQUEST.toLowerCase()) && equinoxRawData != null && !equinoxRawData.getRet().equals("1") && !equinoxRawData.getRet().equals("2") && !equinoxRawData.getRet().equals("3") && !equinoxRawData.getRet().equals("4")) { // String to = equinoxRawData.getOrig(); // EQXRawInstance eqxRaw = SubMessages.getRawUnknownResponse(abstractAF, ec02Instance, to, invoke, eventType); // this.equinoxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw)); } } public Object getMessage(EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { return null; } public void verifyMessage(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { } public void buildMessage(AbstractAF abstractAF, EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { } protected void error(AbstractAF abstractAF,EC02Instance ec02Instance, String invoke, String eventType, String messageType, GlobalData e01) { AppLog.d("SPECIFIC ERROR BY APPLICATION"); if(this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT||this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST){ this.type = Constant.TYPE_ERROR; this._resultCode = null; }else{ this.type = Constant.TYPE_ERROR; } LogError ins = new LogError("1", "Error"); this._resultCode = "310"; this._resultDescription = "Error"; ec02Instance.getAFInstance().setResultCode("310"); ec02Instance.getAFInstance().setResultDescription("SCP_OTHER"); this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins); this.buildResponeMsg(abstractAF, ec02Instance, invoke, eventType, messageType, ins, e01); flow = ec02Instance.getAFInstance().getFlow(); } protected void reject(AbstractAF abstractAF,EC02Instance ec02Instance, String invoke, String eventType, String messageType, GlobalData e01) { AppLog.d("REJECTED BY PLATFORM"); if(this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT||this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST){ this.type = Constant.TYPE_REJECT; this._resultCode = null; }else{ this.type = Constant.TYPE_ERROR; } LogError ins = new LogError("2", "Reject"); this._resultCode = "307"; this._resultDescription = "Reject"; ec02Instance.getAFInstance().setResultCode("307"); ec02Instance.getAFInstance().setResultDescription("SCP_NOT_CONNECT"); this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins); this.buildResponeMsg(abstractAF, ec02Instance, invoke, eventType, messageType, ins, e01); } protected void abort(AbstractAF abstractAF,EC02Instance ec02Instance, String invoke, String eventType, String messageType, GlobalData e01) { AppLog.d("RETURN ABORTED BY PLATFORM"); if(this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT||this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST){ this.type = Constant.TYPE_ABORT; this._resultCode = null; }else{ this.type = Constant.TYPE_ERROR; } this._resultCode = "310"; LogError ins = new LogError("3", "Abort"); this._resultDescription = "Abort"; ec02Instance.getAFInstance().setResultCode("310"); ec02Instance.getAFInstance().setResultDescription("SCP_OTHER"); this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins); this.buildResponeMsg(abstractAF, ec02Instance, invoke, eventType, messageType, ins, e01); } protected void timeout(AbstractAF abstractAF, EC02Instance ec02Instance, String invoke, String eventType, String messageType, GlobalData e01) { AppLog.d("RETURN TIMEOUT BY PLATFORM"); if(this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT||this._state == StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST){ this.type = Constant.TYPE_TIMEOUT; }else{ this.type = Constant.TYPE_ERROR; } this._resultCode = "329"; LogError ins = new LogError("4", "Timeout"); this._resultDescription = "Timeout"; ec02Instance.getAFInstance().setResultCode("329"); ec02Instance.getAFInstance().setResultDescription("SCP_TIMEOUT"); this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins); this.buildResponeMsg(abstractAF, ec02Instance, invoke, eventType, messageType, ins, e01); } private void detailLogInput(EC02Instance ec02Instance,String invoke, String eventType, String messageType, Object ins) { this.detailLogInput(ec02Instance, invoke, eventType, messageType, ins, null); } protected void detailLogInput(EC02Instance ec02Instance,String invoke, String eventType, String messageType, Object ins, String rawData) { //Detail Log Input if(invoke == null) { invoke = ""; } String command = StateConfig.getCommandFromEventType(eventType); String node = Global.getNodeFromEventType(eventType); if (command != null && command.contains("|") && invoke.contains(".")) { Invoke _iv = new Invoke(invoke); command = _iv.cmd; node = _iv.nodeName; } //String event = node + "." + command; String responseTime = ec02Instance.getAFInstance().getResponseTime(); if(this._stateType == Constant.SUBSTATE_TYPE_W_REQUEST) { responseTime = null; } DetailsLogPrototype detLog = ec02Instance.getAFInstance().getDetaillog(); DataBean input = new DataBean(); input.setInvoke(invoke); input.setDirector(node); input.setCommandName(command); if (!this.isIdle) { try { if (messageType != null && messageType.toLowerCase().equals(EQXMsg.REQUEST.toLowerCase())) { input.setType(TYPE.REQ); responseTime = null; } else if (messageType != null && messageType.toLowerCase().equals(EQXMsg.RESPONSE.toLowerCase())) { input.setType(TYPE.RES); } else { if (Log.debug) { AppLog.d("## MessageType :" + messageType); } if(this._stateType == Constant.SUBSTATE_TYPE_W_REQUEST) { input.setType(TYPE.REQ); responseTime = null; } else { input.setType(TYPE.RES); } } } catch (Exception e) { if(this._stateType == Constant.SUBSTATE_TYPE_W_REQUEST) { input.setType(TYPE.REQ); } else { input.setType(TYPE.RES); } } } else { if(this._stateType == Constant.SUBSTATE_TYPE_W_REQUEST) { input.setType(TYPE.REQ); responseTime = null; } else { input.setType(TYPE.RES); } } if(this.type!=Constant.TYPE_SUCCESS){ input.setJsonData(MessageParser.toJsonObject(ins)); } input.setRawData(Global.getDetailLogRawData(rawData)); if(responseTime != null) { input.setRespTime(Long.parseLong(responseTime)); } try { detLog.addInput(input); } catch (CommonLogException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void buildResponeMsg(AbstractAF abstractAF,EC02Instance ec02Instance, String invoke, String eventType, String messageType, Object ins, GlobalData e01) { AppLog.d("########buildResponeMsg########"); AppLog.d("########flow########:"+flow); flow = ec02Instance.getAFInstance().getFlow(); switch (flow) { case Constant.FLOW_CHARGE_REQUEST: { ChargeResponseIns chargeResponseIns = new ChargeResponseIns(); switch (this.type) { case Constant.TYPE_ERROR: case Constant.TYPE_REJECT: case Constant.TYPE_ABORT: case Constant.TYPE_TIMEOUT: { chargeResponseIns.setResult(this._resultCode); chargeResponseIns.setPrepaidsubscriberflag("1"); chargeResponseIns.setChargingID(ec02Instance.getAFInstance().getChargeId()); this._resultCode = null; String message = th.co.ais.ssbsrfc.message.MessageParser.toXml(chargeResponseIns); EQXRawInstance eqxRaw = SubMessages.getRawChargeRequestResponse(abstractAF, ec02Instance, ec02Instance.getAFInstance().getOrig(), ec02Instance.getAFInstance().getInvoke(),message); this.equinoxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw)); ec02Instance.getAFInstance().setCurrentState(StateConfig.SSTATE_END); break; } } break; } case Constant.FLOW_CHARGE_REPORT: ChargeReportIns chargeReportIns = new ChargeReportIns(); switch (this.type) { case Constant.TYPE_ERROR: case Constant.TYPE_REJECT: case Constant.TYPE_ABORT: case Constant.TYPE_TIMEOUT: { chargeReportIns.setResult(this._resultCode); chargeReportIns.setPrepaidsubscriberflag("1"); this._resultCode = null; String message = th.co.ais.ssbsrfc.message.MessageParser.toXml(chargeReportIns); EQXRawInstance eqxRaw = SubMessages.getRawChargeRequestResponse(abstractAF, ec02Instance, ec02Instance.getAFInstance().getOrig(), ec02Instance.getAFInstance().getInvoke(),message); this.equinoxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw)); ec02Instance.getAFInstance().setCurrentState(StateConfig.SSTATE_END); break; } } } } private void summaryLog(EC02Instance ec02Instance, EquinoxRawData equinoxRawData) { try { if ((this.type != Constant.TYPE_SUCCESS && this.type != -1 && this.type != Constant.TYPE_REJECT_APPLICATION && this.type != Constant.TYPE_SUCCESS_WITH_CONDITION && this.type != Constant.TYPE_FILE_NOT_FOUND && this.type != Constant.TYPE_DATA_EXISTED && this.type != Constant.TYPE_DATA_NOT_FOUND && this._resultCode != null && !this._resultCode.equals("20000") && !this.isRetry && !this._resultCode.equals("23")) || (this.type == Constant.TYPE_MISSING || this.type == Constant.TYPE_INVALID)) { String command = StateConfig.getCommandFromEventType(this._eventType); if (command.contains("|") && equinoxRawData != null && equinoxRawData.getInvoke() != null && equinoxRawData.getInvoke().contains(".")) { String invoke = equinoxRawData.getInvoke(); command = new Invoke(invoke).cmd; } else if (command.contains("|") && this._invokeTimeout != null && this._invokeTimeout.contains(".")) { command = new Invoke(this._invokeTimeout).cmd; } if (this.type == Constant.TYPE_MISSING || this.type == Constant.TYPE_INVALID) { this._resultCode = "null"; this._resultDescription = "Missing or invalid parameter"; ec02Instance.getAFInstance().setResultCode(this._resultCode); ec02Instance.getAFInstance().setResultDescription(this._resultDescription); } String node = Global.getNodeFromEventType(this._eventType); if (Log.debug) { //AppLog.d("## SUMMARY:" + this.type + node + command + this._resultCode + this._resultDescription); } if(this._resultDescription.equals(EQXMsg.EMPTY)) { this._resultDescription = "null"; } ec02Instance.getAFInstance().getSumlog().addDestination(node, command, this._resultCode, this._resultDescription); } } catch (CommonLogException e) { e.printStackTrace(); } } }