106 |
|
// get some values |
107 |
|
String alertType = Alert.alertLevels[alert.getLevel()]; |
108 |
|
String thresholdType = Alert.thresholdLevels[alert.getThreshold()]; |
109 |
< |
String timeFirstSince = DateUtils.formatTime((System.currentTimeMillis() - alert.getInitialAlertTime()), "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs"); |
109 |
> |
String timeSinceFirst = DateUtils.formatTime((System.currentTimeMillis() - alert.getInitialAlertTime())/1000, "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs"); |
110 |
|
String timeFirstOccured = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.UK).format(new Date(alert.getInitialAlertTime())); |
111 |
|
|
112 |
|
// replace fields in message |
117 |
|
message = StringUtils.replaceText(message, "%thresholdValue%", alert.getThresholdValue()); |
118 |
|
message = StringUtils.replaceText(message, "%attributeName%", alert.getAttributeName()); |
119 |
|
message = StringUtils.replaceText(message, "%timeTillNextAlert%", DateUtils.getTimeString(Long.parseLong(alert.getTimeTillNextAlert()))); |
120 |
< |
message = StringUtils.replaceText(message, "%timeSinceFirstAlert%", timeFirstSince); |
120 |
> |
message = StringUtils.replaceText(message, "%timeSinceFirstAlert%", timeSinceFirst); |
121 |
|
message = StringUtils.replaceText(message, "%timeOfFirstAlert%", timeFirstOccured); |
122 |
|
return message; |
123 |
|
} |