--- projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java 2001/03/05 23:12:43 1.16 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java 2001/03/06 02:33:55 1.17 @@ -18,8 +18,8 @@ import java.text.*; * Clean shutdown could be achieved by stopping the run() method in the * IRCBot inner class. * - * @author $Author: tdb $ - * @version $Id: IRC__Alerter.java,v 1.16 2001/03/05 23:12:43 tdb Exp $ + * @author $Author: ajm $ + * @version $Id: IRC__Alerter.java,v 1.17 2001/03/06 02:33:55 ajm Exp $ */ public class IRC__Alerter implements PluginAlerter { @@ -28,7 +28,7 @@ public class IRC__Alerter implements PluginAlerter { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.16 $"; + public final String REVISION = "$Revision: 1.17 $"; /** * A description of this alerter @@ -77,6 +77,8 @@ public class IRC__Alerter implements PluginAlerter { if(((alert.getLevel() == 0) && (alert.getLastLevel() >= level)) || (alert.getLevel() >= level)) { String alertType = Alert.alertLevels[alert.getLevel()]; String thresholdType = Alert.thresholdLevels[alert.getThreshold()]; + String timeFirstSince = DateUtils.formatTime(System.currentTimeMillis() - alert.getInitialAlertTime(), "%DAYS% days, %HOURS% hours, %MINS% mins, and %SECS% secs"); + String timeFirstOccured = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.UK).format(new Date(alert.getInitialAlertTime())); // sort out the message String message; try { @@ -93,6 +95,8 @@ public class IRC__Alerter implements PluginAlerter { message = StringUtils.replaceText(message, "%thresholdValue%", alert.getThresholdValue()); message = StringUtils.replaceText(message, "%attributeName%", alert.getAttributeName()); message = StringUtils.replaceText(message, "%timeTillNextAlert%", getTimeString(Long.parseLong(alert.getTimeTillNextAlert()))); + message = StringUtils.replaceText(message, "%timeSinceFirstAlert%", timeFirstSince); + message = StringUtils.replaceText(message, "%timeOfFirstAlert%", timeFirstOccured); // send the message _logger.write(toString(), Logger.DEBUG, "Sending " + _name + " at "+ alertType + " level");