public final class DailySchedule extends ConstrainedSchedule implements java.io.Serializable
If the 'to' time is less than the 'from' time it is assumed that the 'to' time is the next day.
Timer
this would run a job
every day at 10am.
<schedules:daily at="10:00" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>
<schedules:daily from="22:00" to="03:50" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:interval interval="00:15"/> </refinement> </schedules:daily>
Constructor and Description |
---|
DailySchedule() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Calendar |
fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the start of the constraint.
|
java.lang.String |
getFrom() |
java.lang.String |
getTo() |
protected CalendarUnit |
intervalBetween()
Sub classes must provide a unit which is what must be
added to move the schedule on.
|
void |
setAt(java.lang.String at) |
void |
setFrom(java.lang.String from) |
void |
setTo(java.lang.String to) |
protected java.util.Calendar |
toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the end of the constraint.
|
java.lang.String |
toString()
Override toString.
|
lastInterval, nextDue, nextInterval, shiftFromCalendar, shiftToCalendar
getRefinement, setRefinement
public void setFrom(java.lang.String from)
Property: from
Description: The from time.
Required: No. Default to the start of the day.
from
- The from date.public java.lang.String getFrom()
public void setTo(java.lang.String to)
Property: to
Description: The to time.
Required: No. Default to the end of the day.
to
- The to date.public java.lang.String getTo()
public void setAt(java.lang.String at)
Property: at
Description: The time at which this schedule is for. This has the same effect as setting from and to to the same thing.
Required: No.
at
- The at time.protected CalendarUnit intervalBetween()
ConstrainedSchedule
intervalBetween
in class ConstrainedSchedule
protected java.util.Calendar fromCalendar(java.util.Date referenceDate, java.util.TimeZone timeZone)
ConstrainedSchedule
fromCalendar
in class ConstrainedSchedule
referenceDate
- The date/time now.timeZone
- The time zone.protected java.util.Calendar toCalendar(java.util.Date referenceDate, java.util.TimeZone timeZone)
ConstrainedSchedule
toCalendar
in class ConstrainedSchedule
referenceDate
- The date/time now.timeZone
- The time zone.public java.lang.String toString()
toString
in class ConstrainedSchedule