Package mondrian.util

Class Schedule

    • Method Detail

      • createOnce

        public static Schedule createOnce​(Date date,
                                          TimeZone tz)
        Creates a calendar which fires only once.
        Parameters:
        date - date and time to fire, must be UTC
        tz - timezone
      • createDaily

        public static Schedule createDaily​(Date begin,
                                           Date end,
                                           TimeZone tz,
                                           Time timeOfDay,
                                           int period)
        Creates a calendar which fires every day.
        Parameters:
        begin - open lower bound, may be null, must be UTC
        end - closed upper bound, may be null, must be UTC
        tz - timezone
        timeOfDay - time at which to fire
        period - causes the schedule to fire every period days. If period is greater than 1, the cycle starts at the begin point of the schedule, or at the epoch (1 January, 1970) if begin is not specified.
      • createWeekly

        public static Schedule createWeekly​(Date begin,
                                            Date end,
                                            TimeZone tz,
                                            Time timeOfDay,
                                            int period,
                                            int daysOfWeekBitmap)
        Creates a calendar which fires on particular days each week.
        Parameters:
        tz - timezone
        daysOfWeekBitmap - a bitmap of day values, for example (1 << Calendar.TUESDAY) | (1 << Calendar.THURSDAY) to fire on Tuesdays and Thursdays
        timeOfDay - time at which to fire
        begin - open lower bound, may be null
        end - closed upper bound, may be null
        period - causes the schedule to be active every period weeks. If period is greater than 1, the cycle starts at the begin point of the schedule, or at the epoch (1 January, 1970) if begin is not specified.
      • createMonthlyByDay

        public static Schedule createMonthlyByDay​(Date begin,
                                                  Date end,
                                                  TimeZone tz,
                                                  Time timeOfDay,
                                                  int period,
                                                  int daysOfMonthBitmap)
        Creates a calendar which fires on particular days of each month. For example,
        createMonthlyByDay(
             null, null, TimeZone.getTimeZone("PST"), 1,
             (1 << 12) | (1 << 14) | (1 << LAST_DAY_OF_MONTH))
        creates a schedule which fires on the 12th, 14th and last day of the month.
        Parameters:
        begin - open lower bound, may be null
        end - closed upper bound, may be null
        tz - timezone
        daysOfMonthBitmap - a bitmap of day values, may include LAST_DAY_OF_MONTH
        timeOfDay - time at which to fire
        period - causes the schedule to be active every period months. If period is greater than 1, the cycle starts at the begin point of the schedule, or at the epoch (1 January, 1970) if begin is not specified.
      • createMonthlyByWeek

        public static Schedule createMonthlyByWeek​(Date begin,
                                                   Date end,
                                                   TimeZone tz,
                                                   Time timeOfDay,
                                                   int period,
                                                   int daysOfWeekBitmap,
                                                   int weeksOfMonthBitmap)
        Creates a calendar which fires on particular days of particular weeks of a month. For example,
        createMonthlyByWeek(
             null, null, TimeZone.getTimeZone("PST"),
             (1 << Calendar.TUESDAY) | (1 << Calendar.THURSDAY),
             (1 << 2) | (1 << LAST_WEEK_OF_MONTH)
        creates a schedule which fires on the 2nd and last Tuesday and Thursday of the month.
        Parameters:
        begin - open lower bound, may be null
        end - closed upper bound, may be null
        tz - timezone
        daysOfWeekBitmap - a bitmap of day values, for example (1 << Calendar.TUESDAY) | (1 << Calendar.THURSDAY)
        weeksOfMonthBitmap - a bitmap of week values (may include LAST_WEEK_OF_MONTH
        timeOfDay - time at which to fire
        period - causes the schedule be active every period months. If period is greater than 1, the cycle starts at the begin point of the schedule, or at the epoch (1 January, 1970) if begin is not specified.
      • nextOccurrence

        public Date nextOccurrence​(Date after,
                                   boolean strict)
        Returns the next occurrence of this schedule after a given date. If after is null, returns the first occurrence. If there are no further occurrences, returns null.
        Parameters:
        after - if not null, returns the first occurrence after this point in time; if null, returns the first occurrence ever.
        strict - If after is an occurrence, strict determines whether this method returns it, or the next occurrence. If strict is true, the value returned is strictly greater than after.