ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/Alert.java
Revision: 1.4
Committed: Fri Mar 2 00:13:57 2001 UTC (23 years, 3 months ago) by tdb
Branch: MAIN
Changes since 1.3: +4 -5 lines
Log Message:
Silly development comment.

File Contents

# User Rev Content
1 tdb 1.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 tdb 1.4 * @author $Author: ajm4 $
11     * @version $Id: Alert.java,v 1.3 2001/03/02 00:08:17 ajm4 Exp $
12 tdb 1.1 */
13 ajm 1.3 public class Alert {
14 tdb 1.1
15     //---FINAL ATTRIBUTES---
16    
17     /**
18     * The current CVS revision of this class
19     */
20 tdb 1.4 public static final String REVISION = "$Revision: 1.3 $";
21    
22 tdb 1.2 public static final int OK = 0;
23 ajm 1.3 public static final int WARNING = 1;
24     public static final int FATAL = 2;
25    
26     public static final String[] alerts = {"OK", "WARNING", "FATAL"};
27 tdb 1.1
28     //---STATIC METHODS---
29    
30     //---CONSTRUCTORS---
31    
32     /**
33     * Construct an Alert packet at a set level.
34     *
35     * @param level the level of the alert
36     */
37 ajm 1.3 public Alert(int level, String thresholdValue, String value, String attributeName) {
38 tdb 1.1 _level = level;
39 ajm 1.3 _thresholdValue = thresholdValue;
40     _value = value;
41     _attributeName = attributeName;
42 tdb 1.1 }
43    
44     //---PUBLIC METHODS---
45    
46     /**
47     * Overrides the {@link java.lang.Object#toString() Object.toString()}
48     * method to provide clean logging (every class should have this).
49     *
50     * This uses the uk.ac.ukc.iscream.util.FormatName class
51     * to format the toString()
52     *
53     * @return the name of this class and its CVS revision
54     */
55     public String toString() {
56     return FormatName.getName(
57     _name,
58     getClass().getName(),
59     REVISION);
60     }
61    
62     //---PRIVATE METHODS---
63    
64     //---ACCESSOR/MUTATOR METHODS---
65 tdb 1.2
66     /**
67     * Returns the level of this packet
68     */
69     public int getLevel() {
70     return _level;
71     }
72 ajm 1.3
73     public String getValue() {
74     return _value;
75     }
76    
77     public String getThresholdValue() {
78     return _thresholdValue;
79     }
80    
81     public String getAttributeName() {
82     return _attributeName;
83     }
84 tdb 1.1
85     //---ATTRIBUTES---
86    
87     /**
88     * This is the friendly identifier of the
89     * component this class is running in.
90     * eg, a Filter may be called "filter1",
91     * If this class does not have an owning
92     * component, a name from the configuration
93     * can be placed here. This name could also
94     * be changed to null for utility classes.
95     */
96     private String _name = ClientMain.NAME;
97    
98     /**
99     * The alert level of this packet
100     */
101     private int _level;
102 ajm 1.3
103     private String _value;
104     private String _thresholdValue;
105     private String _attributeName;
106 tdb 1.1
107     //---STATIC ATTRIBUTES---
108    
109     }