예제 #1
0
  /*==========================================================
   * public methods
   *==========================================================*/
  public void processData(Object data) {
    Vector v = new Vector();

    NameValuePairs obj = (NameValuePairs) data;

    // XXX NEED TO CHANGE if we are going to have multi-column table
    v.addElement(
        new JLabel(
            obj.get(CERT_NAME),
            CMSAdminUtil.getImage(CMSAdminResources.IMAGE_CERTICON_SMALL),
            JLabel.LEFT));
    addRow(v, data);
  }
예제 #2
0
  /*==========================================================
   * public methods
   *==========================================================*/
  public Vector parse(Object entry) throws ParseException {
    String logEntry = (String) entry;
    // parsing the log Entry and return segments
    // Debug.println("LogDataModel: DefaultLogParser: parse() -" +logEntry);
    int x = logEntry.indexOf("[");
    if (x == -1) throw new ParseException(logEntry, 0);
    String temp = logEntry.substring(x + 1);
    x = temp.indexOf("]");
    if (x == -1) throw new ParseException(logEntry, 0);

    String dateStr = temp.substring(0, x);
    // Debug.println("LogDataModel: DefaultLogParser: parse() -"+dateStr+" "+temp);
    SimpleDateFormat format = new SimpleDateFormat(DATE_PATTERN);
    Date date = format.parse(dateStr);
    String dateColumn = DateFormat.getDateInstance().format(date);
    String timeColumn = DateFormat.getTimeInstance().format(date);

    // Debug.println("LogDataModel: DefaultLogParser: parse() -"+dateColumn+" "+timeColumn);
    temp = temp.substring(x + 2);
    x = temp.indexOf("]");
    if (x == -1) throw new ParseException(logEntry, 0);
    String source = temp.substring(1, x);
    temp = temp.substring(x + 2);
    x = temp.indexOf("]");
    if (x == -1) throw new ParseException(logEntry, 0);
    String level = temp.substring(1, x);
    temp = temp.substring(x + 2);
    Vector row = new Vector();
    row.addElement(getSourceString(source));
    row.addElement(getLevelString(level));
    row.addElement(dateColumn);
    row.addElement(timeColumn);
    JLabel detail = new JLabel(temp);
    detail.setToolTipText(temp);
    row.addElement(detail);
    return row;
  }