org.oddjob.schedules.schedules
Class DateSchedule

java.lang.Object
  extended by org.oddjob.schedules.AbstractSchedule
      extended by org.oddjob.schedules.schedules.DateSchedule
All Implemented Interfaces:
Serializable, RefineableSchedule, Schedule

public final class DateSchedule
extends AbstractSchedule
implements Serializable

Description

Provide a schedule for a specific date or define an interval between two dates.

The dates must be of the form yyyy-MM-dd where the format is as specified by the Java Date Format.

Example

A schedule for Christmas.
<schedules:date on="2004-12-25" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>
See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
DateSchedule()
           
 
Method Summary
 String getFrom()
          Get the from Date as a String.
 String getTo()
          Return the to date as a string.
 ScheduleResult nextDue(ScheduleContext context)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
 void setFrom(String startDateString)
           
 void setOn(String on)
           
 void setTo(String endDateString)
           
 String toString()
          Override toString.
 
Methods inherited from class org.oddjob.schedules.AbstractSchedule
getRefinement, setRefinement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateSchedule

public DateSchedule()
Method Detail

setFrom

public void setFrom(String startDateString)

Property: from

Description: The from date for the schedule. Defaults to along time ago.

Required: No.

Parameters:
startDateString - The from date. May be null.
Throws:
ParseException - If the String isn't a Date.

getFrom

public String getFrom()
Get the from Date as a String.

Returns:
The from date. May be null.

setTo

public void setTo(String endDateString)

Property: to

Description: The to date for the schedule. This date is inclusive, the defined interval is up to and including the last millisecond of this date. This defaults to a long time away.

Required: No.

Parameters:
endDateString - The end date. May be null.
Throws:
ParseException - If the string isn't a valid date.

getTo

public String getTo()
Return the to date as a string.

Returns:
The to date, may be null.

setOn

public void setOn(String on)

Property: on

Description: A specific date on which to schedule something.

Required: No.

Parameters:
in - The on text.
Throws:
ParseException - If the string isn't a date.

nextDue

public ScheduleResult nextDue(ScheduleContext context)
Description copied from interface: Schedule
For a given date a schedule will provide the interval this schedule should next be scheduled in.

If the schedule is never due again for the given date, null is returned.

Specified by:
nextDue in interface Schedule
Returns:
The next due interval for the schedule.

toString

public String toString()
Override toString.

Overrides:
toString in class Object