org.oddjob.schedules.schedules
Class DayAfterSchedule

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

public class DayAfterSchedule
extends AbstractSchedule
implements Serializable

Description

A schedule that returns the day after when it's parent schedule is due.

This is designed to be used with the BrokenSchedule's alternative property to move processing to the day after the holiday.

An alternative to this schedule may be to use the AfterSchedule.

Example

A schedule for the last day of the month, or the next working day if the last day of the month falls on a non working day.
<schedules:broken xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
    <schedule>
        <schedules:monthly onDay="LAST">
                <refinement>
                    <schedules:time at="17:00"/>
                </refinement>
        </schedules:monthly>
    </schedule>
    <breaks>
        <schedules:list>
            <schedules>
                <schedules:weekly from="SATURDAY" to="SUNDAY"/>
                <value value="${holidays}"/>
            </schedules>
        </schedules:list>        
    </breaks>
    <alternative>
        <schedules:day-after>
            <refinement>
                <schedules:time at="08:00"/>
            </refinement>
        </schedules:day-after>
    </alternative>
</schedules:broken>
Note that the refinement schedules for a different time when the day after is used. This reflects the situation where data is often available earlier after a weekend or holiday.
See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
DayAfterSchedule()
           
 
Method Summary
 ScheduleResult nextDue(ScheduleContext context)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
 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

DayAfterSchedule

public DayAfterSchedule()
Method Detail

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