|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.PollOutagesConfigFactory
This is the singleton class used to load the configuration for the poller outages from the poll-outages xml file. Note:Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods.
Field Summary | |
private static java.lang.String |
FORMAT1
|
private static java.lang.String |
FORMAT2
|
private Outages |
m_config
The config class loaded from the config file |
private static java.util.Map |
m_dayOfWeekMap
The day of the week values to name mapping |
private static boolean |
m_loaded
This member is set to true if the configuration file has been loaded. |
private static PollOutagesConfigFactory |
m_singleton
The singleton instance of this factory |
Constructor Summary | |
private |
PollOutagesConfigFactory(java.lang.String configFile)
Private constructor |
Method Summary | |
private static void |
createDayOfWeekMapping()
Create the day of week mapping |
static PollOutagesConfigFactory |
getInstance()
Return the singleton instance of this factory. |
Interface[] |
getInterfaces(java.lang.String name)
Return the interfaces for specified outage. |
Outage |
getOutage(java.lang.String name)
Return the specified outage. |
Outage[] |
getOutages()
Return the outages configured. |
Time[] |
getOutageTimes(java.lang.String name)
Return the outage times for specified outage. |
java.lang.String |
getOutageType(java.lang.String name)
Return the type for specified outage. |
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
boolean |
isCurTimeInOutage(Outage out)
Return if current time is part of specified outage. |
boolean |
isCurTimeInOutage(java.lang.String outName)
Return if current time is part of specified outage. |
boolean |
isInterfaceInOutage(java.lang.String linterface,
Outage out)
Return if interfaces is part of specified outage. |
boolean |
isInterfaceInOutage(java.lang.String linterface,
java.lang.String outName)
Return if interfaces is part of specified outage. |
boolean |
isTimeInOutage(java.util.Calendar cal,
Outage out)
Return if time is part of specified outage. |
boolean |
isTimeInOutage(java.util.Calendar cal,
java.lang.String outName)
Return if time is part of specified outage. |
static void |
reload()
Reload the config from the default config file |
private void |
setOutCalTime(java.util.Calendar outCal,
java.lang.String timeStr)
Set the time in outCal from timeStr. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static PollOutagesConfigFactory m_singleton
private Outages m_config
private static boolean m_loaded
private static java.util.Map m_dayOfWeekMap
private static java.lang.String FORMAT1
private static java.lang.String FORMAT2
Constructor Detail |
private PollOutagesConfigFactory(java.lang.String configFile) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config
file cannot be read
org.exolab.castor.xml.MarshalException
- Thrown if the
file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if
the contents do not match the required schema.Method Detail |
private static void createDayOfWeekMapping()
private void setOutCalTime(java.util.Calendar outCal, java.lang.String timeStr)
outCal
- the calendar in which time is to be settimeStr
- the time stringpublic static void init() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config
file cannot be read
org.exolab.castor.xml.MarshalException
- Thrown if the
file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if
the contents do not match the required schema.public static void reload() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config
file cannot be read/loaded
org.exolab.castor.xml.MarshalException
- Thrown if the
file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if
the contents do not match the required schema.public static PollOutagesConfigFactory getInstance()
java.lang.IllegalStateException
- Thrown if the factory
has not yet been initialized.public Outage[] getOutages()
public Outage getOutage(java.lang.String name)
name
- the outage that is to be looked up
public java.lang.String getOutageType(java.lang.String name)
name
- the outage that is to be looked up
public Time[] getOutageTimes(java.lang.String name)
name
- the outage that is to be looked up
public Interface[] getInterfaces(java.lang.String name)
name
- the outage that is to be looked up
public boolean isInterfaceInOutage(java.lang.String linterface, java.lang.String outName)
linterface
- the interface to be looked upoutName
- the outage name
public boolean isInterfaceInOutage(java.lang.String linterface, Outage out)
linterface
- the interface to be looked upout
- the outage
public boolean isTimeInOutage(java.util.Calendar cal, java.lang.String outName)
cal
- the calendar to lookupoutName
- the outage name
public boolean isTimeInOutage(java.util.Calendar cal, Outage out)
cal
- the calendar to lookupout
- the outage
public boolean isCurTimeInOutage(java.lang.String outName)
outName
- the outage name
public boolean isCurTimeInOutage(Outage out)
out
- the outage
|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |