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.7
Committed: Fri Mar 2 05:42:38 2001 UTC (23 years, 2 months ago) by ajm
Branch: MAIN
Changes since 1.6: +4 -4 lines
Log Message:
minor update - hey, I'm fussy ;p

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 ajm 1.7 * @author $Author: ajm4 $
11     * @version $Id: Alert.java,v 1.6 2001/03/02 04:06:37 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 ajm 1.7 public static final String REVISION = "$Revision: 1.6 $";
21 tdb 1.4
22 tdb 1.2 public static final int OK = 0;
23 ajm 1.3 public static final int WARNING = 1;
24 ajm 1.7 public static final int CRITICAL = 2;
25 ajm 1.3
26 ajm 1.6 public static final String[] alerts = {"OK", "WARNING", "CRITICAL"};
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 tdb 1.5 public Alert(int level, String source, String thresholdValue, String value, String attributeName) {
38 tdb 1.1 _level = level;
39 tdb 1.5 _source = source;
40 ajm 1.3 _thresholdValue = thresholdValue;
41     _value = value;
42     _attributeName = attributeName;
43 tdb 1.1 }
44    
45     //---PUBLIC METHODS---
46    
47     /**
48     * Overrides the {@link java.lang.Object#toString() Object.toString()}
49     * method to provide clean logging (every class should have this).
50     *
51     * This uses the uk.ac.ukc.iscream.util.FormatName class
52     * to format the toString()
53     *
54     * @return the name of this class and its CVS revision
55     */
56     public String toString() {
57     return FormatName.getName(
58     _name,
59     getClass().getName(),
60     REVISION);
61     }
62    
63     //---PRIVATE METHODS---
64    
65     //---ACCESSOR/MUTATOR METHODS---
66 tdb 1.2
67     /**
68     * Returns the level of this packet
69     */
70     public int getLevel() {
71     return _level;
72     }
73 ajm 1.3
74 tdb 1.5 public String getSource() {
75     return _source;
76     }
77    
78 ajm 1.3 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 tdb 1.1
90     //---ATTRIBUTES---
91    
92     /**
93     * This is the friendly identifier of the
94     * component this class is running in.
95     * eg, a Filter may be called "filter1",
96     * If this class does not have an owning
97     * component, a name from the configuration
98     * can be placed here. This name could also
99     * be changed to null for utility classes.
100     */
101     private String _name = ClientMain.NAME;
102    
103     /**
104     * The alert level of this packet
105     */
106     private int _level;
107 ajm 1.3
108 tdb 1.5 private String _source;
109 ajm 1.3 private String _value;
110     private String _thresholdValue;
111     private String _attributeName;
112 tdb 1.1
113     //---STATIC ATTRIBUTES---
114    
115     }