org.opennms.netmgt.config
Class CapsdConfigManager

java.lang.Object
  extended by org.opennms.netmgt.config.CapsdConfigManager
All Implemented Interfaces:
CapsdConfig
Direct Known Subclasses:
DefaultCapsdConfigManager

public abstract class CapsdConfigManager
extends Object
implements CapsdConfig


Field Summary
 
Fields inherited from interface org.opennms.netmgt.config.CapsdConfig
LAME_SNMP_HOST_IFINDEX
 
Constructor Summary
CapsdConfigManager()
           
CapsdConfigManager(Reader rdr)
           
 
Method Summary
 void addProtocolPlugin(ProtocolPlugin plugin)
           
 InetAddress determinePrimarySnmpInterface(List<InetAddress> addressList, boolean strict)
          This method is responsbile for determining the node's primary SNMP interface from the specified list of InetAddress objects.
 boolean getAbortProtocolScansFlag()
          Defines Capsd's behavior when, during a protocol scan, it gets a java.net.NoRouteToHostException exception.
 CapsdConfiguration getConfiguration()
          Return the Capsd configuration object.
 List<String> getConfiguredProtocols()
          Return a list of configured protocols from the loaded configuration.
 boolean getDeletePropagationEnabled()
           
 long getInitialSleepTime()
           
 int getMaxRescanThreadPoolSize()
           
 int getMaxSuspectThreadPoolSize()
           
 List<Property> getPluginProperties(ProtocolPlugin plugin)
           
 List<Property> getProtocolConfigurationProperties(ProtocolConfiguration pluginConf)
           
 List<ProtocolConfiguration> getProtocolConfigurations(ProtocolPlugin plugin)
           
 ProtocolPlugin getProtocolPlugin(String svcName)
           
 List<ProtocolPlugin> getProtocolPlugins()
           
 List<Range> getRanges(ProtocolConfiguration pluginConf)
           
 long getRescanFrequency()
           
 SmbAuth getSmbAuth(String target)
          Finds the SMB authentication object using the netbios name.
 List<String> getSpecifics(ProtocolConfiguration pluginConf)
           
 String getXmlrpc()
          Return the boolean xmlrpc as string to indicate if notification to external xmlrpc server is needed.
 boolean isAddressUnmanaged(InetAddress target)
          Checks the configuration to determine if the target is managed or unmanaged.
 boolean isXmlRpcEnabled()
           
protected  void loadXml(Reader rdr)
           
 void save()
          Saves the current in-memory configuration to disk and reloads
protected abstract  void saveXml(String xml)
           
 long toLong(InetAddress addr)
          Deprecated. Use org.opennms.netmgt.utils.IPSorter.convertToLong() instead.
protected abstract  void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapsdConfigManager

public CapsdConfigManager()

CapsdConfigManager

public CapsdConfigManager(Reader rdr)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
Method Detail

saveXml

protected abstract void saveXml(String xml)
                         throws IOException
Throws:
IOException

update

protected abstract void update()
                        throws IOException,
                               FileNotFoundException,
                               org.exolab.castor.xml.MarshalException,
                               org.exolab.castor.xml.ValidationException
Throws:
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

loadXml

protected void loadXml(Reader rdr)
                throws org.exolab.castor.xml.MarshalException,
                       org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

save

public void save()
          throws org.exolab.castor.xml.MarshalException,
                 IOException,
                 org.exolab.castor.xml.ValidationException
Saves the current in-memory configuration to disk and reloads

Specified by:
save in interface CapsdConfig
Throws:
org.exolab.castor.xml.MarshalException
IOException
org.exolab.castor.xml.ValidationException

getConfiguration

public CapsdConfiguration getConfiguration()
Return the Capsd configuration object.

Specified by:
getConfiguration in interface CapsdConfig

getProtocolPlugin

public ProtocolPlugin getProtocolPlugin(String svcName)
Specified by:
getProtocolPlugin in interface CapsdConfig

addProtocolPlugin

public void addProtocolPlugin(ProtocolPlugin plugin)
Specified by:
addProtocolPlugin in interface CapsdConfig

getSmbAuth

public SmbAuth getSmbAuth(String target)
Finds the SMB authentication object using the netbios name. The target of the search.

Specified by:
getSmbAuth in interface CapsdConfig

isAddressUnmanaged

public boolean isAddressUnmanaged(InetAddress target)
Checks the configuration to determine if the target is managed or unmanaged.

Specified by:
isAddressUnmanaged in interface CapsdConfig
Parameters:
target - The target to check against.

getRescanFrequency

public long getRescanFrequency()
Specified by:
getRescanFrequency in interface CapsdConfig

getInitialSleepTime

public long getInitialSleepTime()
Specified by:
getInitialSleepTime in interface CapsdConfig

getMaxSuspectThreadPoolSize

public int getMaxSuspectThreadPoolSize()
Specified by:
getMaxSuspectThreadPoolSize in interface CapsdConfig

getMaxRescanThreadPoolSize

public int getMaxRescanThreadPoolSize()
Specified by:
getMaxRescanThreadPoolSize in interface CapsdConfig

getAbortProtocolScansFlag

public boolean getAbortProtocolScansFlag()
Defines Capsd's behavior when, during a protocol scan, it gets a java.net.NoRouteToHostException exception. If abort rescan property is set to "true" then Capsd will not perform any additional protocol scans.

Specified by:
getAbortProtocolScansFlag in interface CapsdConfig

getDeletePropagationEnabled

public boolean getDeletePropagationEnabled()
Specified by:
getDeletePropagationEnabled in interface CapsdConfig

getXmlrpc

public String getXmlrpc()
Return the boolean xmlrpc as string to indicate if notification to external xmlrpc server is needed.

Specified by:
getXmlrpc in interface CapsdConfig
Returns:
boolean flag as a string value

isXmlRpcEnabled

public boolean isXmlRpcEnabled()
Specified by:
isXmlRpcEnabled in interface CapsdConfig

determinePrimarySnmpInterface

public InetAddress determinePrimarySnmpInterface(List<InetAddress> addressList,
                                                 boolean strict)
This method is responsbile for determining the node's primary SNMP interface from the specified list of InetAddress objects.

Specified by:
determinePrimarySnmpInterface in interface CapsdConfig
Parameters:
addressList - List of InetAddress objects representing all the interfaces belonging to a particular node which support the "SNMP" service and have a valid ifIndex.
strict - Boolean variable which requires an interface to be part of a Collectd package to be eligible as a primary SNMP interface
Returns:
InetAddress object of the primary SNMP interface or null if none of the node's interfaces are eligible.

toLong

public long toLong(InetAddress addr)
Deprecated. Use org.opennms.netmgt.utils.IPSorter.convertToLong() instead.

This method is used to convert the passed IP address to a long value. The address is converted in network byte order (big endin). This is compatable with the number format of the JVM, and thus the return longs can be compared with other converted IP Addresses to determine inclusion.

Specified by:
toLong in interface CapsdConfig
Parameters:
addr - The IP address to convert.
Returns:
The converted IP address.

getConfiguredProtocols

public List<String> getConfiguredProtocols()
Return a list of configured protocols from the loaded configuration.

Specified by:
getConfiguredProtocols in interface CapsdConfig

getProtocolPlugins

public List<ProtocolPlugin> getProtocolPlugins()
Specified by:
getProtocolPlugins in interface CapsdConfig

getProtocolConfigurations

public List<ProtocolConfiguration> getProtocolConfigurations(ProtocolPlugin plugin)
Specified by:
getProtocolConfigurations in interface CapsdConfig

getPluginProperties

public List<Property> getPluginProperties(ProtocolPlugin plugin)
Specified by:
getPluginProperties in interface CapsdConfig

getProtocolConfigurationProperties

public List<Property> getProtocolConfigurationProperties(ProtocolConfiguration pluginConf)
Specified by:
getProtocolConfigurationProperties in interface CapsdConfig

getRanges

public List<Range> getRanges(ProtocolConfiguration pluginConf)
Specified by:
getRanges in interface CapsdConfig

getSpecifics

public List<String> getSpecifics(ProtocolConfiguration pluginConf)
Specified by:
getSpecifics in interface CapsdConfig


Copyright © 2009. All Rights Reserved.