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 CRITICAL = 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", "CRITICAL"}; |
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 |
+ |
|
34 |
+ |
public static final String[] alertLevels = {"OK", "NOTICE", "WARNING", "CAUTION", "CRITICAL"}; |
35 |
+ |
|
36 |
|
//---STATIC METHODS--- |
37 |
|
|
38 |
|
//---CONSTRUCTORS--- |
42 |
|
* |
43 |
|
* @param level the level of the alert |
44 |
|
*/ |
45 |
< |
public Alert(int level, String source, String thresholdValue, String value, String attributeName) { |
46 |
< |
_level = level; |
45 |
> |
public Alert(int alertLevel, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert) { |
46 |
> |
_alertLevel = alertLevel; |
47 |
> |
_thresholdLevel = thresholdLevel; |
48 |
|
_source = source; |
49 |
|
_thresholdValue = thresholdValue; |
50 |
|
_value = value; |
51 |
|
_attributeName = attributeName; |
52 |
+ |
_timeTillNextAlert = timeTillNextAlert; |
53 |
|
} |
54 |
|
|
55 |
|
//---PUBLIC METHODS--- |
78 |
|
* Returns the level of this packet |
79 |
|
*/ |
80 |
|
public int getLevel() { |
81 |
< |
return _level; |
81 |
> |
return _alertLevel; |
82 |
|
} |
83 |
|
|
84 |
+ |
public int getThreshold() { |
85 |
+ |
return _thresholdLevel; |
86 |
+ |
} |
87 |
+ |
|
88 |
|
public String getSource() { |
89 |
|
return _source; |
90 |
|
} |
100 |
|
public String getAttributeName() { |
101 |
|
return _attributeName; |
102 |
|
} |
103 |
+ |
|
104 |
+ |
public String getTimeTillNextAlert() { |
105 |
+ |
return _timeTillNextAlert; |
106 |
+ |
} |
107 |
|
|
108 |
|
//---ATTRIBUTES--- |
109 |
|
|
121 |
|
/** |
122 |
|
* The alert level of this packet |
123 |
|
*/ |
124 |
< |
private int _level; |
124 |
> |
private int _alertLevel; |
125 |
|
|
126 |
+ |
private int _thresholdLevel; |
127 |
+ |
|
128 |
|
private String _source; |
129 |
|
private String _value; |
130 |
|
private String _thresholdValue; |
131 |
|
private String _attributeName; |
132 |
+ |
private String _timeTillNextAlert; |
133 |
|
|
134 |
|
//---STATIC ATTRIBUTES--- |
135 |
|
|