Package org.redisson.api
Class CronSchedule
- java.lang.Object
-
- org.redisson.api.CronSchedule
-
public final class CronSchedule extends Object
Cron expression object used inRScheduledExecutorService
. Fully compatible with quartz cron expression.- Author:
- Nikita Koksharov
- See Also:
RScheduledExecutorService.schedule(Runnable, CronSchedule)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CronSchedule
dailyAtHourAndMinute(int hour, int minute)
Creates cron expression which schedule task execution every day at the given timeCronExpression
getExpression()
static CronSchedule
monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute)
Creates cron expression which schedule task execution every given day of the month at the given timestatic CronSchedule
of(String expression)
Creates cron expression object with defined expression stringstatic CronSchedule
weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek)
Creates cron expression which schedule task execution every given days of the week at the given time.
-
-
-
Method Detail
-
of
public static CronSchedule of(String expression)
Creates cron expression object with defined expression string- Parameters:
expression
- of cron- Returns:
- object
- Throws:
IllegalArgumentException
- wrapping a ParseException if the expression is invalid
-
dailyAtHourAndMinute
public static CronSchedule dailyAtHourAndMinute(int hour, int minute)
Creates cron expression which schedule task execution every day at the given time- Parameters:
hour
- of scheduleminute
- of schedule- Returns:
- object
- Throws:
IllegalArgumentException
- wrapping a ParseException if the expression is invalid
-
weeklyOnDayAndHourAndMinute
public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek)
Creates cron expression which schedule task execution every given days of the week at the given time. Use Calendar object constants to define day.- Parameters:
hour
- of scheduleminute
- of scheduledaysOfWeek
- - Calendar object constants- Returns:
- object
-
monthlyOnDayAndHourAndMinute
public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute)
Creates cron expression which schedule task execution every given day of the month at the given time- Parameters:
hour
- of scheduleminute
- of scheduledayOfMonth
- of schedule- Returns:
- object
-
getExpression
public CronExpression getExpression()
-
-