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/Alert.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/Alert.java (file contents):
Revision 1.3 by ajm, Fri Mar 2 00:08:17 2001 UTC vs.
Revision 1.11 by ajm, Tue Mar 6 02:33:55 2001 UTC

# Line 18 | Line 18 | public class Alert {
18       * The current CVS revision of this class
19       */
20      public static final String REVISION = "$Revision$";
21 +
22 +    public static final int thresholdNORMAL = 0;
23 +    public static final int thresholdLOWER = 1;
24 +    public static final int thresholdUPPER = 2;
25      
26 <    // DEFINE MORE ALERT LEVELS HERE
23 <    public static final int OK = 0;
24 <    public static final int WARNING = 1;
25 <    public static final int FATAL = 2;
26 >    public static final String[] thresholdLevels = {"NORMAL", "LOWER", "UPPER"};
27      
28 <    public static final String[] alerts = {"OK", "WARNING", "FATAL"};
28 >    // not OK and FINAL MUST be present...at the beginning and the end
29      
30 +    public static final int alertOK = 0;
31 +    public static final int alertNOTICE = 1;
32 +    public static final int alertWARNING = 2;
33 +    public static final int alertCAUTION = 3;
34 +    public static final int alertCRITICAL = 4;
35 +    // note FINAL should be the highest alert
36 +    public static final int alertFINAL = 5;
37 +    
38 +    // note FINAL should be last in this list
39 +    public static final String[] alertLevels = {"OK", "NOTICE", "WARNING", "CAUTION", "CRITICAL", "FINAL"};
40 +    
41   //---STATIC METHODS---
42  
43   //---CONSTRUCTORS---
# Line 35 | Line 47 | public class Alert {
47       *
48       * @param level the level of the alert
49       */
50 <    public Alert(int level, String thresholdValue, String value, String attributeName) {
51 <        _level = level;
50 >    public Alert(int alertLevel, int lastAlert, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert, long initialAlertTime) {
51 >        _alertLevel = alertLevel;
52 >        _lastAlert = lastAlert;
53 >        _thresholdLevel = thresholdLevel;
54 >        _source = source;
55          _thresholdValue = thresholdValue;
56          _value = value;
57          _attributeName = attributeName;
58 +        _timeTillNextAlert = timeTillNextAlert;
59 +        _initialAlertTime = initialAlertTime;
60      }
61  
62   //---PUBLIC METHODS---
# Line 68 | Line 85 | public class Alert {
85       * Returns the level of this packet
86       */
87      public int getLevel() {
88 <        return _level;
88 >        return _alertLevel;
89      }
90      
91 +    public int getLastLevel() {
92 +        return _lastAlert;
93 +    }
94 +    
95 +    public int getThreshold() {
96 +        return _thresholdLevel;
97 +    }
98 +    
99 +    public String getSource() {
100 +        return _source;
101 +    }
102 +    
103      public String getValue() {
104          return _value;
105      }
# Line 82 | Line 111 | public class Alert {
111      public String getAttributeName() {
112          return _attributeName;
113      }
114 +    
115 +    public String getTimeTillNextAlert() {
116 +        return _timeTillNextAlert;
117 +    }
118 +    
119 +    public long getInitialAlertTime () {
120 +        return _initialAlertTime;
121 +    }
122  
123   //---ATTRIBUTES---
124  
# Line 99 | Line 136 | public class Alert {
136      /**
137       * The alert level of this packet
138       */
139 <    private int _level;
139 >    private int _alertLevel;
140      
141 +    private int _lastAlert;
142 +    
143 +    private int _thresholdLevel;
144 +    
145 +    private String _source;
146      private String _value;
147      private String _thresholdValue;
148      private String _attributeName;
149 +    private String _timeTillNextAlert;
150 +    
151 +    private long _initialAlertTime;
152  
153   //---STATIC ATTRIBUTES---
154  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines