Package org.parosproxy.paros.db

Examples of org.parosproxy.paros.db.RecordHistory


            return true;
           
        } else {

            try {
                RecordHistory history = Model.getSingleton().getDb().getTableHistory().getHistoryCache(item.reference, msg);
                if (history == null) {
                    return false;
                }
               
                msg.setResponseHeader(history.getHttpMessage().getResponseHeader());
                msg.setResponseBody(history.getHttpMessage().getResponseBody());

                httpOut.write(msg.getResponseHeader());
                httpOut.flush();

                if (msg.getResponseBody().length() > 0) {
View Full Code Here


    public long getSessionId() {
        return sessionId;
    }

    public HistoryReference(int historyId) throws HttpMalformedHeaderException, SQLException {
    RecordHistory history = null;   
    history = staticTableHistory.read(historyId);
    HttpMessage msg = history.getHttpMessage();
    build(history.getSessionId(), history.getHistoryId(), history.getHistoryType(), msg);

  }
View Full Code Here

    build(history.getSessionId(), history.getHistoryId(), history.getHistoryType(), msg);

  }
 
  public HistoryReference(Session session, int historyType, HttpMessage msg) throws HttpMalformedHeaderException, SQLException {
    RecordHistory history = null;   
    history = staticTableHistory.write(session.getSessionId(), historyType, msg);   
    build(session.getSessionId(), history.getHistoryId(), history.getHistoryType(), msg);

   
  }
View Full Code Here

    return historyId;
  }

  public HttpMessage getHttpMessage() throws HttpMalformedHeaderException, SQLException {
    // fetch complete message
    RecordHistory history = staticTableHistory.read(historyId);
    return history.getHttpMessage();
  }
View Full Code Here

   
  private void buildHistoryMap (TableHistory th, Map<String, String> map)
        throws SQLException, HttpMalformedHeaderException {

    // Get the first session id
      RecordHistory rh = null;
      for (int i=0; i < 100; i++ ) {
        rh = th.read(i);
        if (rh != null) {
          break;
        }
      }
      if (rh == null) {
        return;
      }
        @SuppressWarnings("unchecked")
      Vector<Integer> hIds = th.getHistoryList(rh.getSessionId(), HistoryReference.TYPE_MANUAL);
      for (Integer hId : hIds) {
        RecordHistory recH = th.read(hId);
        URI uri = recH.getHttpMessage().getRequestHeader().getURI();
        String mapKey = recH.getHttpMessage().getRequestHeader().getMethod() +
          " " + uri.toString();
       
        // TODO Optionally strip off params?
        if (mapKey.indexOf("?") > -1) {
          mapKey = mapKey.substring(0, mapKey.indexOf("?"));
        }
       
        String val = map.get(mapKey);
        String code = recH.getHttpMessage().getResponseHeader().getStatusCode() + " ";
        if (val == null) {
          map.put(mapKey, code);
        } else if (val.indexOf(code) < 0){
          map.put(mapKey, val + code);
        }
View Full Code Here

            return true;
           
        } else {

            try {
                RecordHistory history = Model.getSingleton().getDb().getTableHistory().getHistoryCache(item.reference, msg);
                if (history == null) {
                    return false;
                }
               
                msg.setResponseHeader(history.getHttpMessage().getResponseHeader());
                msg.setResponseBody(history.getHttpMessage().getResponseBody());

                httpOut.write(msg.getResponseHeader());
                httpOut.flush();

                if (msg.getResponseBody().length() > 0) {
View Full Code Here

  public long getSessionId() {
    return sessionId;
  }

  public HistoryReference(int historyId) throws HttpMalformedHeaderException, SQLException {
    RecordHistory history = null;
    history = staticTableHistory.read(historyId);
    HttpMessage msg = history.getHttpMessage();
    // ZAP: Support for multiple tags
    List<RecordTag> tags = staticTableTag.getTagsForHistoryID(historyId);
    for (RecordTag tr : tags) {
      msg.addTag(tr.getTag());
    }
    build(history.getSessionId(), history.getHistoryId(), history.getHistoryType(), msg);
   
    // ZAP: Support for loading the alerts from the db
    List<RecordAlert> alerts = staticTableAlert.getAlertsBySourceHistoryId(historyId);
    for (RecordAlert alert: alerts) {
      this.addAlert(new Alert(alert, this));
View Full Code Here

  }

  public HistoryReference(Session session, int historyType, HttpMessage msg)
  throws HttpMalformedHeaderException, SQLException {
   
    RecordHistory history = null;
    history = staticTableHistory.write(session.getSessionId(), historyType, msg);
    build(session.getSessionId(), history.getHistoryId(), history.getHistoryType(), msg);
    // ZAP: Init HttpMessage HistoryReference field
    msg.setHistoryRef(this);
    // ZAP: Support for multiple tags
    for (String tag : msg.getTags()) {
      this.addTag(tag);
View Full Code Here

    return historyId;
  }

  public HttpMessage getHttpMessage() throws HttpMalformedHeaderException, SQLException {
    // fetch complete message
    RecordHistory history = staticTableHistory.read(historyId);
    if (history == null) {
      return null;
    }
    if (history.getHttpMessage() != null) {
      // ZAP: Support for multiple tags
      List <RecordTag> tags = staticTableTag.getTagsForHistoryID(historyId);
      for (RecordTag tag : tags) {
        history.getHttpMessage().addTag(tag.getTag());
      }
    }
    // ZAP: Init HttpMessage HistoryReference field
    history.getHttpMessage().setHistoryRef(this);
    return history.getHttpMessage();
  }
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.db.RecordHistory

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.