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 timestatic CronSchedule
dailyAtHourAndMinute(int hour, int minute, ZoneId zoneId)
Creates cron expression which schedule task execution every day at the given time in specified time-zone IDCronExpression
getExpression()
ZoneId
getZoneId()
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
monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute, ZoneId zoneId)
Creates cron expression which schedule task execution every given day of the month at the given time in specified time-zone ID.static CronSchedule
of(String expression)
Creates cron expression object with defined expression stringstatic CronSchedule
of(String expression, ZoneId zoneId)
Creates cron expression object with defined expression string and time-zone IDstatic 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.static CronSchedule
weeklyOnDayAndHourAndMinute(int hour, int minute, ZoneId zoneId, Integer... daysOfWeek)
Creates cron expression which schedule task execution every given days of the week at the given time in specified time-zone ID.
-
-
-
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
-
of
public static CronSchedule of(String expression, ZoneId zoneId)
Creates cron expression object with defined expression string and time-zone ID- Parameters:
expression
- of cronzoneId
- id of zone- 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
-
dailyAtHourAndMinute
public static CronSchedule dailyAtHourAndMinute(int hour, int minute, ZoneId zoneId)
Creates cron expression which schedule task execution every day at the given time in specified time-zone ID- Parameters:
hour
- of scheduleminute
- of schedulezoneId
- id of zone- 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
-
weeklyOnDayAndHourAndMinute
public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, ZoneId zoneId, Integer... daysOfWeek)
Creates cron expression which schedule task execution every given days of the week at the given time in specified time-zone ID. Use Calendar object constants to define day.- Parameters:
hour
- of scheduleminute
- of schedulezoneId
- id of zonedaysOfWeek
- - 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
-
monthlyOnDayAndHourAndMinute
public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute, ZoneId zoneId)
Creates cron expression which schedule task execution every given day of the month at the given time in specified time-zone ID.- Parameters:
hour
- of scheduleminute
- of scheduledayOfMonth
- of schedulezoneId
- id of zone- Returns:
- object
-
getExpression
public CronExpression getExpression()
-
getZoneId
public ZoneId getZoneId()
-
-