return treeAlert;
}
private void writeAlertToDB(Alert alert) throws HttpMalformedHeaderException, SQLException {
TableAlert tableAlert = getModel().getDb().getTableAlert();
HistoryReference ref = new HistoryReference(getModel().getSession(), HistoryReference.TYPE_SCANNER, alert.getMessage());
// ZAP: cope with recordScan being null
int scanId = 0;
if (recordScan != null) {
scanId = recordScan.getScanId();
}
RecordAlert recordAlert = tableAlert.write(scanId, alert.getPluginId(),
alert.getAlert(), alert.getRisk(), alert.getReliability(),
alert.getDescription(), alert.getUri(), alert.getParam(),
alert.getOtherInfo(), alert.getSolution(),
alert.getReference(), ref.getHistoryId(),
alert.getSourceHistoryId());