Package org.opennms.netmgt.config
Class BasicScheduleUtils
- java.lang.Object
-
- org.opennms.netmgt.config.BasicScheduleUtils
-
public abstract class BasicScheduleUtils extends Object
BasicScheduleUtils class.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORMAT1ConstantFORMAT1="dd-MMM-yyyy HH:mm:ss"static StringFORMAT2ConstantFORMAT2="HH:mm:ss"protected static ThreadLocal<Map<String,Integer>>m_dayOfWeekMapThe day of the week values to name mapping
-
Constructor Summary
Constructors Constructor Description BasicScheduleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BasicSchedulegetBasicOutageSchedule(Outage out)static DategetDailyTime(Date referenceTime, String timeString)getDailyTimestatic IntegergetDayOfWeekIndex(String dayName)getDayOfWeekIndexstatic CalendargetEndOfSchedule(BasicSchedule out)getEndOfSchedulestatic BasicSchedulegetGroupSchedule(Schedule schedule)static OwnedIntervalgetInterval(Date ref, Time time, Owner owner)getIntervalstatic OwnedIntervalSequencegetIntervals(Date start, Date end, Time time, Owner owner)getIntervalsstatic OwnedIntervalSequencegetIntervals(TimeInterval interval, Time time, Owner owner)getIntervalsstatic OwnedIntervalSequencegetIntervalsCovering(Date start, Date end, BasicSchedule sched, Owner owner)getIntervalsCoveringstatic OwnedIntervalSequencegetIntervalsCovering(TimeInterval interval, BasicSchedule sched, Owner owner)getIntervalsCoveringstatic DategetMonthlyTime(Date referenceTime, String day, String timeString)getMonthlyTimestatic BasicSchedulegetRancidSchedule(Schedule schedule)static DategetSpecificTime(String specificString)getSpecificTimestatic DategetWeeklyTime(Date referenceTime, String day, String timeString)getWeeklyTimestatic booleanisDaily(Time time)isDailystatic booleanisMonthly(Time time)isMonthlystatic booleanisSpecific(Time time)isSpecificstatic booleanisTimeInSchedule(Calendar cal, BasicSchedule sched)isTimeInSchedulestatic booleanisTimeInSchedule(Date time, BasicSchedule sched)isTimeInSchedulestatic booleanisWeekly(Time time)isWeeklystatic DatenextDay(Date date)nextDaystatic DatenextMonth(Date date)nextMonthstatic DatenextWeek(Date date)nextWeekstatic voidsetOutCalTime(Calendar outCal, String timeStr)Set the time in outCal from timeStr.
-
-
-
Field Detail
-
m_dayOfWeekMap
protected static final ThreadLocal<Map<String,Integer>> m_dayOfWeekMap
The day of the week values to name mapping
-
FORMAT1
public static final String FORMAT1
ConstantFORMAT1="dd-MMM-yyyy HH:mm:ss"- See Also:
- Constant Field Values
-
FORMAT2
public static final String FORMAT2
ConstantFORMAT2="HH:mm:ss"- See Also:
- Constant Field Values
-
-
Method Detail
-
isTimeInSchedule
public static boolean isTimeInSchedule(Calendar cal, BasicSchedule sched)
isTimeInSchedule
- Parameters:
cal- aCalendarobject.sched- aorg.opennms.netmgt.config.poller.outages.common.BasicScheduleobject.- 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 settimeStr- the time string
-
getEndOfSchedule
public static Calendar getEndOfSchedule(BasicSchedule out)
getEndOfSchedule
- Parameters:
out- aorg.opennms.netmgt.config.poller.outages.common.BasicScheduleobject.- Returns:
- a
Calendarobject.
-
isTimeInSchedule
public static boolean isTimeInSchedule(Date time, BasicSchedule sched)
isTimeInSchedule
- Parameters:
time- aDateobject.sched- aorg.opennms.netmgt.config.poller.outages.common.BasicScheduleobject.- Returns:
- a boolean.
-
isDaily
public static boolean isDaily(Time time)
isDaily
- Parameters:
time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.- Returns:
- a boolean.
-
isWeekly
public static boolean isWeekly(Time time)
isWeekly
- Parameters:
time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.- Returns:
- a boolean.
-
isMonthly
public static boolean isMonthly(Time time)
isMonthly
- Parameters:
time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.- Returns:
- a boolean.
-
isSpecific
public static boolean isSpecific(Time time)
isSpecific
- Parameters:
time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.- Returns:
- a boolean.
-
getMonthlyTime
public static Date getMonthlyTime(Date referenceTime, String day, String timeString)
getMonthlyTime
-
getWeeklyTime
public static Date getWeeklyTime(Date referenceTime, String day, String timeString)
getWeeklyTime
-
getInterval
public static OwnedInterval getInterval(Date ref, Time time, Owner owner)
getInterval
- Parameters:
ref- aDateobject.time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.owner- aOwnerobject.- Returns:
- a
OwnedIntervalobject.
-
getIntervals
public static OwnedIntervalSequence getIntervals(Date start, Date end, Time time, Owner owner)
getIntervals
- Parameters:
start- aDateobject.end- aDateobject.time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.owner- aOwnerobject.- Returns:
- a
OwnedIntervalSequenceobject.
-
getIntervals
public static OwnedIntervalSequence getIntervals(TimeInterval interval, Time time, Owner owner)
getIntervals
- Parameters:
interval- aTimeIntervalobject.time- aorg.opennms.netmgt.config.poller.outages.common.Timeobject.owner- aOwnerobject.- Returns:
- a
OwnedIntervalSequenceobject.
-
getIntervalsCovering
public static OwnedIntervalSequence getIntervalsCovering(Date start, Date end, BasicSchedule sched, Owner owner)
getIntervalsCovering
- Parameters:
start- aDateobject.end- aDateobject.sched- aorg.opennms.netmgt.config.poller.outages.common.BasicScheduleobject.owner- aOwnerobject.- Returns:
- a
OwnedIntervalSequenceobject.
-
getIntervalsCovering
public static OwnedIntervalSequence getIntervalsCovering(TimeInterval interval, BasicSchedule sched, Owner owner)
getIntervalsCovering
- Parameters:
interval- aTimeIntervalobject.sched- aorg.opennms.netmgt.config.poller.outages.common.BasicScheduleobject.owner- aOwnerobject.- Returns:
- a
OwnedIntervalSequenceobject.
-
getBasicOutageSchedule
public static BasicSchedule getBasicOutageSchedule(Outage out)
-
getGroupSchedule
public static BasicSchedule getGroupSchedule(Schedule schedule)
-
getRancidSchedule
public static BasicSchedule getRancidSchedule(Schedule schedule)
-
-