Ejemplo n.º 1
0
  public static FindLocationResultTO processFindLocation(JRSResponse responses) {
    long timeDelay = 0;
    ObjectMapper mapper = new ObjectMapper();
    FindLocationResultTO resultTO = new FindLocationResultTO();
    timeDelay += responses.getTimeDelay();
    if (isSuccess(responses)) {
      resultTO.setSuccess(true);
      try {
        FindLocationResultTO findLoc =
            mapper.readValue(responses.getResponse(), FindLocationResultTO.class);
        resultTO.addLocationInfos(findLoc.getLocationInfos());
      } catch (Exception e) {
        logger.error(e.getMessage(), e);
      }
    }

    resultTO.setSearchTime(timeDelay);
    return resultTO;
  }
Ejemplo n.º 2
0
 public static void processPingTime(SlaveTO slaveTO, JRSResponse response) {
   if (isSuccess(response)) {
     slaveTO.updatePingTime((int) response.getTimeDelay());
   }
 }