This class implements the BPS schedule object. More...
Public Member Functions | |
void | clearExceptionDays () |
Clear the list of exception days. | |
Boolean | dayOfMonth (Number aDayOfMonth) const |
Date | firstDateTime (Date aDate) const |
Find the first date/time for a given date. More... | |
Boolean | hour (Number aHour) const |
Boolean | isDateIncluded (Date aDate) const |
Check if a date is included in the schedule. More... | |
Boolean | isDateTimeIncluded (Date aDateTime) const |
Check if a date/time is included in the schedule. More... | |
Date | lastDateTime (Date aDate) const |
Find the last date/time for a given date. More... | |
void | loadExceptionDays (Datastore aDatastore, Number aPartnerKey) |
Load exception days from datastore. More... | |
Boolean | minute (Number aMinute) const |
Boolean | month (Mixed aMonth) const |
Date | nextDate (Date aStart) const |
Find the next schedule date after the given start date. More... | |
Date | nextDateTime (Date aStart) const |
Find the next schedule date/time after the given start date/time. More... | |
Date | previousDate (Date aStart) const |
Find the previous schedule date before the given start date. More... | |
Date | previousDateTime (Date aStart) const |
Find the previous schedule date/time before the given start date/time. More... | |
Schedule (String aCronText) | |
void | setDayOfMonth (Number aDayOfMonth, Boolean aEnable) |
Change the enable state of a day of month. More... | |
void | setHour (Number aHour, Boolean aEnable) |
Change the enable state of a hour. More... | |
void | setMinute (Number aMinute, Boolean aEnable) |
Change the enable state of a minute. More... | |
void | setMonth (Mixed aMonth, Boolean aEnable) |
Change the enable state of a month. More... | |
void | setWeekday (Mixed aWeekday, Boolean aEnable) |
Change the enable state of a weekday. More... | |
String | toString () const |
Boolean | weekday (Mixed aWeekday) const |
Properties | |
String | cronText |
The schedule string. More... | |
This class implements the BPS schedule object.
Example usage:
bps::Schedule::Schedule | ( | String | aCronText | ) |
aCronText | The CRON text representation. |
Boolean bps::Schedule::dayOfMonth | ( | Number | aDayOfMonth | ) | const |
[in] | aDayOfMonth | Must be in the range 1 ... 31 |
Date bps::Schedule::firstDateTime | ( | Date | aDate | ) | const |
Find the first date/time for a given date.
[in] | aDate | The date. |
Boolean bps::Schedule::hour | ( | Number | aHour | ) | const |
[in] | aHour | Must be in the range 0 ... 23 |
Boolean bps::Schedule::isDateIncluded | ( | Date | aDate | ) | const |
Check if a date is included in the schedule.
[in] | aDate | The date to check. |
Boolean bps::Schedule::isDateTimeIncluded | ( | Date | aDateTime | ) | const |
Check if a date/time is included in the schedule.
[in] | aDateTime | The date/time to check. |
Date bps::Schedule::lastDateTime | ( | Date | aDate | ) | const |
Find the last date/time for a given date.
[in] | aDate | The date. |
void bps::Schedule::loadExceptionDays | ( | Datastore | aDatastore, |
Number | aPartnerKey | ||
) |
Load exception days from datastore.
Exception days can be defined to override the schedule of distinct dates.
Exception days are stored as global list and for each partner. If aPartnerKey is given, first all exception days of the given partner are loaded. Then those exception days of the parent partner are added which are not yet in the list, and so on until the parent is NULL. Finally those global exception days are added which are not yet in the list.
If the aPartnerKey is NULL, only the global exception days are loaded.
[in] | aDatastore | The datastore object to use. |
[in] | aPartnerKey | Key of the partner, or omit to only load global exception days. |
On | database errors. |
Boolean bps::Schedule::minute | ( | Number | aMinute | ) | const |
[in] | aMinute | Must be in the range 0 ... 59 |
Boolean bps::Schedule::month | ( | Mixed | aMonth | ) | const |
[in] | aMonth | Must either be a string of: jan feb mar apr may jun jul aug sep oct nov dec, or a number in the range 1 ... 12 |
Date bps::Schedule::nextDate | ( | Date | aStart | ) | const |
Find the next schedule date after the given start date.
[in] | aStart | The date to start searching from. |
Date bps::Schedule::nextDateTime | ( | Date | aStart | ) | const |
Find the next schedule date/time after the given start date/time.
[in] | aStart | The date/time to start searching from. |
Date bps::Schedule::previousDate | ( | Date | aStart | ) | const |
Find the previous schedule date before the given start date.
[in] | aStart | The date to start searching from. |
Date bps::Schedule::previousDateTime | ( | Date | aStart | ) | const |
Find the previous schedule date/time before the given start date/time.
[in] | aStart | The date/time to start searching from. |
void bps::Schedule::setDayOfMonth | ( | Number | aDayOfMonth, |
Boolean | aEnable | ||
) |
Change the enable state of a day of month.
[in] | aDayOfMonth | Must be in the range 1 ... 31 |
[in] | aEnable | The new enable state to set. |
void bps::Schedule::setHour | ( | Number | aHour, |
Boolean | aEnable | ||
) |
Change the enable state of a hour.
[in] | aHour | Must be in the range 0 ... 23 |
[in] | aEnable | The new enable state to set. |
void bps::Schedule::setMinute | ( | Number | aMinute, |
Boolean | aEnable | ||
) |
Change the enable state of a minute.
[in] | aMinute | Must be in the range 0 ... 59 |
[in] | aEnable | The new enable state to set. |
void bps::Schedule::setMonth | ( | Mixed | aMonth, |
Boolean | aEnable | ||
) |
Change the enable state of a month.
[in] | aMonth | Must either be a string of: jan feb mar apr may jun jul aug sep oct nov dec, or a number in the range 1 ... 12 |
[in] | aEnable | The new enable state to set. |
void bps::Schedule::setWeekday | ( | Mixed | aWeekday, |
Boolean | aEnable | ||
) |
Change the enable state of a weekday.
[in] | aWeekday | Must either me a string of: sun mon tue wed thu fri sat, or a number in the range 0 ... 7, where 0/7 = sun, 1 = mon, 2 = tue, etc. |
[in] | aEnable | The new enable state to set. |
String bps::Schedule::toString | ( | ) | const |
Boolean bps::Schedule::weekday | ( | Mixed | aWeekday | ) | const |
[in] | aWeekday | Must either me a string of: sun mon tue wed thu fri sat, or a number in the range 0 ... 7, where 0/7 = sun, 1 = mon, 2 = tue, etc. |
|
readwrite |
The schedule string.