19 |
|
*/ |
20 |
|
public static final String REVISION = "$Revision$"; |
21 |
|
|
22 |
< |
public static final int OK = 0; |
23 |
< |
public static final int WARNING = 1; |
24 |
< |
public static final int FATAL = 2; |
22 |
> |
public static final int thresholdNORMAL = 0; |
23 |
> |
public static final int thresholdLOWER = 1; |
24 |
> |
public static final int thresholdUPPER = 2; |
25 |
|
|
26 |
< |
public static final String[] alerts = {"OK", "WARNING", "FATAL"}; |
26 |
> |
public static final String[] thresholdLevels = {"NORMAL", "LOWER", "UPPER"}; |
27 |
|
|
28 |
+ |
public static final int alertOK = 0; |
29 |
+ |
public static final int alertNOTICE = 1; |
30 |
+ |
public static final int alertWARNING = 2; |
31 |
+ |
public static final int alertCAUTION = 3; |
32 |
+ |
public static final int alertCRITICAL = 4; |
33 |
+ |
// note FINAL should be the highest alert |
34 |
+ |
public static final int alertFINAL = 5; |
35 |
+ |
|
36 |
+ |
// note FINAL should be last in this list |
37 |
+ |
public static final String[] alertLevels = {"OK", "NOTICE", "WARNING", "CAUTION", "CRITICAL", "FINAL"}; |
38 |
+ |
|
39 |
|
//---STATIC METHODS--- |
40 |
|
|
41 |
|
//---CONSTRUCTORS--- |
45 |
|
* |
46 |
|
* @param level the level of the alert |
47 |
|
*/ |
48 |
< |
public Alert(int level, String source, String thresholdValue, String value, String attributeName) { |
49 |
< |
_level = level; |
48 |
> |
public Alert(int alertLevel, int lastAlert, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert) { |
49 |
> |
_alertLevel = alertLevel; |
50 |
> |
_lastAlert = lastAlert; |
51 |
> |
_thresholdLevel = thresholdLevel; |
52 |
|
_source = source; |
53 |
|
_thresholdValue = thresholdValue; |
54 |
|
_value = value; |
55 |
|
_attributeName = attributeName; |
56 |
+ |
_timeTillNextAlert = timeTillNextAlert; |
57 |
|
} |
58 |
|
|
59 |
|
//---PUBLIC METHODS--- |
82 |
|
* Returns the level of this packet |
83 |
|
*/ |
84 |
|
public int getLevel() { |
85 |
< |
return _level; |
85 |
> |
return _alertLevel; |
86 |
|
} |
87 |
|
|
88 |
+ |
public int getLastLevel() { |
89 |
+ |
return _lastAlert; |
90 |
+ |
} |
91 |
+ |
|
92 |
+ |
public int getThreshold() { |
93 |
+ |
return _thresholdLevel; |
94 |
+ |
} |
95 |
+ |
|
96 |
|
public String getSource() { |
97 |
|
return _source; |
98 |
|
} |
108 |
|
public String getAttributeName() { |
109 |
|
return _attributeName; |
110 |
|
} |
111 |
+ |
|
112 |
+ |
public String getTimeTillNextAlert() { |
113 |
+ |
return _timeTillNextAlert; |
114 |
+ |
} |
115 |
|
|
116 |
|
//---ATTRIBUTES--- |
117 |
|
|
129 |
|
/** |
130 |
|
* The alert level of this packet |
131 |
|
*/ |
132 |
< |
private int _level; |
132 |
> |
private int _alertLevel; |
133 |
|
|
134 |
+ |
private int _lastAlert; |
135 |
+ |
|
136 |
+ |
private int _thresholdLevel; |
137 |
+ |
|
138 |
|
private String _source; |
139 |
|
private String _value; |
140 |
|
private String _thresholdValue; |
141 |
|
private String _attributeName; |
142 |
+ |
private String _timeTillNextAlert; |
143 |
|
|
144 |
|
//---STATIC ATTRIBUTES--- |
145 |
|
|