SubStateManager.java 1.17 KB
package th.co.ais.ssbsrfc.control;

import th.co.ais.ssbsrfc.config.StateConfig;
import th.co.ais.ssbsrfc.interfaces.AbstractAFSubStateManager;
import th.co.ais.ssbsrfc.substate.SubWaitA;
import th.co.ais.ssbsrfc.substate.SubWaitAdjustmentChargeReportResponse;
import th.co.ais.ssbsrfc.substate.SubWaitAdjustmentChargeRequestResponse;
import th.co.ais.ssbsrfc.substate.SubWaitChargeReport;
import th.co.ais.ssbsrfc.substate.SubWaitChargeRequest;
import ec02.utils.Log;

public class SubStateManager extends AbstractAFSubStateManager {
	
	public SubStateManager(String subState) {
		Log.i("[Sub State ] : " + subState);
		this.subStateManager = null;
		
		if (subState.equals(StateConfig.SSTATE_W_CHARGEREQUEST)) {
			this.subStateManager = new SubWaitChargeRequest();
		}
		else if (subState.equals(StateConfig.SSTATE_W_CHARGEREPORT)) {
			this.subStateManager = new SubWaitChargeReport();
		}
		else if (subState.equals(StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT)) {
			this.subStateManager = new SubWaitAdjustmentChargeReportResponse();
		}
		else if (subState.equals(StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST)) {
			this.subStateManager = new SubWaitAdjustmentChargeRequestResponse();
		}
	}
}