|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opennms.netmgt.config.AmiPeerFactory
public class AmiPeerFactory
This class is the main repository for AMI configuration information used by
the capabilities daemon. When this class is loaded it reads the AMI
configuration into memory, and uses the configuration to find the
AmiAgentConfig 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.
| Method Summary | |
|---|---|
AmiAgentConfig |
getAgentConfig(InetAddress agentInetAddress)
getAgentConfig |
static AmiConfig |
getAmiConfig()
getAmiConfig |
static AmiPeerFactory |
getInstance()
Return the singleton instance of this factory. |
Lock |
getReadLock()
|
Lock |
getWriteLock()
|
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 |
void |
saveCurrent()
Saves the current settings to disk |
static void |
setAmiConfig(AmiConfig m_config)
setAmiConfig |
static void |
setInstance(AmiPeerFactory singleton)
setInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Lock getReadLock()
public Lock getWriteLock()
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.
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
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.
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.public static AmiPeerFactory getInstance()
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(AmiPeerFactory singleton)
setInstance
singleton - a AmiPeerFactory object.public static void setAmiConfig(AmiConfig m_config)
setAmiConfig
m_config - a AmiConfig object.
public void saveCurrent()
throws Exception
Exception - if saving settings to disk fails.public AmiAgentConfig getAgentConfig(InetAddress agentInetAddress)
getAgentConfig
agentInetAddress - a InetAddress object.
AmiAgentConfig object.public static AmiConfig getAmiConfig()
getAmiConfig
AmiConfig object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||