Class Util
java.lang.Object
org.opencastproject.scheduler.api.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe minimum separation between one event ending and the next starting -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadjustRrule(net.fortuna.ical4j.model.property.RRule rRule, Date start, TimeZone tz) Adjust the given UTC rrule to the given timezone.static List<net.fortuna.ical4j.model.Period> calculatePeriods(Calendar startCalTz, Calendar endCalTz, long duration, net.fortuna.ical4j.model.Recur recur, TimeZone tz) Given a start time and end time with a recurrence rule and a timezone, all periods of the recurrence rule are calculated taken daylight saving time into account.static List<net.fortuna.ical4j.model.Period> calculatePeriods(Date start, Date end, long duration, net.fortuna.ical4j.model.property.RRule rRule, TimeZone tz) Backward compatibility, converts parameters as required for the updated calculatePeriodsstatic booleanschedulingIntervalsOverlap(Date start1, Date end1, Date start2, Date end2) Check if two intervals (for example, for two scheduled events), overlap.
-
Field Details
-
EVENT_MINIMUM_SEPARATION_MILLISECONDS
public static final int EVENT_MINIMUM_SEPARATION_MILLISECONDSThe minimum separation between one event ending and the next starting- See Also:
-
-
Method Details
-
adjustRrule
public static void adjustRrule(net.fortuna.ical4j.model.property.RRule rRule, Date start, TimeZone tz) Adjust the given UTC rrule to the given timezone.- Parameters:
rRule- The rrule to adjust.start- The start date in UTCtz- The target timezone.
-
calculatePeriods
public static List<net.fortuna.ical4j.model.Period> calculatePeriods(Date start, Date end, long duration, net.fortuna.ical4j.model.property.RRule rRule, TimeZone tz) Backward compatibility, converts parameters as required for the updated calculatePeriods- Parameters:
start- date in the scheduled time zoneend- date in the scheduled time zoneduration-rRule-tz- , time zone of the scheduled event- Returns:
- the calculated periods
-
calculatePeriods
public static List<net.fortuna.ical4j.model.Period> calculatePeriods(Calendar startCalTz, Calendar endCalTz, long duration, net.fortuna.ical4j.model.Recur recur, TimeZone tz) Given a start time and end time with a recurrence rule and a timezone, all periods of the recurrence rule are calculated taken daylight saving time into account.- Parameters:
startCalTz- , Calendar date time of the recurrence in the timezone of the scheduled CAendCalTz- , Calendar date time of the recurrence in the timezone of the scheduled CAduration- , the length of each eventrecur- , the recurrence rule (based on the Start time zone, including start hour and days of week)tz- , the timezone of the scheduled CA- Returns:
- a list of event Periods that match the rule and start and end times
-
schedulingIntervalsOverlap
Check if two intervals (for example, for two scheduled events), overlap.- Parameters:
start1- start of first intervalend1- end of first intervalstart2- start of second intervalend2- end of second interval- Returns:
trueif they overlap,falseif they don't
-