KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > monitor > alarm > Alarm


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.monitor.alarm;
23
24 /**
25  * Alarm Constants.
26  *
27  * An alarm can be of two types:
28  *
29  * Stateless, when the producing MBean keeps no state about the occurence
30  * of the alarm. The produced alarm notification must have alarmState STATE_NONE
31  * and the valid severities are SEVERITY_NORMAL -> SEVERITY_UNKNOWN
32  *
33  * Stateful, when the producing MBean keeps state about the occurence
34  * of the alarm. The first notification must carry alarmState STATE_CREATED,
35  * with valid severities SEVERITY_WARNING -> SEVERITY_UNKNOWN. Any change
36  * in the alarm (severity) must generate an alarm notification with alarmState
37  * STATE_CHANGED and valid severities SEVERITY_WARNING -> SEVERITY_UNKNOWN.
38  * The clearance of the alarm must be indicates with an alarm notification
39  * with alarmState STATE_CLEARED and a severity of SEVERITY_NORMAL.
40  *
41  * This complexity is required in order to be able to easily correlate
42  * alarms and associaty the generation and clearence of system faults.
43  *
44  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
45  * @version $Revision: 37459 $
46  */

47 public interface Alarm
48 {
49    // Constants -----------------------------------------------------
50

51    /** default server id */
52    public static final String JavaDoc DEFAULT_SERVER_ID = "jboss";
53    
54    /** the possible states of an alarm */
55    public static final int STATE_CLEARED = 0;
56    public static final int STATE_CHANGED = 1;
57    public static final int STATE_CREATED = 2;
58    public static final int STATE_NONE = 3;
59    
60    /** stringfied alarm states */
61    public static final String JavaDoc[] STATE_STRINGS = {
62       "CLEARED", "CHANGED", "CREATED", "NONE"
63    };
64    
65    /** the possible severities of an alarm */
66    public static final int SEVERITY_NORMAL = 0;
67    public static final int SEVERITY_WARNING = 1;
68    public static final int SEVERITY_MINOR = 2;
69    public static final int SEVERITY_MAJOR = 3;
70    public static final int SEVERITY_CRITICAL = 4;
71    public static final int SEVERITY_UNKNOWN = 5;
72
73    /** stringfied severities */
74    public static final String JavaDoc[] SEVERITY_STRINGS = {
75       "NORMAL", "WARNING", "MINOR", "MAJOR", "CRITICAL", "UNKNOWN"
76    };
77 }
78
Popular Tags