public DownTextReq parse(String[] msg) throws ParseException { // TODO Auto-generated method stub DownTextReq resp = new DownTextReq(); try { resp.setBody(msg); // 把设置终端参数命令对象放入下行命令队列中 DownCommandBuffer.getInstance().add(resp); log.info("把设置终端参数命令对象放入下行命令队列中"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block throw new ParseException("parse DownQuestionReq failed.", e); } return resp; }
public void handle(DownTextReq msg, SupCommService supCommService) throws HandleException { try { log.info(LogFormatter.formatMsg("DownTextReq", "receive a DownTextReq request.")); // 向下行消息概要Map中加入本指令概要,等待消息回复。 DownCommandSummaryBean dcsb = new DownCommandSummaryBean(); dcsb.setCommand(msg.getCommand()); dcsb.setSeqId(msg.getSeq()); dcsb.setAddress(supCommService.getRemoteAddress()); String key = supCommService.getRemoteAddress() + msg.getSeq(); DownCommandSeqQueueMap.getInstance().put(key, dcsb); } catch (Throwable t) { throw new HandleException("handle DownTextReq request failed.", t); } }