}
logger.debug("Scanner " + scanner.getName() +
" matched URL " + msg.getRequestHeader().getURI().toString() +
" action = " + scanner.getType().toString());
HistoryReference hRef = msg.getHistoryRef();
switch (scanner.getType()) {
case TAG:
String tag = scanner.getConfig();
msg.addTag(tag);
if (hRef != null) {
// If the hRef has been created before msg gets updated then
// the tag wont have been stored in the db, so double check
// and add in if missing
if (! hRef.getTags().contains(tag)) {
hRef.addTag(tag);
extHist.getHistoryList().notifyItemChanged(hRef);
}
}
break;
case ALERT:
Alert alert = scanner.getAlert(msg);
if (hRef != null) {
// If the hRef has been created before msg gets updated then
// the alerts wont have been stored in the db, so double check
// and add in if missing
// TODO of course this wont help if the href doesnt exist...
alert.setSourceHistoryId(hRef.getHistoryId());
hRef.addAlert(alert);
extHist.getHistoryList().notifyItemChanged(hRef);
}
// Raise the alert
extScan.alertFound(alert);