public abstract class ThreshdConfigManager extends Object
Abstract ThreshdConfigManager class.
Modifier and Type | Field and Description |
---|---|
protected ThreshdConfiguration |
m_config
The config class loaded from the config file
|
protected String |
m_localServer
The name of the local OpenNMS server
|
protected boolean |
m_verifyServer
A boolean flag to indicate If a filter rule against the local OpenNMS
server has to be used.
|
Constructor and Description |
---|
ThreshdConfigManager(InputStream stream,
String localServer,
boolean verifyServer)
Constructor for ThreshdConfigManager.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createPackageIpListMap()
This method is used to establish package against an iplist iplist mapping,
with which, the iplist is selected per package via the configured filter
rules from the database.
|
protected void |
createUrlIpMap()
Go through the configuration and build a mapping of each configured URL
to a list of IPs configured in that URL - done at init() time so that
repeated file reads can be avoided
|
ThreshdConfiguration |
getConfiguration()
Return the threshd configuration object.
|
Package |
getPackage(String name)
getPackage
|
boolean |
interfaceInPackage(String iface,
Package pkg)
This method is used to determine if the named interface is included in
the passed package definition.
|
void |
rebuildPackageIpListMap()
This nethod is used to rebuild the package agaist iplist mapping when
needed.
|
abstract void |
reloadXML()
reloadXML
|
void |
saveCurrent()
Saves the current in-memory configuration to disk and reloads
|
protected abstract void |
saveXML(String xmlString)
saveXML
|
boolean |
serviceInPackageAndEnabled(String svcName,
Package pkg)
Returns true if the service is part of the package and the status of the
service is set to "on".
|
protected ThreshdConfiguration m_config
protected boolean m_verifyServer
protected String m_localServer
public ThreshdConfigManager(InputStream stream, String localServer, boolean verifyServer) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
Constructor for ThreshdConfigManager.
stream
- a InputStream
object.localServer
- a String
object.verifyServer
- a boolean.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.protected void createUrlIpMap()
protected void createPackageIpListMap()
public void rebuildPackageIpListMap()
public void saveCurrent() throws org.exolab.castor.xml.MarshalException, IOException, org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
- if any.IOException
- if any.org.exolab.castor.xml.ValidationException
- if any.public abstract void reloadXML() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
reloadXML
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.protected abstract void saveXML(String xmlString) throws IOException
saveXML
xmlString
- a String
object.IOException
- if any.public ThreshdConfiguration getConfiguration()
ThreshdConfiguration
object.public Package getPackage(String name)
getPackage
name
- a String
object.public boolean interfaceInPackage(String iface, Package pkg)
iface
- The interface to test against the package.pkg
- The package to check for the inclusion of the interface.public boolean serviceInPackageAndEnabled(String svcName, Package pkg)
svcName
- The service name to lookup.pkg
- The package to lookup up service.Copyright © 2017. All rights reserved.