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

Abstract CapsdConfigManager class.

Version:
$Id: $
Author:
ranger

Field Summary
 
Fields inherited from interface org.opennms.netmgt.config.CapsdConfig
LAME_SNMP_HOST_IFINDEX
 
Constructor Summary
CapsdConfigManager()
          Constructor for CapsdConfigManager.
CapsdConfigManager(InputStream is)
          Constructor for CapsdConfigManager.
CapsdConfigManager(Reader rdr)
          Constructor for CapsdConfigManager.
 
Method Summary
 void addProtocolPlugin(ProtocolPlugin plugin)
          addProtocolPlugin
 InetAddress determinePrimarySnmpInterface(List<InetAddress> addressList, boolean strict)
          determinePrimarySnmpInterface
 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()
          getDeletePropagationEnabled
 long getInitialSleepTime()
          getInitialSleepTime
 int getMaxRescanThreadPoolSize()
          getMaxRescanThreadPoolSize
 int getMaxSuspectThreadPoolSize()
          getMaxSuspectThreadPoolSize
 List<Property> getPluginProperties(ProtocolPlugin plugin)
          getPluginProperties
 List<Property> getProtocolConfigurationProperties(ProtocolConfiguration pluginConf)
          getProtocolConfigurationProperties
 List<ProtocolConfiguration> getProtocolConfigurations(ProtocolPlugin plugin)
          getProtocolConfigurations
 ProtocolPlugin getProtocolPlugin(String svcName)
          getProtocolPlugin
 List<ProtocolPlugin> getProtocolPlugins()
          getProtocolPlugins
 List<Range> getRanges(ProtocolConfiguration pluginConf)
          getRanges
 long getRescanFrequency()
          getRescanFrequency
 SmbAuth getSmbAuth(String target)
          Finds the SMB authentication object using the netbios name.
 List<String> getSpecifics(ProtocolConfiguration pluginConf)
          getSpecifics
 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()
          isXmlRpcEnabled
protected  void loadXml(InputStream is)
          loadXml
protected  void loadXml(Reader rdr)
          loadXml
 void save()
          Saves the current in-memory configuration to disk and reloads
protected abstract  void saveXml(String xml)
          saveXml
protected abstract  void update()
          update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapsdConfigManager

public CapsdConfigManager()

Constructor for CapsdConfigManager.


CapsdConfigManager

public CapsdConfigManager(Reader rdr)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException

Constructor for CapsdConfigManager.

Parameters:
rdr - a Reader object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

CapsdConfigManager

public CapsdConfigManager(InputStream is)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException

Constructor for CapsdConfigManager.

Parameters:
is - a InputStream object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
Method Detail

saveXml

protected abstract void saveXml(String xml)
                         throws IOException

saveXml

Parameters:
xml - a String object.
Throws:
IOException - if any.

update

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

update

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

loadXml

protected void loadXml(InputStream is)
                throws org.exolab.castor.xml.MarshalException,
                       org.exolab.castor.xml.ValidationException

loadXml

Parameters:
is - a InputStream object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

loadXml

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

loadXml

Parameters:
rdr - a Reader object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

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 - if any.
IOException - if any.
org.exolab.castor.xml.ValidationException - if any.

getConfiguration

public CapsdConfiguration getConfiguration()
Return the Capsd configuration object.

Specified by:
getConfiguration in interface CapsdConfig
Returns:
a CapsdConfiguration object.

getProtocolPlugin

public ProtocolPlugin getProtocolPlugin(String svcName)

getProtocolPlugin

Specified by:
getProtocolPlugin in interface CapsdConfig
Parameters:
svcName - a String object.
Returns:
a ProtocolPlugin object.

addProtocolPlugin

public void addProtocolPlugin(ProtocolPlugin plugin)

addProtocolPlugin

Specified by:
addProtocolPlugin in interface CapsdConfig
Parameters:
plugin - a ProtocolPlugin object.

getSmbAuth

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

Specified by:
getSmbAuth in interface CapsdConfig
Parameters:
target - a String object.
Returns:
a SmbAuth object.

isAddressUnmanaged

public boolean isAddressUnmanaged(InetAddress target)
Checks the configuration to determine if the target is managed or unmanaged. 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.
Returns:
a boolean.

getRescanFrequency

public long getRescanFrequency()

getRescanFrequency

Specified by:
getRescanFrequency in interface CapsdConfig
Returns:
a long.

getInitialSleepTime

public long getInitialSleepTime()

getInitialSleepTime

Specified by:
getInitialSleepTime in interface CapsdConfig
Returns:
a long.

getMaxSuspectThreadPoolSize

public int getMaxSuspectThreadPoolSize()

getMaxSuspectThreadPoolSize

Specified by:
getMaxSuspectThreadPoolSize in interface CapsdConfig
Returns:
a int.

getMaxRescanThreadPoolSize

public int getMaxRescanThreadPoolSize()

getMaxRescanThreadPoolSize

Specified by:
getMaxRescanThreadPoolSize in interface CapsdConfig
Returns:
a int.

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
Returns:
a boolean.

getDeletePropagationEnabled

public boolean getDeletePropagationEnabled()

getDeletePropagationEnabled

Specified by:
getDeletePropagationEnabled in interface CapsdConfig
Returns:
a boolean.

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()

isXmlRpcEnabled

Specified by:
isXmlRpcEnabled in interface CapsdConfig
Returns:
a boolean.

determinePrimarySnmpInterface

public InetAddress determinePrimarySnmpInterface(List<InetAddress> addressList,
                                                 boolean strict)

determinePrimarySnmpInterface

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 - a List object.
strict - a boolean.
Returns:
a InetAddress object.

getConfiguredProtocols

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

Specified by:
getConfiguredProtocols in interface CapsdConfig
Returns:
a List object.

getProtocolPlugins

public List<ProtocolPlugin> getProtocolPlugins()

getProtocolPlugins

Specified by:
getProtocolPlugins in interface CapsdConfig
Returns:
a List object.

getProtocolConfigurations

public List<ProtocolConfiguration> getProtocolConfigurations(ProtocolPlugin plugin)

getProtocolConfigurations

Specified by:
getProtocolConfigurations in interface CapsdConfig
Parameters:
plugin - a ProtocolPlugin object.
Returns:
a List object.

getPluginProperties

public List<Property> getPluginProperties(ProtocolPlugin plugin)

getPluginProperties

Specified by:
getPluginProperties in interface CapsdConfig
Parameters:
plugin - a ProtocolPlugin object.
Returns:
a List object.

getProtocolConfigurationProperties

public List<Property> getProtocolConfigurationProperties(ProtocolConfiguration pluginConf)

getProtocolConfigurationProperties

Specified by:
getProtocolConfigurationProperties in interface CapsdConfig
Parameters:
pluginConf - a ProtocolConfiguration object.
Returns:
a List object.

getRanges

public List<Range> getRanges(ProtocolConfiguration pluginConf)

getRanges

Specified by:
getRanges in interface CapsdConfig
Parameters:
pluginConf - a ProtocolConfiguration object.
Returns:
a List object.

getSpecifics

public List<String> getSpecifics(ProtocolConfiguration pluginConf)

getSpecifics

Specified by:
getSpecifics in interface CapsdConfig
Parameters:
pluginConf - a ProtocolConfiguration object.
Returns:
a List object.


Copyright © 2011. All Rights Reserved.