10 |
|
* @author $Author$ |
11 |
|
* @version $Id$ |
12 |
|
*/ |
13 |
< |
class Alert { |
13 |
> |
public class Alert { |
14 |
|
|
15 |
|
//---FINAL ATTRIBUTES--- |
16 |
|
|
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"; |
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) { |
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--- |
74 |
|
//---PRIVATE METHODS--- |
75 |
|
|
76 |
|
//---ACCESSOR/MUTATOR METHODS--- |
77 |
+ |
|
78 |
+ |
/** |
79 |
+ |
* Returns the level of this packet |
80 |
+ |
*/ |
81 |
+ |
public int getLevel() { |
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 |
+ |
} |
96 |
+ |
|
97 |
+ |
public String getValue() { |
98 |
+ |
return _value; |
99 |
+ |
} |
100 |
+ |
|
101 |
+ |
public String getThresholdValue() { |
102 |
+ |
return _thresholdValue; |
103 |
+ |
} |
104 |
+ |
|
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 |
|
|