Class BasicScheduleUtils


  • public abstract class BasicScheduleUtils
    extends Object

    BasicScheduleUtils class.

    • Constructor Detail

      • BasicScheduleUtils

        public BasicScheduleUtils()
    • Method Detail

      • isTimeInSchedule

        public static boolean isTimeInSchedule​(Calendar cal,
                                               BasicSchedule sched)

        isTimeInSchedule

        Parameters:
        cal - a Calendar object.
        sched - a org.opennms.netmgt.config.poller.outages.common.BasicSchedule object.
        Returns:
        a boolean.
      • setOutCalTime

        public static void setOutCalTime​(Calendar outCal,
                                         String timeStr)
        Set the time in outCal from timeStr. 'timeStr'is in either the 'dd-MMM-yyyy HH:mm:ss' or the 'HH:mm:ss' formats
        Parameters:
        outCal - the calendar in which time is to be set
        timeStr - the time string
      • getDayOfWeekIndex

        public static Integer getDayOfWeekIndex​(String dayName)

        getDayOfWeekIndex

        Parameters:
        dayName - a String object.
        Returns:
        a Integer object.
      • getEndOfSchedule

        public static Calendar getEndOfSchedule​(BasicSchedule out)

        getEndOfSchedule

        Parameters:
        out - a org.opennms.netmgt.config.poller.outages.common.BasicSchedule object.
        Returns:
        a Calendar object.
      • isTimeInSchedule

        public static boolean isTimeInSchedule​(Date time,
                                               BasicSchedule sched)

        isTimeInSchedule

        Parameters:
        time - a Date object.
        sched - a org.opennms.netmgt.config.poller.outages.common.BasicSchedule object.
        Returns:
        a boolean.
      • isDaily

        public static boolean isDaily​(Time time)

        isDaily

        Parameters:
        time - a org.opennms.netmgt.config.poller.outages.common.Time object.
        Returns:
        a boolean.
      • isWeekly

        public static boolean isWeekly​(Time time)

        isWeekly

        Parameters:
        time - a org.opennms.netmgt.config.poller.outages.common.Time object.
        Returns:
        a boolean.
      • isMonthly

        public static boolean isMonthly​(Time time)

        isMonthly

        Parameters:
        time - a org.opennms.netmgt.config.poller.outages.common.Time object.
        Returns:
        a boolean.
      • isSpecific

        public static boolean isSpecific​(Time time)

        isSpecific

        Parameters:
        time - a org.opennms.netmgt.config.poller.outages.common.Time object.
        Returns:
        a boolean.
      • getSpecificTime

        public static Date getSpecificTime​(String specificString)

        getSpecificTime

        Parameters:
        specificString - a String object.
        Returns:
        a Date object.
      • getMonthlyTime

        public static Date getMonthlyTime​(Date referenceTime,
                                          String day,
                                          String timeString)

        getMonthlyTime

        Parameters:
        referenceTime - a Date object.
        day - a String object.
        timeString - a String object.
        Returns:
        a Date object.
      • getWeeklyTime

        public static Date getWeeklyTime​(Date referenceTime,
                                         String day,
                                         String timeString)

        getWeeklyTime

        Parameters:
        referenceTime - a Date object.
        day - a String object.
        timeString - a String object.
        Returns:
        a Date object.
      • getDailyTime

        public static Date getDailyTime​(Date referenceTime,
                                        String timeString)

        getDailyTime

        Parameters:
        referenceTime - a Date object.
        timeString - a String object.
        Returns:
        a Date object.
      • getInterval

        public static OwnedInterval getInterval​(Date ref,
                                                Time time,
                                                Owner owner)

        getInterval

        Parameters:
        ref - a Date object.
        time - a org.opennms.netmgt.config.poller.outages.common.Time object.
        owner - a Owner object.
        Returns:
        a OwnedInterval object.
      • nextDay

        public static Date nextDay​(Date date)

        nextDay

        Parameters:
        date - a Date object.
        Returns:
        a Date object.
      • nextWeek

        public static Date nextWeek​(Date date)

        nextWeek

        Parameters:
        date - a Date object.
        Returns:
        a Date object.
      • nextMonth

        public static Date nextMonth​(Date date)

        nextMonth

        Parameters:
        date - a Date object.
        Returns:
        a Date object.