public boolean execute(Action a) throws IOException {
		QState state;
		boolean rc=false;
		
		if(a instanceof LostConnection) {
			_session.terminate();
			rc=true;
		} else if(a instanceof SuspendServiceAck) {
			_log.debug("Sending ACK for Suspend Service Request");
			_session.send(new SuspendServiceAck());
			_session.suspend();
			rc=true;
		} else if(a instanceof ResumeService) {
			_log.debug("Resuming service");
			_session.resume();
			//_log.debug("Sending ACK for Resume Service Request");
			//_session.send(new ResumeService());
			rc=true;
		} else if(a instanceof Logoff) {
			_log.debug("Sending ACK for Logoff Request");
			_session.send(new LogoffAck(_session.getStartTime(),new Date()));
			_session.terminate();
			rc=true;
		} else if(a instanceof SendEmail) {
			String recipient=((SendEmail)a).getData();
			state=new SendEmailState(_session, new QHandle(recipient));
			state.activate();
			rc=true;
		} else if(a instanceof ReadEmail) {
			state=new ReadEmailState(_session);
			state.activate();
			rc=true;
		} else if(a instanceof SendOLM) {
			String recipient=((SendOLM)a).getData();
			state=new SendOLMState(_session,new QHandle(recipient));
			state.activate();
			rc=true;
		} else if(a instanceof ReadOLM) {
			String id=((ReadOLM)a).getData();
			// system OKs reading an OLM
			String[] l=_session.getOLM();
			//String[] l=_session.getOLM(id);
			int size=l.length;
			for(int i=0;i<size;i++) {
				_session.send(new OLMText(id,l[i],(i+1==size)));
			}
			rc=true;
		}
		return rc;
	}