|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.PeerFactory
org.opennms.netmgt.config.SnmpPeerFactory
public final class SnmpPeerFactory
This class is the main respository for SNMP configuration information used by
the capabilities daemon. When this class is loaded it reads the snmp
configuration into memory, and uses the configuration to find the
SnmpAgentConfig objects for specific
addresses. If an address cannot be located in the configuration then a
default peer instance is returned to the caller.
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.
| Constructor Summary | |
|---|---|
SnmpPeerFactory(Reader rdr)
|
|
SnmpPeerFactory(org.springframework.core.io.Resource resource)
|
|
| Method Summary | |
|---|---|
void |
define(SnmpEventInfo info)
Enhancement: Allows specific or ranges to be merged into snmp configuration with many other attributes. |
org.opennms.netmgt.snmp.SnmpAgentConfig |
getAgentConfig(InetAddress agentAddress)
|
static File |
getFile()
|
static SnmpPeerFactory |
getInstance()
Return the singleton instance of this factory. |
static SnmpConfig |
getSnmpConfig()
|
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static String |
marshallConfig()
Creates a string containing the XML of the current SnmpConfig |
static void |
reload()
Reload the config from the default config file |
static void |
saveCurrent()
Saves the current settings to disk |
static void |
setFile(File configFile)
|
static void |
setInstance(SnmpPeerFactory singleton)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SnmpPeerFactory(org.springframework.core.io.Resource resource)
public SnmpPeerFactory(Reader rdr)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException| Method Detail |
|---|
public static void init()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
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 IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
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 void saveCurrent()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationExceptionpublic static SnmpPeerFactory getInstance()
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setFile(File configFile)
public static File getFile()
throws IOException
IOExceptionpublic static void setInstance(SnmpPeerFactory singleton)
public org.opennms.netmgt.snmp.SnmpAgentConfig getAgentConfig(InetAddress agentAddress)
getAgentConfig in interface SnmpAgentConfigFactorypublic static SnmpConfig getSnmpConfig()
public void define(SnmpEventInfo info)
public static String marshallConfig()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||