public class WmiPeerFactory extends AbstractWritableCastorConfigDao<WmiConfig,WmiConfig>
WmiAgentConfig 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.AbstractCastorConfigDao.CastorReloadCallback| Constructor and Description |
|---|
WmiPeerFactory() |
WmiPeerFactory(org.springframework.core.io.Resource resource)
Create a PollOutagesConfigFactory using the specified Spring resource.
|
| Modifier and Type | Method and Description |
|---|---|
WmiAgentConfig |
getAgentConfig(InetAddress agentInetAddress)
getAgentConfig
|
WmiConfig |
getConfig() |
static WmiPeerFactory |
getInstance()
Return the singleton instance of this factory.
|
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
void |
optimize()
Combine specific and range elements so that WMIPeerFactory has to spend
less time iterating all these elements.
|
static void |
reload()
Reload the config from the default config file
|
static void |
setInstance(WmiPeerFactory instance)
setInstance
|
WmiConfig |
translateConfig(WmiConfig config)
translateConfig
|
getObject, getReadLock, getWriteLock, saveCurrent, updateafterPropertiesSet, createLoadedLogMessage, getConfigResource, getContainer, getDescription, getReloadCheckInterval, loadConfig, setConfigResource, setReloadCheckIntervalpublic WmiPeerFactory()
public WmiPeerFactory(org.springframework.core.io.Resource resource)
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 readorg.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/loadedorg.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 WmiPeerFactory getInstance()
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(WmiPeerFactory instance)
setInstance
instance - a PollOutagesConfigFactory
object.public WmiConfig translateConfig(WmiConfig config)
AbstractCastorConfigDaotranslateConfig
translateConfig in class AbstractCastorConfigDao<WmiConfig,WmiConfig>config - a K object.public WmiConfig getConfig()
public void optimize()
throws UnknownHostException
UnknownHostExceptionpublic WmiAgentConfig getAgentConfig(InetAddress agentInetAddress)
getAgentConfig
agentInetAddress - a InetAddress object.org.opennms.protocols.wmi.WmiAgentConfig object.Copyright © 2017. All rights reserved.