KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > timer > TimerEvent


1 /*
2  * Timer: The timer class
3  * Copyright (C) 2006-2007 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * TimerEvent.java
20  */

21
22 package com.rift.coad.daemon.timer;
23
24 //java import
25
import java.io.Serializable JavaDoc;
26
27 /**
28  * This object stores the values of an event from the database.
29  *
30  * @author Glynn Chaldecott
31  */

32 public class TimerEvent implements Serializable JavaDoc {
33     
34     // private member variables
35
private int id = 0;
36     private String JavaDoc jndi = null;
37     private Serializable JavaDoc event = null;
38     private int month = -1;
39     private int day = -1;
40     private int hour = -1;
41     private int minute = -1;
42     private boolean recure = false;
43     
44     
45     /**
46      * Creates a new instance of TimerEvent
47      */

48     public TimerEvent() {
49     }
50     
51     
52     /**
53      * The contructor responsible for setting the private member variables.
54      *
55      * @param id The id of the timer.
56      * @param jndi The jndi url for the event.
57      * @param event The serializable event identifier.
58      * @param month The month the event occurs in.
59      * @param day The day of the month that the event occurs on.
60      * @param hour The hour the event occurs on.
61      * @param minute The minute the event occurs on.
62      * @param recure If true the event will recure and is not just a once off.
63      */

64     public TimerEvent(int id, String JavaDoc jndi, Serializable JavaDoc event, int month,
65             int day, int hour, int minute, boolean recure) {
66         this.id = id;
67         this.jndi = jndi;
68         this.event = event;
69         this.month = month;
70         this.day = day;
71         this.hour = hour;
72         this.minute = minute;
73         this.recure = recure;
74     }
75     
76     
77     /**
78      * The getter method for the id.
79      *
80      * @return Returns the id of this event.
81      */

82     public int getId() {
83         return id;
84     }
85     
86     
87     /**
88      * The setter method for the event id.
89      *
90      * @param id The id of the
91      */

92     public void setId(int id) {
93         this.id = id;
94     }
95     
96     
97     /**
98      * The getter method for the JNDI url.
99      *
100      * @return The string containing the JNDI url.
101      */

102     public String JavaDoc getJndi() {
103         return jndi;
104     }
105     
106     
107     /**
108      * The setter method for the JNDI url.
109      *
110      * @param jndi The jndi url.
111      */

112     public void setJndi(String JavaDoc jndi) {
113         this.jndi = jndi;
114     }
115     
116     
117     /**
118      * The getter method for the event.
119      *
120      * @return The object that indicates the event that this object was created
121      * for.
122      */

123     public Serializable JavaDoc getEvent() {
124         return event;
125     }
126     
127     
128     /**
129      * Set the event.
130      *
131      * @param event The object used to identify this event.
132      */

133     public void setEvent(Serializable JavaDoc event) {
134         this.event = event;
135     }
136     
137     
138     /**
139      * The get method for month.
140      *
141      * @return Returns the value for month.
142      */

143     public int getMonth() {
144         return month;
145     }
146     
147     /**
148      * The set method for month.
149      *
150      * @param month The new value for month.
151      */

152     public void setMonth(int month) {
153         this.month = month;
154     }
155     
156     /**
157      * The get method for day.
158      *
159      * @return Returns the value for day.
160      */

161     public int getDay() {
162         return day;
163     }
164     
165     /**
166      * The set method for day.
167      *
168      * @param day The new value for day.
169      */

170     public void setDay(int day) {
171         this.day = day;
172     }
173     
174     /**
175      * The get method for hour.
176      *
177      * @return Returns the value for hour.
178      */

179     public int getHour() {
180         return hour;
181     }
182     
183     /**
184      * The set method for hour.
185      *
186      * @param hour The new value for hour.
187      */

188     public void setHour(int hour) {
189         this.hour = hour;
190     }
191     
192     /**
193      * The get method for minute.
194      *
195      * @return Returns the value for minute.
196      */

197     public int getMinute() {
198         return minute;
199     }
200     
201     /**
202      * The set method for minute.
203      *
204      * @param minute The new value for minute.
205      */

206     public void setMinute(int minute) {
207         this.minute = minute;
208     }
209     
210     
211     /**
212      * This getter for the recure flag.
213      *
214      * @return The recure flag.
215      */

216     public boolean getRecure() {
217         return recure;
218     }
219     
220     
221     /**
222      * The setter for the recure method.
223      *
224      * @param recure The new recure flag value.
225      */

226     public void setRecure(boolean recure) {
227         this.recure = recure;
228     }
229 }
230
Popular Tags