1 |
//---PACKAGE DECLARATION--- |
2 |
package uk.ac.ukc.iscream.client; |
3 |
|
4 |
//---IMPORTS--- |
5 |
import uk.ac.ukc.iscream.util.*; |
6 |
|
7 |
/** |
8 |
* Alert Object |
9 |
* |
10 |
* @author $Author$ |
11 |
* @version $Id$ |
12 |
*/ |
13 |
class Alert { |
14 |
|
15 |
//---FINAL ATTRIBUTES--- |
16 |
|
17 |
/** |
18 |
* The current CVS revision of this class |
19 |
*/ |
20 |
public static final String REVISION = "$Revision: 1.1 $"; |
21 |
|
22 |
// DEFINE MORE ALERT LEVELS HERE |
23 |
public static final int OK = "0"; |
24 |
|
25 |
//---STATIC METHODS--- |
26 |
|
27 |
//---CONSTRUCTORS--- |
28 |
|
29 |
/** |
30 |
* Construct an Alert packet at a set level. |
31 |
* |
32 |
* @param level the level of the alert |
33 |
*/ |
34 |
public Alert(int level) { |
35 |
_level = level; |
36 |
} |
37 |
|
38 |
//---PUBLIC METHODS--- |
39 |
|
40 |
/** |
41 |
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
42 |
* method to provide clean logging (every class should have this). |
43 |
* |
44 |
* This uses the uk.ac.ukc.iscream.util.FormatName class |
45 |
* to format the toString() |
46 |
* |
47 |
* @return the name of this class and its CVS revision |
48 |
*/ |
49 |
public String toString() { |
50 |
return FormatName.getName( |
51 |
_name, |
52 |
getClass().getName(), |
53 |
REVISION); |
54 |
} |
55 |
|
56 |
//---PRIVATE METHODS--- |
57 |
|
58 |
//---ACCESSOR/MUTATOR METHODS--- |
59 |
|
60 |
//---ATTRIBUTES--- |
61 |
|
62 |
/** |
63 |
* This is the friendly identifier of the |
64 |
* component this class is running in. |
65 |
* eg, a Filter may be called "filter1", |
66 |
* If this class does not have an owning |
67 |
* component, a name from the configuration |
68 |
* can be placed here. This name could also |
69 |
* be changed to null for utility classes. |
70 |
*/ |
71 |
private String _name = ClientMain.NAME; |
72 |
|
73 |
/** |
74 |
* The alert level of this packet |
75 |
*/ |
76 |
private int _level; |
77 |
|
78 |
//---STATIC ATTRIBUTES--- |
79 |
|
80 |
} |