KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > essiembre > library > scheduler > SchedulerTaskInfo


1 /*
2  * Copyright (C) 2003, 2004 Pascal Essiembre, Essiembre Consultant Inc.
3  *
4  * This file is part of Essiembre Scheduler.
5  *
6  * Essiembre Scheduler 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 (at your option) any later version.
10  *
11  * Essiembre Scheduler 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 Essiembre Scheduler; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19  * Boston, MA 02111-1307 USA
20  */

21 package com.essiembre.library.scheduler;
22
23 import java.util.Vector JavaDoc;
24
25 /**
26  * Contains information related to a single task to be executed by the
27  * <code>SchedulerServlet</code>.
28  *
29  * @author Pascal Essiembre
30  * @version $Id: SchedulerTaskInfo.java,v 1.3 2004/06/07 03:46:40 essiembre Exp $
31  */

32 public class SchedulerTaskInfo {
33
34     /** Qualified name of TimerTask class to be executed */
35     private String JavaDoc task = null;
36
37     /** When should the task be executed */
38     private String JavaDoc time = null;
39
40     /** Time in milliseconds between successive task executions */
41     private String JavaDoc period = null;
42
43     /** Delay in milliseconds before task is to be executed */
44     private String JavaDoc delay = null;
45
46     /** Scheduler parameters */
47     private Vector JavaDoc parameters = new Vector JavaDoc();
48     
49     /**
50      * Gets the delay
51      *
52      * @return Returns a String representation of a delay
53      */

54     public String JavaDoc getDelay() {
55
56         return delay;
57     }
58
59     /**
60      * Sets the delay
61      *
62      * @param delay The delay to set
63      */

64     public void setDelay(String JavaDoc delay) {
65         this.delay = delay;
66     }
67
68     /**
69      * Gets the period
70      *
71      * @return Returns a String representation of a period
72      */

73     public String JavaDoc getPeriod() {
74
75         return period;
76     }
77
78     /**
79      * Sets the period
80      *
81      * @param period The period to set
82      */

83     public void setPeriod(String JavaDoc period) {
84         this.period = period;
85     }
86
87     /**
88      * Gets the task
89      *
90      * @return Returns a String
91      */

92     public String JavaDoc getTask() {
93
94         return task;
95     }
96
97     /**
98      * Sets the task
99      *
100      * @param task The task to set
101      */

102     public void setTask(String JavaDoc task) {
103         this.task = task;
104     }
105
106     /**
107      * Gets the time
108      *
109      * @return Returns a String representation of a date
110      */

111     public String JavaDoc getTime() {
112
113         return time;
114     }
115
116     /**
117      * Sets the time. The provided String will be converted to a
118      * <code>Date</code> when used to create a new <code>Timer</code>.
119      * It must conform to this format: yyyy-MM-dd HH:mm:ss (see
120      * <code>java.text.SimpleDateFormat</code>).
121      *
122      * @param time The time to set
123      */

124     public void setTime(String JavaDoc time) {
125
126         this.time = time;
127     }
128     /**
129      * Gets the parameters.
130      * @return Returns the parameters.
131      * @since 1.1
132      */

133     public Vector JavaDoc getParameters() {
134         return parameters;
135     }
136     /**
137      * Sets the parameters.
138      * @param parameters The parameters to set.
139      * @since 1.1
140      */

141     public void setParameters(Vector JavaDoc parameters) {
142         this.parameters = parameters;
143     }
144 }
Popular Tags