001: /*
002: * Timer: The timer class
003: * Copyright (C) 2006-2007 Rift IT Contracting
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
018: *
019: * TimerEvent.java
020: */
021:
022: package com.rift.coad.daemon.timer;
023:
024: //java import
025: import java.io.Serializable;
026:
027: /**
028: * This object stores the values of an event from the database.
029: *
030: * @author Glynn Chaldecott
031: */
032: public class TimerEvent implements Serializable {
033:
034: // private member variables
035: private int id = 0;
036: private String jndi = null;
037: private Serializable event = null;
038: private int month = -1;
039: private int day = -1;
040: private int hour = -1;
041: private int minute = -1;
042: private boolean recure = false;
043:
044: /**
045: * Creates a new instance of TimerEvent
046: */
047: public TimerEvent() {
048: }
049:
050: /**
051: * The contructor responsible for setting the private member variables.
052: *
053: * @param id The id of the timer.
054: * @param jndi The jndi url for the event.
055: * @param event The serializable event identifier.
056: * @param month The month the event occurs in.
057: * @param day The day of the month that the event occurs on.
058: * @param hour The hour the event occurs on.
059: * @param minute The minute the event occurs on.
060: * @param recure If true the event will recure and is not just a once off.
061: */
062: public TimerEvent(int id, String jndi, Serializable event,
063: int month, int day, int hour, int minute, boolean recure) {
064: this .id = id;
065: this .jndi = jndi;
066: this .event = event;
067: this .month = month;
068: this .day = day;
069: this .hour = hour;
070: this .minute = minute;
071: this .recure = recure;
072: }
073:
074: /**
075: * The getter method for the id.
076: *
077: * @return Returns the id of this event.
078: */
079: public int getId() {
080: return id;
081: }
082:
083: /**
084: * The setter method for the event id.
085: *
086: * @param id The id of the
087: */
088: public void setId(int id) {
089: this .id = id;
090: }
091:
092: /**
093: * The getter method for the JNDI url.
094: *
095: * @return The string containing the JNDI url.
096: */
097: public String getJndi() {
098: return jndi;
099: }
100:
101: /**
102: * The setter method for the JNDI url.
103: *
104: * @param jndi The jndi url.
105: */
106: public void setJndi(String jndi) {
107: this .jndi = jndi;
108: }
109:
110: /**
111: * The getter method for the event.
112: *
113: * @return The object that indicates the event that this object was created
114: * for.
115: */
116: public Serializable getEvent() {
117: return event;
118: }
119:
120: /**
121: * Set the event.
122: *
123: * @param event The object used to identify this event.
124: */
125: public void setEvent(Serializable event) {
126: this .event = event;
127: }
128:
129: /**
130: * The get method for month.
131: *
132: * @return Returns the value for month.
133: */
134: public int getMonth() {
135: return month;
136: }
137:
138: /**
139: * The set method for month.
140: *
141: * @param month The new value for month.
142: */
143: public void setMonth(int month) {
144: this .month = month;
145: }
146:
147: /**
148: * The get method for day.
149: *
150: * @return Returns the value for day.
151: */
152: public int getDay() {
153: return day;
154: }
155:
156: /**
157: * The set method for day.
158: *
159: * @param day The new value for day.
160: */
161: public void setDay(int day) {
162: this .day = day;
163: }
164:
165: /**
166: * The get method for hour.
167: *
168: * @return Returns the value for hour.
169: */
170: public int getHour() {
171: return hour;
172: }
173:
174: /**
175: * The set method for hour.
176: *
177: * @param hour The new value for hour.
178: */
179: public void setHour(int hour) {
180: this .hour = hour;
181: }
182:
183: /**
184: * The get method for minute.
185: *
186: * @return Returns the value for minute.
187: */
188: public int getMinute() {
189: return minute;
190: }
191:
192: /**
193: * The set method for minute.
194: *
195: * @param minute The new value for minute.
196: */
197: public void setMinute(int minute) {
198: this .minute = minute;
199: }
200:
201: /**
202: * This getter for the recure flag.
203: *
204: * @return The recure flag.
205: */
206: public boolean getRecure() {
207: return recure;
208: }
209:
210: /**
211: * The setter for the recure method.
212: *
213: * @param recure The new recure flag value.
214: */
215: public void setRecure(boolean recure) {
216: this.recure = recure;
217: }
218: }
|