コード例 #1
0
 @Override
 public ExecutorRequest[] parse(Object object) throws ExecutorException {
   SentAddressRequest request = new SentAddressRequest();
   TxNode node = (TxNode) object;
   request.setUserId(node.valueAt(0));
   return new ExecutorRequest[] {request};
 }
コード例 #2
0
  /*
   * (non-Javadoc)
   *
   * @seecom.telenav.cserver.poi.protocol.BrowserProtocolRequestParser#
   * parseBrowserRequest(javax.servlet.http.HttpServletRequest)
   */
  @Override
  public ExecutorRequest parseBrowserRequest(HttpServletRequest httpRequest) {

    DataHandler handler = new DataHandler(httpRequest);
    SentAddressRequest request = new SentAddressRequest();
    request.setUserId(PoiUtil.getUserId(handler));

    String action = TnUtil.filterLastPara(httpRequest.getParameter("action"));
    request.setAction(action);
    log.info("SentAddressRequestParser.parseBrowserRequest(). action is:" + action);
    // delete action
    if ("delete".equals(action)) {
      // get address id
      String id = TnUtil.filterLastPara((String) httpRequest.getParameter("id"));
      log.info("SentAddressRequestParser.delete(). id is:" + id);
      // invokde delete service to delete
      request.setId(id);
    }

    return request;
  }