|
|||||||||
| 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.NSClientPeerFactory
public final class NSClientPeerFactory
This class is the main repository for NSCLient configuration information used by
the capabilities daemon. When this class is loaded it reads the nsclient
configuration into memory, and uses the configuration to find the
NSClientAgentConfig 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 | |
|---|---|
NSClientPeerFactory(Reader rdr)
|
|
| Method Summary | |
|---|---|
void |
define(InetAddress ip,
String password)
Puts a specific IP address with associated password into the currently loaded nsclient-config.xml. |
NSClientAgentConfig |
getAgentConfig(InetAddress agentInetAddress)
|
static NSClientPeerFactory |
getInstance()
Return the singleton instance of this factory. |
static NsclientConfig |
getNSClientConfig()
|
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static void |
reload()
Reload the config from the default config file |
static void |
saveCurrent()
Saves the current settings to disk |
static void |
setInstance(NSClientPeerFactory singleton)
|
static void |
setNSClientConfig(NsclientConfig m_config)
|
| Methods inherited from class org.opennms.netmgt.config.PeerFactory |
|---|
countChar, matchNumericListOrRange, matchRange, toLong, verifyIpMatch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NSClientPeerFactory(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 Exception
Exceptionpublic static NSClientPeerFactory getInstance()
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(NSClientPeerFactory singleton)
public void define(InetAddress ip,
String password)
throws UnknownHostException
UnknownHostExceptionpublic NSClientAgentConfig getAgentConfig(InetAddress agentInetAddress)
public static NsclientConfig getNSClientConfig()
public static void setNSClientConfig(NsclientConfig m_config)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||