--- projects/cms/source/server/uk/org/iscream/cms/server/client/Alert.java 2001/03/02 05:42:38 1.7 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/Alert.java 2001/03/04 02:41:16 1.8 @@ -8,7 +8,7 @@ import uk.ac.ukc.iscream.util.*; * Alert Object * * @author $Author: ajm $ - * @version $Id: Alert.java,v 1.7 2001/03/02 05:42:38 ajm Exp $ + * @version $Id: Alert.java,v 1.8 2001/03/04 02:41:16 ajm Exp $ */ public class Alert { @@ -17,14 +17,22 @@ public class Alert { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.7 $"; + public static final String REVISION = "$Revision: 1.8 $"; - public static final int OK = 0; - public static final int WARNING = 1; - public static final int CRITICAL = 2; + public static final int thresholdNORMAL = 0; + public static final int thresholdLOWER = 1; + public static final int thresholdUPPER = 2; - public static final String[] alerts = {"OK", "WARNING", "CRITICAL"}; + public static final String[] thresholdLevels = {"NORMAL", "LOWER", "UPPER"}; + public static final int alertOK = 0; + public static final int alertNOTICE = 1; + public static final int alertWARNING = 2; + public static final int alertCAUTION = 3; + public static final int alertCRITICAL = 4; + + public static final String[] alertLevels = {"OK", "NOTICE", "WARNING", "CAUTION", "CRITICAL"}; + //---STATIC METHODS--- //---CONSTRUCTORS--- @@ -34,12 +42,14 @@ public class Alert { * * @param level the level of the alert */ - public Alert(int level, String source, String thresholdValue, String value, String attributeName) { - _level = level; + public Alert(int alertLevel, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert) { + _alertLevel = alertLevel; + _thresholdLevel = thresholdLevel; _source = source; _thresholdValue = thresholdValue; _value = value; _attributeName = attributeName; + _timeTillNextAlert = timeTillNextAlert; } //---PUBLIC METHODS--- @@ -68,9 +78,13 @@ public class Alert { * Returns the level of this packet */ public int getLevel() { - return _level; + return _alertLevel; } + public int getThreshold() { + return _thresholdLevel; + } + public String getSource() { return _source; } @@ -86,6 +100,10 @@ public class Alert { public String getAttributeName() { return _attributeName; } + + public String getTimeTillNextAlert() { + return _timeTillNextAlert; + } //---ATTRIBUTES--- @@ -103,12 +121,15 @@ public class Alert { /** * The alert level of this packet */ - private int _level; + private int _alertLevel; + private int _thresholdLevel; + private String _source; private String _value; private String _thresholdValue; private String _attributeName; + private String _timeTillNextAlert; //---STATIC ATTRIBUTES---