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 OK = 0; |
23 |
+ |
public static final int WARNING = 1; |
24 |
+ |
public static final int FATAL = 2; |
25 |
|
|
26 |
< |
// DEFINE MORE ALERT LEVELS HERE |
23 |
< |
public static final int OK = "0"; |
26 |
> |
public static final String[] alerts = {"OK", "WARNING", "FATAL"}; |
27 |
|
|
28 |
|
//---STATIC METHODS--- |
29 |
|
|
34 |
|
* |
35 |
|
* @param level the level of the alert |
36 |
|
*/ |
37 |
< |
public Alert(int level) { |
37 |
> |
public Alert(int level, String source, String thresholdValue, String value, String attributeName) { |
38 |
|
_level = level; |
39 |
+ |
_source = source; |
40 |
+ |
_thresholdValue = thresholdValue; |
41 |
+ |
_value = value; |
42 |
+ |
_attributeName = attributeName; |
43 |
|
} |
44 |
|
|
45 |
|
//---PUBLIC METHODS--- |
63 |
|
//---PRIVATE METHODS--- |
64 |
|
|
65 |
|
//---ACCESSOR/MUTATOR METHODS--- |
66 |
+ |
|
67 |
+ |
/** |
68 |
+ |
* Returns the level of this packet |
69 |
+ |
*/ |
70 |
+ |
public int getLevel() { |
71 |
+ |
return _level; |
72 |
+ |
} |
73 |
+ |
|
74 |
+ |
public String getSource() { |
75 |
+ |
return _source; |
76 |
+ |
} |
77 |
+ |
|
78 |
+ |
public String getValue() { |
79 |
+ |
return _value; |
80 |
+ |
} |
81 |
+ |
|
82 |
+ |
public String getThresholdValue() { |
83 |
+ |
return _thresholdValue; |
84 |
+ |
} |
85 |
+ |
|
86 |
+ |
public String getAttributeName() { |
87 |
+ |
return _attributeName; |
88 |
+ |
} |
89 |
|
|
90 |
|
//---ATTRIBUTES--- |
91 |
|
|
104 |
|
* The alert level of this packet |
105 |
|
*/ |
106 |
|
private int _level; |
107 |
+ |
|
108 |
+ |
private String _source; |
109 |
+ |
private String _value; |
110 |
+ |
private String _thresholdValue; |
111 |
+ |
private String _attributeName; |
112 |
|
|
113 |
|
//---STATIC ATTRIBUTES--- |
114 |
|
|