View Javadoc

1   package org.apache.stratum.scheduler;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation or its licensors,
5    * as applicable.
6    *
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  /***
21   * This bean represents the settings used to create a Trigger object for use in the Quartz scheduler
22   * <pre>
23   *  This trigger is a Quartz trigger that uses a "Cron-Expression" which
24   *  is a string comprised of 6 fields separated by white space. The 6
25   *  fields are as follows:
26   *   Field Name   Allowed Values   Allowed Special Characters
27   *  seconds      0-59             , - * /
28   *  minutes      0-59             , - * /
29   *  hours        0-23             , - * /
30   *  dayOfMonth   0-31             , - * ? / L C
31   *  month        1-12 or JAN-DEC  , - * /
32   *  dayOfWeek    1-7 or SUN-SAT   , - * ? / L C
33   *    -The '*' character is used to specify all values. For example, "*" in
34   *    the minute field means "every minute".
35   *    -The '?' character is allowed for the day-of-month and day-of-week
36   *    fields. It is used to specify 'no specific value'. This is useful when
37   *    you need to specify something in one of the two fileds, but not the
38   *    other. See the examples below for clarification.
39   *    -The '-' character is used to specify ranges For example "10-12" in
40   *    the hour field means "the hours 10, 11 and 12".
41   *    -The ',' character is used to specify additional values. For example
42   *    "MON,WED,FRI" in the day-of-week field means "the days Monday,
43   *    Wednesday, and Friday".
44   *    -The '/' character is used to specify increments. For example "0/15"
45   *    in the seconds field means "the seconds 0, 15, 30, and 45". And "5/15"
46   *    in the seconds field means "the seconds 5, 20, 35, and 50". You can \
47   *    also specify '/' after the '*' character - in this case '*' is
48   *    equivalent to having '0' before the '/'.
49   *    -The 'L' character is allowed for the day-of-month and day-of-week
50   *    fields. This character is short-hand for "last", but it has different
51   *    meaning in each of the two fields. For example, the value "L" in the
52   *    day-of-month field means "the last day of the month" - day 31 for
53   *    January, day 28 for February on non-leap years. If used in the
54   *    day-of-week field by itself, it simply means "7" or "SAT". But if
55   *    used in the day-of-week field after another value, it means "the
56   *    last xxx day of the month" - for example "6L" or "FRIL" both mean
57   *    "the last friday of the month". When using the 'L' option, it is
58   *    important not to specify lists, or ranges of values, as you'll get
59   *    confusing results.
60   *    -The 'C' character is allowed for the day-of-month and day-of-week
61   *    fields. This character is short-hand for "calendar". This means values
62   *    are calculated against the associated calendar, if any. If no calendar
63   *    is associated, then it is equivalent to having an all-inclusive
64   *    calendar. A value of "5C" in the day-of-month field means "the first
65   *    day included by the calendar on or after the 5th". A value of "1C" in
66   *    the day-of-week field means "the first day included by the calendar on
67   *    or after sunday".
68   * </pre>
69   *
70   * @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
71   * @version $Id: TriggerConfig.java 264191 2005-08-29 18:07:52Z henning $
72   */
73  public class TriggerConfig
74  {
75      /*** The name of the trigger */
76      private String name;
77  
78      /*** The name of the job to associate with this this trigger. */
79      private String jobName;
80  
81      /*** The name of the group to associate this trigger with */
82      private String group;
83  
84      /***  */
85  
86      /*** TODO: DOCUMENT ME! */
87      private String seconds = "*";
88  
89      /***  */
90  
91      /*** TODO: DOCUMENT ME! */
92      private String minutes = "*";
93  
94      /***  */
95  
96      /*** TODO: DOCUMENT ME! */
97      private String hours = "*";
98  
99      /***  */
100 
101     /*** TODO: DOCUMENT ME! */
102     private String dayOfMonth = "*";
103 
104     /***  */
105 
106     /*** TODO: DOCUMENT ME! */
107     private String month = "*";
108 
109     /***  */
110 
111     /*** TODO: DOCUMENT ME! */
112     private String dayOfWeek = "*";
113 
114     /***
115      * Default contructor
116      */
117     public TriggerConfig()
118     {
119     }
120 
121     /***
122      * This is the name of the trigger
123      *
124      * @param s trigger name
125      */
126     public void setName(String s)
127     {
128         this.name = s;
129     }
130 
131     /***
132      * DOCUMENT ME!
133      *
134      * @return the name of the trigger
135      */
136     public String getName()
137     {
138         return this.name;
139     }
140 
141     /***
142      * This is the name of group that the trigger is associated with
143      *
144      * @param s group name
145      */
146     public void setGroup(String s)
147     {
148         this.group = s;
149     }
150 
151     /***
152      * DOCUMENT ME!
153      *
154      * @return the group name
155      */
156     public String getGroup()
157     {
158         return this.group;
159     }
160 
161     /***
162      * This is the name of job that the trigger is associated with
163      *
164      * @param s job name
165      */
166     public void setJobName(String s)
167     {
168         this.jobName = s;
169     }
170 
171     /***
172      * DOCUMENT ME!
173      *
174      * @return the job name
175      */
176     public String getJobName()
177     {
178         return this.jobName;
179     }
180 
181     /***
182      * <pre>
183      *  Field Name   Allowed Values   Allowed Special Characters
184      *  seconds      0-59             , - * /
185      * </pre>
186      *
187      * @param s seconds
188      */
189     public void setSeconds(String s)
190     {
191         this.seconds = s;
192     }
193 
194     /***
195      * DOCUMENT ME!
196      *
197      * @return seconds
198      */
199     public String getSeconds()
200     {
201         return this.seconds;
202     }
203 
204     /***
205      * <pre>
206      *  Field Name   Allowed Values   Allowed Special Characters
207      *  minutes      0-59             , - * /
208      * </pre>
209      *
210      * @param s minutes
211      */
212     public void setMinutes(String s)
213     {
214         this.minutes = s;
215     }
216 
217     /***
218      * DOCUMENT ME!
219      *
220      * @return mintutes
221      */
222     public String getMinutes()
223     {
224         return this.minutes;
225     }
226 
227     /***
228      * <pre>
229      *  Field Name   Allowed Values   Allowed Special Characters
230      *  hours        0-23             , - * /
231      * </pre>
232      *
233      * @param s hours
234      */
235     public void setHours(String s)
236     {
237         this.hours = s;
238     }
239 
240     /***
241      * DOCUMENT ME!
242      *
243      * @return hours
244      */
245     public String getHours()
246     {
247         return this.hours;
248     }
249 
250     /***
251      * <pre>
252      *  Field Name   Allowed Values   Allowed Special Characters
253      *  dayOfMonth   0-31             , - * ? / L C
254      * </pre>
255      *
256      * @param s day of month
257      */
258     public void setDayOfMonth(String s)
259     {
260         this.dayOfMonth = s;
261     }
262 
263     /***
264      * DOCUMENT ME!
265      *
266      * @return day of month
267      */
268     public String getDayOfMonth()
269     {
270         return this.dayOfMonth;
271     }
272 
273     /***
274      * <pre>
275      *  Field Name   Allowed Values   Allowed Special Characters
276      *  month        1-12 or JAN-DEC  , - * /
277      * </pre>
278      *
279      * @param s month
280      */
281     public void setMonth(String s)
282     {
283         this.month = s;
284     }
285 
286     /***
287      * DOCUMENT ME!
288      *
289      * @return month
290      */
291     public String getMonth()
292     {
293         return this.month;
294     }
295 
296     /***
297      * <pre>
298      *  Field Name   Allowed Values   Allowed Special Characters
299      *  dayOfWeek    1-7 or SUN-SAT   , - * ? / L C
300      * </pre>
301      *
302      * @param s day of the week
303      */
304     public void setDayOfWeek(String s)
305     {
306         this.dayOfWeek = s;
307     }
308 
309     /***
310      * DOCUMENT ME!
311      *
312      * @return day of the week
313      */
314     public String getDayOfWeek()
315     {
316         return this.dayOfWeek;
317     }
318 }