int type = payload.getType();
String ip = payload.getIp();
String subject = payload.getTitle();
String content = payload.getContent();
String time = payload.getTime();
Event event = new Event();
if (StringUtils.isEmpty(subject)) {
subject = content;
}
if (type == EventCollectManager.DB_ERROR) {
event.setDomain(payload.getDatabase());
} else {
String domain = m_hostinfoService.queryDomainByIp(ip);
event.setDomain(domain);
}
event.setIp(ip);
event.setType(type);
event.setContent(content);
event.setSubject(subject);
event.setLink(payload.getLink());
try {
event.setDate(m_sdf.parse(time));
} catch (ParseException e) {
event.setDate(new Date());
try {
event.setDate(new Date(Integer.parseInt(time)));
} catch (Exception ex) {
event.setDate(new Date());
Cat.logError(ex);
}
}
m_errorCollectManager.addEvent(event);
model.setAction(Action.VIEW);