Package org.jboss.narayana.blacktie.jatmibroker.xatmi

Examples of org.jboss.narayana.blacktie.jatmibroker.xatmi.Response


        .tpalloc("X_OCTET", null, sendlen);
    sendbuf.setByteArray(command.getBytes());

    String service = "." + serverName + id;

    Response rcvbuf = connection.tpcall(service, sendbuf, 0);
    return rcvbuf;
  }
View Full Code Here


  }

  private Boolean callAdminCommand(String serverName, int id, String command) {
    log.trace("callAdminCommand");
    try {
      Response buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        return (received[0] == '1');
      }
    } catch (ConnectionException e) {
      log.error("call server " + serverName + " id " + id + " command "
          + command + " failed with " + e.getTperrno());
View Full Code Here

    log.trace("getResponseTimeById");
    String command = "responsetime," + serviceName + ",";
    log.trace("response command is " + command);

    try {
      Response buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        String result = new String(received, 1, received.length - 1);
        log.trace("response result is " + result);
        return result;
      }
    } catch (ConnectionException e) {
View Full Code Here

    log.trace("getServiceCounterById");
    long counter = 0;
    String command = "counter," + serviceName + ",";

    try {
      Response buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        counter = Long.parseLong(new String(received, 1,
            received.length - 1));
      }
    } catch (ConnectionException e) {
      log.error("call server " + serverName + " id " + id
View Full Code Here

    log.trace("getErrorCounterById");
    long counter = 0;
    String command = "error_counter," + serviceName + ",";

    try {
      Response buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        counter = Long.parseLong(new String(received, 1,
            received.length - 1));
      }
    } catch (ConnectionException e) {
      log.error("call server " + serverName + " id " + id
View Full Code Here

  public Element listServiceStatusById(String serverName, int id,
      String serviceName) {
    log.trace("listServiceStatusById");
    String command = "status";
    Response buf = null;
    String status = null;

    try {
      if (serviceName != null) {
        command = command + "," + serviceName + ",";
      }

      buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        if (received[0] == '1') {
          status = new String(received, 1, received.length - 1);
          log.info("status is " + status);
          return stringToElement(status);
        }
View Full Code Here

  }

  public String getServerVersionById(String serverName, int id) {
    log.trace("getServerVersionById");
    String command = "version";
    Response buf = null;
    String version = null;

    try {
      buf = callAdminService(serverName, id, command);
      if (buf != null) {
        byte[] received = ((X_OCTET) buf.getBuffer()).getByteArray();
        if (received[0] == '1') {
          version = new String(received, 1, received.length - 1);
          log.debug("version is " + version);
        }
      }
View Full Code Here

        int id = getInt(parameters);
        String response = getServerVersionById(serverName, id);
        toReturn = response.getBytes();
      } else {
        log.error("Unknown operation: " + operation);
        return new Response(Connection.TPFAIL, 0, null, 0);
      }

      X_OCTET buffer = (X_OCTET) svcinfo.getConnection().tpalloc(
          "X_OCTET", null, toReturn.length);
      buffer.setByteArray(toReturn);
      log.debug("Responding");
      return new Response(Connection.TPSUCCESS, 0, buffer, 0);
    } catch (ConnectionException e) {
      return new Response(Connection.TPFAIL, 0, null, 0);
    } catch (IOException e) {
      return new Response(Connection.TPFAIL, 0, null, 0);
    }
  }
View Full Code Here

      X_OCTET buffer = (X_OCTET) svcinfo.getConnection().tpalloc(
          "X_OCTET", null, 1);
      buffer.setByteArray(success);
      log.debug("Responding");
      return new Response(Connection.TPSUCCESS, 0, buffer, 0);
    } catch (ConnectionException e) {
      return new Response(Connection.TPFAIL, 0, null, 0);
    }
  }
View Full Code Here

    }
    log.trace("Returning: " + resp);
    X_OCTET buffer = (X_OCTET) svcinfo.getConnection().tpalloc("X_OCTET",
        null, resp.length() + 1);
    buffer.setByteArray(resp.getBytes());
    return new Response(Connection.TPSUCCESS, 0, buffer, 0);
  }
View Full Code Here

TOP

Related Classes of org.jboss.narayana.blacktie.jatmibroker.xatmi.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.