Package ve.net.dcs.sc.component

Examples of ve.net.dcs.sc.component.Response


  public void response(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    SCWSFeature.load(getServletContext());

    Request scRequest = buildRequest(request, response);
    Response scResponse = rb.build(scRequest);

    response.setContentType("application/json");
    PrintWriter out = response.getWriter();
    out.print(buildJSON(scResponse));
    out.flush();
View Full Code Here


          request = new Request();
          request.setType((RequestType) viewClientMode.getCmbRequestType().getSelectedItem());
          request.setDate(HelperDate.now());
          request.setParameters(parameters);

          Response response = client.sendRequest(request);

          viewClientMode.getLblSetResponseServerMessage().setText(response.getServerMessage());
          viewClientMode.getLblSetResponseDate().setText(HelperDate.format(response.getDate(), "yyyy-MM-dd H:mm:ss"));
          viewClientMode.getLblSetResponseStatus().setText(response.getStatus().toString());
          viewClientMode.getLblSetResponseStatusNotice().setText(response.getStatusNotice());

          viewClientMode.getLstModelResponseData().clear();
          Iterator<String> iterator = response.getData().keySet().iterator();
          while (iterator.hasNext()) {
            String key = (String) iterator.next();
            viewClientMode.getLstModelResponseData().addElement(String.format("[%s] = %s", key, response.getValue(key)));
          }
        } catch (SocketTimeoutException e) {
          logger.warning("Error connection timeout");
          JOptionPane.showMessageDialog(viewClientMode, SCUILocale.get("ViewClientMode.errorTimeOut"), "Error", JOptionPane.ERROR_MESSAGE);
          e.printStackTrace();
View Full Code Here

    client.setTimeout(record.getSecondsTimeout() * 1000);
    client.setWebService(record.isWebService());
    Request request = new Request();
    request.setType(RequestType.TEST);
    request.setDate(HelperDate.now());
    Response response = client.sendRequest(request);
    return response.getStatusNotice() + ", Server time: " + HelperDate.format(response.getDate(), "H:mm:ss yyyy-MM-dd");
  }
View Full Code Here

   *             If the returned object is of a class unknown
   */
  public String connectServer() throws SocketTimeoutException, ClassNotFoundException, IOException {

    ScaleConnectorClient scc = new ScaleConnectorClient(recordScale);
    Response response = scc.sendRequest();

    if (response.getStatus().equals(ResponseStatus.SUCCESS))
      return response.getStatusNotice() + ", Server time: " + HelperDate.format(response.getDate(), "H:mm:ss yyyy-MM-dd") + ", Serial port: " + response.getValue("serialport") + ", Value: " + response.getValue("value") + ", Is Stable: " + response.getValue("isstable");
    else
      throw new AdempiereUserError(response.getStatusNotice() + ", Server time: " + HelperDate.format(response.getDate(), "H:mm:ss yyyy-MM-dd"));
  }
View Full Code Here

TOP

Related Classes of ve.net.dcs.sc.component.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.