Search in sources :

Example 6 with TableAlert

use of org.parosproxy.paros.db.TableAlert in project zaproxy by zaproxy.

the class ExtensionAlert method writeAlertToDB.

private void writeAlertToDB(Alert alert, HistoryReference ref) throws HttpMalformedHeaderException, DatabaseException {
    TableAlert tableAlert = getModel().getDb().getTableAlert();
    int scanId = 0;
    if (recordScan != null) {
        scanId = recordScan.getScanId();
    }
    RecordAlert recordAlert = tableAlert.write(scanId, alert.getPluginId(), alert.getName(), alert.getRisk(), alert.getConfidence(), alert.getDescription(), alert.getUri(), alert.getParam(), alert.getAttack(), alert.getOtherInfo(), alert.getSolution(), alert.getReference(), alert.getEvidence(), alert.getCweId(), alert.getWascId(), ref.getHistoryId(), alert.getSourceHistoryId(), alert.getSource().getId());
    alert.setAlertId(recordAlert.getAlertId());
}
Also used : TableAlert(org.parosproxy.paros.db.TableAlert) RecordAlert(org.parosproxy.paros.db.RecordAlert)

Aggregations

TableAlert (org.parosproxy.paros.db.TableAlert)6 RecordAlert (org.parosproxy.paros.db.RecordAlert)5 Alert (org.parosproxy.paros.core.scanner.Alert)4 ArrayList (java.util.ArrayList)3 DatabaseException (org.parosproxy.paros.db.DatabaseException)3 ExtensionAlert (org.zaproxy.zap.extension.alert.ExtensionAlert)2 Enumeration (java.util.Enumeration)1 List (java.util.List)1 RecordHistory (org.parosproxy.paros.db.RecordHistory)1 TableHistory (org.parosproxy.paros.db.TableHistory)1 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)1 HistoryReference (org.parosproxy.paros.model.HistoryReference)1 Session (org.parosproxy.paros.model.Session)1 SiteMap (org.parosproxy.paros.model.SiteMap)1 SiteNode (org.parosproxy.paros.model.SiteNode)1 HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)1