001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999-2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: JOnAS Team
022: * --------------------------------------------------------------------------
023: * $Id: AlarmData.java 7789 2005-12-13 21:11:55Z moghrabi $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.alarm.beans;
026:
027: import java.io.Serializable;
028:
029: /**
030: *
031: * @author Florent Benoit
032: */
033: /**
034: * Data associated with an AlarmRecord. This is what will be passed to servlets
035: * to be displayed.
036: */
037: public class AlarmData implements Serializable {
038:
039: /**
040: * AlarmRecord number (=pk)
041: */
042: private int num;
043:
044: /**
045: * Severity Level
046: */
047: private int sev;
048:
049: /**
050: * Device that generated Alarm
051: */
052: private String device;
053:
054: /**
055: * Alarm Message
056: */
057: private String message;
058:
059: /**
060: * Count of received messages
061: */
062: private int count;
063:
064: /**
065: * State (1=received, 2=processed, 3=deleted)
066: */
067: private int state;
068:
069: /**
070: * Date of first message
071: */
072: private java.sql.Date date;
073:
074: /**
075: * @param n AlarmRecord number
076: * @param s Severity Level
077: * @param dev Device that generated Alarm
078: * @param m Alarm Message
079: * @param d Date of first message
080: */
081: public AlarmData(int n, int s, String dev, String m, java.sql.Date d) {
082: num = n;
083: sev = s;
084: device = dev;
085: message = m;
086: count = 1;
087: state = 1;
088: date = d;
089: }
090:
091: /**
092: * @return the alarm record number
093: */
094: public int getNum() {
095: return num;
096: }
097:
098: /**
099: * @return Severity Level
100: */
101: public int getSev() {
102: return sev;
103: }
104:
105: /**
106: * @return the device
107: */
108: public String getDevice() {
109: return device;
110: }
111:
112: /**
113: * @return the alarm message
114: */
115: public String getMessage() {
116: return message;
117: }
118:
119: /**
120: * @return nb of messages received
121: */
122: public int getCount() {
123: return count;
124: }
125:
126: /**
127: * Set the nb of messages received
128: * @param c Count of received messages
129: */
130: public void setCount(int c) {
131: count = c;
132: }
133:
134: /**
135: * @return the state
136: */
137: public int getState() {
138: return state;
139: }
140:
141: /**
142: * Set the current state
143: * @param s State (1=received, 2=processed, 3=deleted)
144: */
145: public void setState(int s) {
146: state = s;
147: }
148:
149: /**
150: * @return Date of first message
151: */
152: public java.util.Date getDate() {
153: return date;
154: }
155: }
|