Package org.apache.sling.event.jobs
Interface JobBuilder.ScheduleBuilder
-
- Enclosing interface:
- JobBuilder
public static interface JobBuilder.ScheduleBuilder
This is a builder interface for creating schedule information
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScheduledJobInfo
add()
Finally add the job to the scheduleScheduledJobInfo
add(java.util.List<java.lang.String> errors)
Finally add the job to the scheduleJobBuilder.ScheduleBuilder
at(java.util.Date date)
Schedule the job for a specific date.JobBuilder.ScheduleBuilder
cron(java.lang.String expression)
Schedule the job for according to the cron expression.JobBuilder.ScheduleBuilder
daily(int hour, int minute)
Schedule the job daily at the given time.JobBuilder.ScheduleBuilder
hourly(int minute)
Schedule the job hourly at the given minute.JobBuilder.ScheduleBuilder
monthly(int day, int hour, int minute)
Schedule the job monthly, the time needs to be specified in addition.JobBuilder.ScheduleBuilder
suspend()
Suspend this scheduling by default.JobBuilder.ScheduleBuilder
weekly(int day, int hour, int minute)
Schedule the job weekly, the time needs to be specified in addition.JobBuilder.ScheduleBuilder
yearly(int month, int day, int hour, int minute)
Schedule the job yearly, the time needs to be specified in addition.
-
-
-
Method Detail
-
suspend
JobBuilder.ScheduleBuilder suspend()
Suspend this scheduling by default. Invoking this method several times has the same effect as calling it just once.- Returns:
- The schedule builder to continue building.
-
hourly
JobBuilder.ScheduleBuilder hourly(int minute)
Schedule the job hourly at the given minute. If the minutes argument is less than 0 or higher than 59, the job can't be scheduled.- Parameters:
minute
- Between 0 and 59.- Returns:
- The schedule builder to continue building.
-
daily
JobBuilder.ScheduleBuilder daily(int hour, int minute)
Schedule the job daily at the given time. If a value less than zero for hour or minute is specified or a value higher than 23 for hour or a value higher than 59 for minute than the job can't be scheduled.- Parameters:
hour
- Hour of the day ranging from 0 to 23.minute
- Minute of the hour ranging from 0 to 59.- Returns:
- The schedule builder to continue building.
-
weekly
JobBuilder.ScheduleBuilder weekly(int day, int hour, int minute)
Schedule the job weekly, the time needs to be specified in addition. If a value lower than 1 or higher than 7 is used for the day, the job can't be scheduled. If a value less than zero for hour or minute is specified or a value higher than 23 for hour or a value higher than 59 for minute than the job can't be scheduled.- Parameters:
day
- Day of the week, 1:Sunday, 2:Monday, ... 7:Saturday.hour
- Hour of the day ranging from 0 to 23.minute
- Minute of the hour ranging from 0 to 59.- Returns:
- The schedule builder to continue building.
-
monthly
JobBuilder.ScheduleBuilder monthly(int day, int hour, int minute)
Schedule the job monthly, the time needs to be specified in addition. If a value lower than 1 or higher than 28 is used for the day, the job can't be scheduled. If a value less than zero for hour or minute is specified or a value higher than 23 for hour or a value higher than 59 for minute than the job can't be scheduled.- Parameters:
day
- Day of the month from 1 to 28.hour
- Hour of the day ranging from 0 to 23.minute
- Minute of the hour ranging from 0 to 59.- Returns:
- The schedule builder to continue building.
-
yearly
JobBuilder.ScheduleBuilder yearly(int month, int day, int hour, int minute)
Schedule the job yearly, the time needs to be specified in addition. If a value lower than 1 or higher than 12 is used for the month, the job can't be scheduled. If a value lower than 1 or higher than 28 is used for the day, the job can't be scheduled. If a value less than zero for hour or minute is specified or a value higher than 23 for hour or a value higher than 59 for minute than the job can't be scheduled.- Parameters:
month
- Month of the year from 1 to 12.day
- Day of the month from 1 to 28.hour
- Hour of the day ranging from 0 to 23.minute
- Minute of the hour ranging from 0 to 59.- Returns:
- The schedule builder to continue building.
-
at
JobBuilder.ScheduleBuilder at(java.util.Date date)
Schedule the job for a specific date. If no date or a a date in the past is provided, the job can't be scheduled.- Parameters:
date
- The date- Returns:
- The schedule builder to continue building.
-
cron
JobBuilder.ScheduleBuilder cron(java.lang.String expression)
Schedule the job for according to the cron expression. If no expression is specified, the job can't be scheduled.- Parameters:
expression
- The cron expression- Returns:
- The schedule builder to continue building.
-
add
ScheduledJobInfo add()
Finally add the job to the schedule- Returns:
- Returns the info object if the job could be scheduled,
null
otherwise.
-
add
ScheduledJobInfo add(java.util.List<java.lang.String> errors)
Finally add the job to the schedule- Parameters:
errors
- Optional list which will be filled with error messages.- Returns:
- Returns the info object if the job could be scheduled,
null
otherwise.
-
-