Package org.ugate.service.entity

Examples of org.ugate.service.entity.Command


      }
      if (msgRawContent != null) {
        rawCommands.addAll(Arrays.asList(msgRawContent.trim().split(ActorType.MAIL_COMMAND_DELIMITER)));
      }
      int intCmd = -1;
      Command cmd = null;
      for (String rawCmd : rawCommands) {
        try {
          intCmd = Integer.parseInt(rawCmd);
        } catch (NumberFormatException e) {
          log.warn("Non-numeric command received: " + rawCmd, e);
View Full Code Here


      // 6=AT Command (D)
      // 7=AT Command (L)
      if (response instanceof RxResponse16) {
        handleRxResponse16((RxResponse16) response);
      } else if (response instanceof TxStatusResponse) {
        final Command command = extractCommand(response);
        final String rawBytes = ByteUtils.toBase16(response.getRawPacketBytes());
        final TxStatusResponse txResponse = (TxStatusResponse) response;
        RxData rd;
        if (txResponse.getStatus() == TxStatusResponse.Status.SUCCESS) {
          rd = new RxRawData<String>(null, Status.NORMAL, 0, rawBytes);
          processData(null, UGateEvent.Type.WIRELESS_DATA_TX_STATUS_RESPONSE_SUCCESS, command, rd,
              RS.rbLabel(KEY.SERVICE_TX_RESPONSE_SUCCESS, rd, txResponse.getStatus()));
        } else {
          rd = new RxRawData<String>(null, Status.GENERAL_FAILURE, 0, rawBytes);
          processData(null, UGateEvent.Type.WIRELESS_DATA_TX_STATUS_RESPONSE_FAILED, command, rd,
              RS.rbLabel(KEY.SERVICE_TX_RESPONSE_ERROR, rd, txResponse.getStatus()));
        }
      } else if (response instanceof ErrorResponse) {
        final Command command = extractCommand(response);
        final ErrorResponse errorResponse = (ErrorResponse) response;
        final String rawBytes = ByteUtils.toBase16(response.getRawPacketBytes());
        RxData rd;
        // TODO : need a way to determine what address the error came from for an ErrorResponse
//        if (imgMap.containsKey(errorResponse.getRemoteAddress())) {
View Full Code Here

  protected void handleRxResponse16(final RxResponse16 rxResponse) {
    final RemoteNode rn = findRemoteNode(rxResponse);
    if (rn == null) {
      return;
    }
    final Command command = extractCommand(rxResponse);
    if (command == null) {
      log.error(String.format("An unrecognized %1$s command was received from %2$s",
          rxResponse.getData()[0], rn.getAddress()));
      return;
    }
View Full Code Here

    }
    final String c = request.getParameter(VAR_COMMAND_NAME);
    if (c == null || c.isEmpty()) {
      return;
    }
    final Command cmd = Command.valueOf(c);
    if (cmd != null) {
      if (log.isInfoEnabled()) {
        log.info(String.format(
            "Executing %1$s for %2$s at address %3$s)", cmd,
            RemoteNode.class.getSimpleName(), rn.getAddress()));
View Full Code Here

TOP

Related Classes of org.ugate.service.entity.Command

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.