Package org.opennms.netmgt.config
Class BasicScheduleUtils
- java.lang.Object
-
- org.opennms.netmgt.config.BasicScheduleUtils
-
public abstract class BasicScheduleUtils extends java.lang.Object
BasicScheduleUtils class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FORMAT1
ConstantFORMAT1="dd-MMM-yyyy HH:mm:ss"
static java.lang.String
FORMAT2
ConstantFORMAT2="HH:mm:ss"
protected static java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Integer>>
m_dayOfWeekMap
The 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 BasicSchedule
getBasicOutageSchedule(Outage out)
static java.util.Date
getDailyTime(java.util.Date referenceTime, java.lang.String timeString)
getDailyTimestatic java.lang.Integer
getDayOfWeekIndex(java.lang.String dayName)
getDayOfWeekIndexstatic java.util.Calendar
getEndOfSchedule(BasicSchedule out)
getEndOfSchedulestatic BasicSchedule
getGroupSchedule(Schedule schedule)
static OwnedInterval
getInterval(java.util.Date ref, Time time, Owner owner)
getIntervalstatic OwnedIntervalSequence
getIntervals(java.util.Date start, java.util.Date end, Time time, Owner owner)
getIntervalsstatic OwnedIntervalSequence
getIntervals(TimeInterval interval, Time time, Owner owner)
getIntervalsstatic OwnedIntervalSequence
getIntervalsCovering(java.util.Date start, java.util.Date end, BasicSchedule sched, Owner owner)
getIntervalsCoveringstatic OwnedIntervalSequence
getIntervalsCovering(TimeInterval interval, BasicSchedule sched, Owner owner)
getIntervalsCoveringstatic java.util.Date
getMonthlyTime(java.util.Date referenceTime, java.lang.String day, java.lang.String timeString)
getMonthlyTimestatic BasicSchedule
getRancidSchedule(Schedule schedule)
static java.util.Date
getSpecificTime(java.lang.String specificString)
getSpecificTimestatic java.util.Date
getWeeklyTime(java.util.Date referenceTime, java.lang.String day, java.lang.String timeString)
getWeeklyTimestatic boolean
isDaily(Time time)
isDailystatic boolean
isMonthly(Time time)
isMonthlystatic boolean
isSpecific(Time time)
isSpecificstatic boolean
isTimeInSchedule(java.util.Calendar cal, BasicSchedule sched)
isTimeInSchedulestatic boolean
isTimeInSchedule(java.util.Date time, BasicSchedule sched)
isTimeInSchedulestatic boolean
isWeekly(Time time)
isWeeklystatic java.util.Date
nextDay(java.util.Date date)
nextDaystatic java.util.Date
nextMonth(java.util.Date date)
nextMonthstatic java.util.Date
nextWeek(java.util.Date date)
nextWeekstatic void
setOutCalTime(java.util.Calendar outCal, java.lang.String timeStr)
Set the time in outCal from timeStr.
-
-
-
Field Detail
-
m_dayOfWeekMap
protected static final java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Integer>> m_dayOfWeekMap
The day of the week values to name mapping
-
FORMAT1
public static final java.lang.String FORMAT1
ConstantFORMAT1="dd-MMM-yyyy HH:mm:ss"
- See Also:
- Constant Field Values
-
FORMAT2
public static final java.lang.String FORMAT2
ConstantFORMAT2="HH:mm:ss"
- See Also:
- Constant Field Values
-
-
Method Detail
-
isTimeInSchedule
public static boolean isTimeInSchedule(java.util.Calendar cal, BasicSchedule sched)
isTimeInSchedule
- Parameters:
cal
- aCalendar
object.sched
- aorg.opennms.netmgt.config.poller.outages.common.BasicSchedule
object.- Returns:
- a boolean.
-
setOutCalTime
public static void setOutCalTime(java.util.Calendar outCal, java.lang.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
-
getDayOfWeekIndex
public static java.lang.Integer getDayOfWeekIndex(java.lang.String dayName)
getDayOfWeekIndex
- Parameters:
dayName
- aString
object.- Returns:
- a
Integer
object.
-
getEndOfSchedule
public static java.util.Calendar getEndOfSchedule(BasicSchedule out)
getEndOfSchedule
- Parameters:
out
- aorg.opennms.netmgt.config.poller.outages.common.BasicSchedule
object.- Returns:
- a
Calendar
object.
-
isTimeInSchedule
public static boolean isTimeInSchedule(java.util.Date time, BasicSchedule sched)
isTimeInSchedule
- Parameters:
time
- aDate
object.sched
- aorg.opennms.netmgt.config.poller.outages.common.BasicSchedule
object.- Returns:
- a boolean.
-
isDaily
public static boolean isDaily(Time time)
isDaily
- Parameters:
time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.- Returns:
- a boolean.
-
isWeekly
public static boolean isWeekly(Time time)
isWeekly
- Parameters:
time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.- Returns:
- a boolean.
-
isMonthly
public static boolean isMonthly(Time time)
isMonthly
- Parameters:
time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.- Returns:
- a boolean.
-
isSpecific
public static boolean isSpecific(Time time)
isSpecific
- Parameters:
time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.- Returns:
- a boolean.
-
getSpecificTime
public static java.util.Date getSpecificTime(java.lang.String specificString)
getSpecificTime
- Parameters:
specificString
- aString
object.- Returns:
- a
Date
object.
-
getMonthlyTime
public static java.util.Date getMonthlyTime(java.util.Date referenceTime, java.lang.String day, java.lang.String timeString)
getMonthlyTime
- Parameters:
referenceTime
- aDate
object.day
- aString
object.timeString
- aString
object.- Returns:
- a
Date
object.
-
getWeeklyTime
public static java.util.Date getWeeklyTime(java.util.Date referenceTime, java.lang.String day, java.lang.String timeString)
getWeeklyTime
- Parameters:
referenceTime
- aDate
object.day
- aString
object.timeString
- aString
object.- Returns:
- a
Date
object.
-
getDailyTime
public static java.util.Date getDailyTime(java.util.Date referenceTime, java.lang.String timeString)
getDailyTime
- Parameters:
referenceTime
- aDate
object.timeString
- aString
object.- Returns:
- a
Date
object.
-
getInterval
public static OwnedInterval getInterval(java.util.Date ref, Time time, Owner owner)
getInterval
- Parameters:
ref
- aDate
object.time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.owner
- aOwner
object.- Returns:
- a
OwnedInterval
object.
-
nextDay
public static java.util.Date nextDay(java.util.Date date)
nextDay
- Parameters:
date
- aDate
object.- Returns:
- a
Date
object.
-
nextWeek
public static java.util.Date nextWeek(java.util.Date date)
nextWeek
- Parameters:
date
- aDate
object.- Returns:
- a
Date
object.
-
nextMonth
public static java.util.Date nextMonth(java.util.Date date)
nextMonth
- Parameters:
date
- aDate
object.- Returns:
- a
Date
object.
-
getIntervals
public static OwnedIntervalSequence getIntervals(java.util.Date start, java.util.Date end, Time time, Owner owner)
getIntervals
- Parameters:
start
- aDate
object.end
- aDate
object.time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.owner
- aOwner
object.- Returns:
- a
OwnedIntervalSequence
object.
-
getIntervals
public static OwnedIntervalSequence getIntervals(TimeInterval interval, Time time, Owner owner)
getIntervals
- Parameters:
interval
- aTimeInterval
object.time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.owner
- aOwner
object.- Returns:
- a
OwnedIntervalSequence
object.
-
getIntervalsCovering
public static OwnedIntervalSequence getIntervalsCovering(java.util.Date start, java.util.Date end, BasicSchedule sched, Owner owner)
getIntervalsCovering
- Parameters:
start
- aDate
object.end
- aDate
object.sched
- aorg.opennms.netmgt.config.poller.outages.common.BasicSchedule
object.owner
- aOwner
object.- Returns:
- a
OwnedIntervalSequence
object.
-
getIntervalsCovering
public static OwnedIntervalSequence getIntervalsCovering(TimeInterval interval, BasicSchedule sched, Owner owner)
getIntervalsCovering
- Parameters:
interval
- aTimeInterval
object.sched
- aorg.opennms.netmgt.config.poller.outages.common.BasicSchedule
object.owner
- aOwner
object.- Returns:
- a
OwnedIntervalSequence
object.
-
getBasicOutageSchedule
public static BasicSchedule getBasicOutageSchedule(Outage out)
-
getGroupSchedule
public static BasicSchedule getGroupSchedule(Schedule schedule)
-
getRancidSchedule
public static BasicSchedule getRancidSchedule(Schedule schedule)
-
-