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 String
FORMAT1
ConstantFORMAT1="dd-MMM-yyyy HH:mm:ss"
static String
FORMAT2
ConstantFORMAT2="HH:mm:ss"
protected static ThreadLocal<Map<String,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 Date
getDailyTime(Date referenceTime, String timeString)
getDailyTimestatic Integer
getDayOfWeekIndex(String dayName)
getDayOfWeekIndexstatic Calendar
getEndOfSchedule(BasicSchedule out)
getEndOfSchedulestatic BasicSchedule
getGroupSchedule(Schedule schedule)
static OwnedInterval
getInterval(Date ref, Time time, Owner owner)
getIntervalstatic OwnedIntervalSequence
getIntervals(Date start, Date end, Time time, Owner owner)
getIntervalsstatic OwnedIntervalSequence
getIntervals(TimeInterval interval, Time time, Owner owner)
getIntervalsstatic OwnedIntervalSequence
getIntervalsCovering(Date start, Date end, BasicSchedule sched, Owner owner)
getIntervalsCoveringstatic OwnedIntervalSequence
getIntervalsCovering(TimeInterval interval, BasicSchedule sched, Owner owner)
getIntervalsCoveringstatic Date
getMonthlyTime(Date referenceTime, String day, String timeString)
getMonthlyTimestatic BasicSchedule
getRancidSchedule(Schedule schedule)
static Date
getSpecificTime(String specificString)
getSpecificTimestatic Date
getWeeklyTime(Date referenceTime, String day, String timeString)
getWeeklyTimestatic boolean
isDaily(Time time)
isDailystatic boolean
isMonthly(Time time)
isMonthlystatic boolean
isSpecific(Time time)
isSpecificstatic boolean
isTimeInSchedule(Calendar cal, BasicSchedule sched)
isTimeInSchedulestatic boolean
isTimeInSchedule(Date time, BasicSchedule sched)
isTimeInSchedulestatic boolean
isWeekly(Time time)
isWeeklystatic Date
nextDay(Date date)
nextDaystatic Date
nextMonth(Date date)
nextMonthstatic Date
nextWeek(Date date)
nextWeekstatic void
setOutCalTime(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
- aCalendar
object.sched
- aorg.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 settimeStr
- the time string
-
getEndOfSchedule
public static 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(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.
-
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
- aDate
object.time
- aorg.opennms.netmgt.config.poller.outages.common.Time
object.owner
- aOwner
object.- Returns:
- a
OwnedInterval
object.
-
getIntervals
public static OwnedIntervalSequence getIntervals(Date start, 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(Date start, 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)
-
-