ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java (file contents):
Revision 1.16 by tdb, Mon Mar 5 23:12:43 2001 UTC vs.
Revision 1.17 by ajm, Tue Mar 6 02:33:55 2001 UTC

# Line 77 | Line 77 | public class IRC__Alerter implements PluginAlerter {
77              if(((alert.getLevel() == 0) && (alert.getLastLevel() >= level)) || (alert.getLevel() >= level)) {
78                  String alertType = Alert.alertLevels[alert.getLevel()];
79                  String thresholdType = Alert.thresholdLevels[alert.getThreshold()];
80 +                String timeFirstSince = DateUtils.formatTime(System.currentTimeMillis() - alert.getInitialAlertTime(), "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs");
81 +                String timeFirstOccured = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.UK).format(new Date(alert.getInitialAlertTime()));
82                  // sort out the message              
83                  String message;
84                  try {
# Line 93 | Line 95 | public class IRC__Alerter implements PluginAlerter {
95                  message = StringUtils.replaceText(message, "%thresholdValue%", alert.getThresholdValue());
96                  message = StringUtils.replaceText(message, "%attributeName%", alert.getAttributeName());
97                  message = StringUtils.replaceText(message, "%timeTillNextAlert%",  getTimeString(Long.parseLong(alert.getTimeTillNextAlert())));
98 +                message = StringUtils.replaceText(message, "%timeSinceFirstAlert%", timeFirstSince);
99 +                message = StringUtils.replaceText(message, "%timeOfFirstAlert%", timeFirstOccured);
100                  
101                  // send the message
102                  _logger.write(toString(), Logger.DEBUG, "Sending " + _name + " at "+ alertType + " level");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines