Interface PeriodFunctionCalculator
-
public interface PeriodFunctionCalculator
Interface to a computable temporal interval. When writing a custom period function, please note the following: The dispatcher processes all jobs using the same instance of the period function. This means that the same period function will be called with different parameters. Therefore, you have to be very careful when storing values inside the period function. Parameter values can be cached to increase performance, but you must test every time that the parameter values have not changed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
description(Properties parameters)
Human-readable (and understandable) description of this functionboolean
isOpen(DateTimeZone atTime, TimeZone timeZone, Properties parameters)
see TimeWindowIntervalMethod#isOpen(DateTimeZone)DateTimeZone
nextPotentialStatusChange(DateTimeZone startTime, DateTimeZone endTime, TimeZone timeZone, Properties parameters)
see TimeWindowIntervalMethod#nextPotentialStatusChange(DateTimeZone,DateTimeZone)void
validate(Properties parameters)
Throws runtime exception if the parameters are not valid for this period function
-
-
-
Method Detail
-
nextPotentialStatusChange
DateTimeZone nextPotentialStatusChange(DateTimeZone startTime, DateTimeZone endTime, TimeZone timeZone, Properties parameters) throws com.redwood.scheduler.api.exception.SchedulerAPIException
see TimeWindowIntervalMethod#nextPotentialStatusChange(DateTimeZone,DateTimeZone)- Parameters:
parameters
- parameters specific for this period functionstartTime
- time to look fromendTime
- timestamp to look up totimeZone
- time zone to work in- Returns:
- a timestamp of the next potential status change AFTER the startTime
- Throws:
com.redwood.scheduler.api.exception.SchedulerAPIException
-
isOpen
boolean isOpen(DateTimeZone atTime, TimeZone timeZone, Properties parameters) throws com.redwood.scheduler.api.exception.SchedulerAPIException
see TimeWindowIntervalMethod#isOpen(DateTimeZone)- Parameters:
timeZone
- time zone of the TimeWindowIntervalatTime
- timestamp to checkparameters
- parameters specific for this period function- Returns:
- true if it is open at atTime
- Throws:
com.redwood.scheduler.api.exception.SchedulerAPIException
-
validate
void validate(Properties parameters)
Throws runtime exception if the parameters are not valid for this period function- Parameters:
parameters
- parameters specific for this period function
-
description
String description(Properties parameters)
Human-readable (and understandable) description of this function- Parameters:
parameters
- parameters specific for this period function- Returns:
- human-readable (and understandable) description of this function
-
-