public class CollectdConfigFactory extends Object implements CollectdConfigFactory
Modifier and Type | Field and Description |
---|---|
static String |
SELECT_METHOD_MIN |
Constructor and Description |
---|
CollectdConfigFactory() |
CollectdConfigFactory(InputStream stream)
For testing purposes only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
domainExists(String name)
Returns true if collection domain exists
|
CollectdConfiguration |
getCollectdConfig()
getCollectdConfig
|
Package |
getPackage(String name)
getPackage
|
boolean |
interfaceInFilter(String iface,
Package pkg) |
boolean |
interfaceInPackage(OnmsIpInterface iface,
Package pkg)
This method is used to determine if the named interface is included in
the passed package definition.
|
boolean |
interfaceInPackage(String iface,
Package pkg)
Deprecated.
This function should take normal model objects instead of bare IP
addresses. Move this implementation into
interfaceInPackage(OnmsIpInterface, Package) . |
boolean |
isServiceCollectionEnabled(OnmsIpInterface iface,
String svcName)
Returns true if the specified interface is included by at least one
package which has the specified service and that service is enabled (set
to "on").
|
boolean |
isServiceCollectionEnabled(OnmsMonitoredService service)
Returns true if the specified service's interface is included by at least one
package which has the specified service and that service is enabled (set
to "on").
|
boolean |
isServiceCollectionEnabled(String ipAddr,
String svcName)
Deprecated.
This function should take normal model objects instead of bare IP addresses
and service names. Use
isServiceCollectionEnabled(OnmsIpInterface, String)
instead. |
boolean |
packageExists(String name)
Returns true if collection package exists
|
void |
reload()
Reload the config from the default config file
|
void |
saveCurrent()
Saves the current in-memory configuration to disk and reloads
|
public static final String SELECT_METHOD_MIN
public CollectdConfigFactory() throws IOException
IOException
public CollectdConfigFactory(InputStream stream) throws IOException
stream
- IOException
public void reload() throws IOException
reload
in interface CollectdConfigFactory
IOException
- Thrown if the specified config file cannot be read/loadedIOException
- if any.public void saveCurrent() throws IOException
saveCurrent
in interface CollectdConfigFactory
IOException
- if any.public CollectdConfiguration getCollectdConfig()
getCollectdConfig
getCollectdConfig
in interface CollectdConfigFactory
CollectdConfiguration
object.public boolean packageExists(String name)
packageExists
in interface CollectdConfigFactory
name
- The package name to checkpublic Package getPackage(String name)
getPackage
getPackage
in interface CollectdConfigFactory
name
- a String
object.Package
object.public boolean domainExists(String name)
domainExists
in interface CollectdConfigFactory
name
- The domain name to checkpublic boolean isServiceCollectionEnabled(OnmsMonitoredService service)
isServiceCollectionEnabled
in interface CollectdConfigFactory
service
- OnmsMonitoredService
to checkpublic boolean isServiceCollectionEnabled(OnmsIpInterface iface, String svcName)
isServiceCollectionEnabled
in interface CollectdConfigFactory
iface
- OnmsIpInterface
to lookupsvcName
- The service name to lookuppublic boolean isServiceCollectionEnabled(String ipAddr, String svcName)
isServiceCollectionEnabled(OnmsIpInterface, String)
instead.isServiceCollectionEnabled
in interface CollectdConfigFactory
ipAddr
- IP address of the interface to lookupsvcName
- The service name to lookuppublic boolean interfaceInFilter(String iface, Package pkg)
interfaceInFilter
in interface CollectdConfigFactory
public boolean interfaceInPackage(String iface, Package pkg)
interfaceInPackage(OnmsIpInterface, Package)
.interfaceInPackage
in interface CollectdConfigFactory
iface
- The interface to test against the package.public boolean interfaceInPackage(OnmsIpInterface iface, Package pkg)
interfaceInPackage
in interface CollectdConfigFactory
iface
- The interface to test against the package.Copyright © 2021. All rights reserved.