|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.VulnscandConfigFactory
public final class VulnscandConfigFactory
This is the singleton class used to load the configuration for the OpenNMS Vulnscand service from the vulnscand-configuration xml file. 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.
| Method Summary | |
|---|---|
void |
addRange(int level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
addRange(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
addSpecific(int level,
java.net.InetAddress specific)
|
void |
addSpecific(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress specific)
|
java.util.Set |
getAllExcludes()
|
java.util.Set |
getAllIpAddresses(int level)
|
java.util.Set |
getAllIpAddresses(org.opennms.netmgt.config.vulnscand.ScanLevel level)
|
static org.opennms.netmgt.config.vulnscand.VulnscandConfiguration |
getConfiguration()
Return the Vulnscand configuration object. |
long |
getInitialSleepTime()
|
static VulnscandConfigFactory |
getInstance()
Return the singleton instance of this factory. |
static int |
getInterfaceDbNodeId(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
|
int |
getManagedInterfacesScanLevel()
|
boolean |
getManagedInterfacesStatus()
|
int |
getMaxRescanThreadPoolSize()
|
int |
getMaxSuspectThreadPoolSize()
|
java.lang.String[] |
getPluginLists()
Gets the cached value of the plugin lists in the config file |
long |
getRescanFrequency()
|
boolean[] |
getSafeChecks()
Gets the cached value of the safe checks settings in the config file |
java.net.InetAddress |
getServerAddress()
|
java.lang.String |
getServerPassword()
|
int |
getServerPort()
|
java.lang.String |
getServerUsername()
|
boolean |
getStatus()
|
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static boolean |
isInterfaceInDB(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
|
static void |
reload()
Reload the config from the default config file |
void |
removeExcludeRange(java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
removeExcludeSpecific(java.net.InetAddress specific)
|
void |
removeRange(int level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
removeRange(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
removeSpecific(int level,
java.net.InetAddress specific)
|
void |
removeSpecific(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress specific)
|
static void |
saveCurrent()
Saves the current settings to disk |
static java.net.InetAddress |
toInetAddress(long address)
Converts a 64-bit unsigned quantity to a IPv4 dotted decimal string address. |
static long |
toLong(java.net.InetAddress addr)
Deprecated. See org.opennms.core.utils.InetAddressCollection.toLong(InetAddress addr) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void init()
throws java.io.IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
java.io.IOException - Thrown if the specified config file cannot be read
org.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.
public static void reload()
throws java.io.IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
java.io.IOException - Thrown if the specified config file cannot be read/loaded
org.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.
public static void saveCurrent()
throws java.lang.Exception
java.lang.Exceptionpublic static VulnscandConfigFactory getInstance()
java.lang.IllegalStateException - Thrown if the factory has not yet been initialized.public static org.opennms.netmgt.config.vulnscand.VulnscandConfiguration getConfiguration()
public static long toLong(java.net.InetAddress addr)
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.
addr - The IP address to convert.
public static java.net.InetAddress toInetAddress(long address)
throws java.net.UnknownHostException
Converts a 64-bit unsigned quantity to a IPv4 dotted decimal string address.
address - The 64-bit quantity to convert.
java.net.UnknownHostException
public static boolean isInterfaceInDB(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
throws java.sql.SQLException
java.sql.SQLException
public static int getInterfaceDbNodeId(java.sql.Connection dbConn,
java.net.InetAddress ifAddress)
throws java.sql.SQLException
java.sql.SQLException
public void addSpecific(int level,
java.net.InetAddress specific)
public void addSpecific(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress specific)
public void addRange(int level,
java.net.InetAddress begin,
java.net.InetAddress end)
public void addRange(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
public void removeSpecific(int level,
java.net.InetAddress specific)
public void removeSpecific(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress specific)
public void removeRange(int level,
java.net.InetAddress begin,
java.net.InetAddress end)
public void removeRange(org.opennms.netmgt.config.vulnscand.ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
public java.util.Set getAllIpAddresses(int level)
public java.util.Set getAllIpAddresses(org.opennms.netmgt.config.vulnscand.ScanLevel level)
public java.util.Set getAllExcludes()
public void removeExcludeRange(java.net.InetAddress begin,
java.net.InetAddress end)
public void removeExcludeSpecific(java.net.InetAddress specific)
public long getRescanFrequency()
public long getInitialSleepTime()
public java.net.InetAddress getServerAddress()
public java.lang.String[] getPluginLists()
public boolean[] getSafeChecks()
public int getServerPort()
public java.lang.String getServerUsername()
public java.lang.String getServerPassword()
public boolean getStatus()
public boolean getManagedInterfacesStatus()
public int getManagedInterfacesScanLevel()
public int getMaxSuspectThreadPoolSize()
public int getMaxRescanThreadPoolSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||