private void processCurrentTransaction() {
   if (currentRecord == null) {
     clearViewers();
     return;
   }
   requestViewer.displayHttpRequest(currentRecord.getRequest());
   responseViewer.displayHttpResponse(currentRecord.getResponse());
 }
  @Override
  public String getColumnText(Object element, int columnIndex) {
    if (!(element instanceof IRequestLogRecord)) return null;
    final IRequestLogRecord record = (IRequestLogRecord) element;
    URI uri;
    try {
      uri = new URI(record.getRequest().getRequestLine().getUri());

    } catch (URISyntaxException e) {
      return null;
    }
    switch (columnIndex) {
      case 0:
        return Long.toString(record.getRequestId());
      case 1:
        return record.getHttpHost().toURI();
      case 2:
        return record.getRequest().getRequestLine().getMethod();
      case 3:
        if (uri.getRawQuery() != null) return uri.getRawPath() + "?" + uri.getRawQuery();
        else return uri.getRawPath();
      case 4:
        return Integer.valueOf(record.getResponse().getStatusLine().getStatusCode()).toString();
      case 5:
        return getResponseLength(record.getResponse());
      case 6:
        return Long.toString(record.getRequestMilliseconds());
    }
    return null;
  }
Example #3
0
 public String renderResponseText(IRequestLogRecord record) {
   return renderResponseText(record.getResponse());
 }