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", "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 lastAlert, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert) { |
46 |
> |
_alertLevel = alertLevel; |
47 |
> |
_lastAlert = lastAlert; |
48 |
> |
_thresholdLevel = thresholdLevel; |
49 |
|
_source = source; |
50 |
|
_thresholdValue = thresholdValue; |
51 |
|
_value = value; |
52 |
|
_attributeName = attributeName; |
53 |
+ |
_timeTillNextAlert = timeTillNextAlert; |
54 |
|
} |
55 |
|
|
56 |
|
//---PUBLIC METHODS--- |
79 |
|
* Returns the level of this packet |
80 |
|
*/ |
81 |
|
public int getLevel() { |
82 |
< |
return _level; |
82 |
> |
return _alertLevel; |
83 |
|
} |
84 |
|
|
85 |
+ |
public int getLastLevel() { |
86 |
+ |
return _lastAlert; |
87 |
+ |
} |
88 |
+ |
|
89 |
+ |
public int getThreshold() { |
90 |
+ |
return _thresholdLevel; |
91 |
+ |
} |
92 |
+ |
|
93 |
|
public String getSource() { |
94 |
|
return _source; |
95 |
|
} |
105 |
|
public String getAttributeName() { |
106 |
|
return _attributeName; |
107 |
|
} |
108 |
+ |
|
109 |
+ |
public String getTimeTillNextAlert() { |
110 |
+ |
return _timeTillNextAlert; |
111 |
+ |
} |
112 |
|
|
113 |
|
//---ATTRIBUTES--- |
114 |
|
|
126 |
|
/** |
127 |
|
* The alert level of this packet |
128 |
|
*/ |
129 |
< |
private int _level; |
129 |
> |
private int _alertLevel; |
130 |
|
|
131 |
+ |
private int _lastAlert; |
132 |
+ |
|
133 |
+ |
private int _thresholdLevel; |
134 |
+ |
|
135 |
|
private String _source; |
136 |
|
private String _value; |
137 |
|
private String _thresholdValue; |
138 |
|
private String _attributeName; |
139 |
+ |
private String _timeTillNextAlert; |
140 |
|
|
141 |
|
//---STATIC ATTRIBUTES--- |
142 |
|
|