Пример #1
0
 private boolean requiresCredentials(RpcRequest request) {
   if (!StringUtils.hasText(request.getRpcContext())
       && XUS_INTRO_MSG.equals(request.getRpcName())) {
     return false;
   } else {
     return true;
   }
 }
Пример #2
0
  private void outputRequestInfo(String sMessage, RpcRequest request) {
    String sCRLF = System.getProperty("line.separator");
    StringBuffer sbText = new StringBuffer();
    sbText.append(sMessage + sCRLF);
    sbText.append("RpcTemplate: Dumping contents of request: " + sCRLF + sCRLF);
    sbText.append(
        "Got here by the following trace: "
            + Arrays.toString(Thread.currentThread().getStackTrace())
            + sCRLF
            + sCRLF);

    if (request != null) {
      sbText.append("    credentials: " + request.getCredentials() + sCRLF);
      sbText.append("    rpcContext: " + request.getRpcContext() + sCRLF);
      sbText.append("    rpcName: " + request.getRpcName() + sCRLF);
      sbText.append("    rpcVersion: " + request.getRpcVersion() + sCRLF);
      sbText.append("    timeout: " + request.getTimeout() + sCRLF);
      sbText.append("    uriString: " + request.getUriString() + sCRLF);

      if ((request.getParams() != null) && (request.getParams().size() > 0)) {
        int i = 0;
        for (RpcParam oRpcParam : request.getParams()) {
          sbText.append("    rpcParam[" + i + "]:" + sCRLF);
          sbText.append("        type: " + oRpcParam.getType() + sCRLF);
          sbText.append("        value: " + oRpcParam.getValue() + sCRLF);
          i++;
        }
      }

      if (request.getHost() != null) {
        sbText.append("    host:" + sCRLF);
        sbText.append("        hostname: " + request.getHost().getHostname() + sCRLF);
        sbText.append("        port: " + request.getHost().getPort() + sCRLF);
        sbText.append("        scheme: " + request.getHost().getScheme() + sCRLF);
      }
    } else {
      sbText.append("    request was null" + sCRLF);
    }

    logger.debug(sbText.toString());
  }