context.addProperty(Constants.ALERT_EVENT, aResult.toString()); context.addProperty(Constants.ALERT_MESSAGE, alertMessage); context.addProperty(Constants.ALERT_TIMESTAMP_PROPERTY, DateTimeUtil.millisecondsToHumanDateWithSeconds(System.currentTimeMillis())); context.addProperty(EagleConfigConstants.APPLICATION, applicatioin); context.addProperty(EagleConfigConstants.SITE, site); } catch (Exception ex) { LOG.error("site, dataSource not set in config file, ", ex); context.addProperty(EagleConfigConstants.APPLICATION, applicatioin); context.addProperty(EagleConfigConstants.SITE, site); context.addProperty(Constants.POLICY_NAME, alertContext.policyId);
private AlertEmailComponent getEventComponent(AlertContext context) { AlertContext eventFieldsContext = new AlertContext(); String eventFields = context.getProperty(Constants.ALERT_EVENT_FIELDS); String[] fields = eventFields.split(EVENT_FIELDS_SPLITTER); for (String key : fields) { eventFieldsContext.addProperty(key, context.getProperty(key)); } AlertEmailComponent component = new AlertEmailComponent(); component.setAlertContext(eventFieldsContext); return component; } }
context.addProperty(attrRenameList.get(index), rets.get(index)); Integer port = config.getInt(EagleConfigConstants.EAGLE_PROPS + "." + EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PORT); context.addProperty(Constants.ALERT_EVENT, alertEvent); context.addProperty(Constants.ALERT_EVENT_FIELDS, alertEventFields); context.addProperty(Constants.ALERT_MESSAGE, alertMessage); context.addProperty(Constants.ALERT_TIMESTAMP_PROPERTY, DateTimeUtil.millisecondsToHumanDateWithSeconds(System.currentTimeMillis())); context.addProperty(EagleConfigConstants.APPLICATION, application); context.addProperty(EagleConfigConstants.SITE, site); entity.setTimestamp(timestamp); entity.setTags(tags); context.addProperty(Constants.POLICY_DETAIL_URL, UrlBuilder.buiildPolicyDetailUrl(host, port, tags)); context.addProperty(Constants.ALERT_DETAIL_URL, UrlBuilder.buildAlertDetailUrl(host, port, entity)); entity.setAlertContext(context.toJsonString());