KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > alarm > beans > AlarmData


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: JOnAS Team
22  * --------------------------------------------------------------------------
23  * $Id: AlarmData.java,v 1.2 2004/04/09 12:56:41 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.alarm.beans;
28
29 import java.io.Serializable JavaDoc;
30
31 /**
32  *
33  * @author Florent Benoit
34  */

35 /**
36  * Data associated with an AlarmRecord. This is what will be passed to servlets
37  * to be displayed.
38  */

39 public class AlarmData implements Serializable JavaDoc {
40
41     /**
42      * AlarmRecord number (=pk)
43      */

44     private int num;
45
46     /**
47      * Severity Level
48      */

49     private int sev;
50
51     /**
52      * Device that generated Alarm
53      */

54     private String JavaDoc device;
55
56     /**
57      * Alarm Message
58      */

59     private String JavaDoc message;
60
61     /**
62      * Count of received messages
63      */

64     private int count;
65
66     /**
67      * State (1=received, 2=processed, 3=deleted)
68      */

69     private int state;
70
71     /**
72      * Date of first message
73      */

74     private java.sql.Date JavaDoc date;
75
76     /**
77      * @param n AlarmRecord number
78      * @param s Severity Level
79      * @param dev Device that generated Alarm
80      * @param m Alarm Message
81      * @param d Date of first message
82      */

83     public AlarmData(int n, int s, String JavaDoc dev, String JavaDoc m, java.sql.Date JavaDoc d) {
84         num = n;
85         sev = s;
86         device = dev;
87         message = m;
88         count = 1;
89         state = 1;
90         date = d;
91     }
92
93     /**
94      * @return the alarm record number
95      */

96     public int getNum() {
97         return num;
98     }
99
100     /**
101      * @return Severity Level
102      */

103     public int getSev() {
104         return sev;
105     }
106
107     /**
108      * @return the device
109      */

110     public String JavaDoc getDevice() {
111         return device;
112     }
113
114     /**
115      * @return the alarm message
116      */

117     public String JavaDoc getMessage() {
118         return message;
119     }
120
121     /**
122      * @return nb of messages received
123      */

124     public int getCount() {
125         return count;
126     }
127
128     /**
129      * Set the nb of messages received
130      * @param c Count of received messages
131      */

132     public void setCount(int c) {
133         count = c;
134     }
135
136     /**
137      * @return the state
138      */

139     public int getState() {
140         return state;
141     }
142
143     /**
144      * Set the current state
145      * @param s State (1=received, 2=processed, 3=deleted)
146      */

147     public void setState(int s) {
148         state = s;
149     }
150
151     /**
152      * @return Date of first message
153      */

154     public java.util.Date JavaDoc getDate() {
155         return date;
156     }
157 }
Popular Tags