|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.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.
Field Summary | |
private static char |
COMMENT_CHAR
This character at the start of a line indicates a comment line in a URL file |
private static java.lang.String |
COMMENT_STR
The string indicating the start of the comments in a line containing the IP address in a file URL |
private static VulnscandConfiguration |
m_config
The config class loaded from the config file |
private static java.util.Set |
m_excludes
Cached set of the excluded IP addresses |
private static boolean |
m_loaded
This member is set to true if the configuration file has been loaded. |
private static java.lang.String[] |
m_pluginLists
Cached value of the plugin lists for each scan level |
private static boolean[] |
m_safeChecks
Cached value of the "safe checks" values for each scan level |
private static VulnscandConfigFactory |
m_singleton
The singleton instance of this factory |
private static org.apache.regexp.RE |
m_space
Whitespace regex |
private static java.lang.String |
RETRIEVE_IPADDR_NODEID_SQL
The SQL statement used to determine if an IP address is already in the ipInterface table and if so what its parent nodeid is. |
private static java.lang.String |
RETRIEVE_IPADDR_SQL
The SQL statement used to determine if an IP address is already in the ipInterface table and there is known. |
Constructor Summary | |
private |
VulnscandConfigFactory(java.lang.String configFile)
Constructs a new VulnscandConfigFactory object for access to the Vulnscand configuration information. |
Method Summary | |
void |
addRange(int level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
addRange(ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
addSpecific(int level,
java.net.InetAddress specific)
|
void |
addSpecific(ScanLevel level,
java.net.InetAddress specific)
|
java.util.Set |
getAllExcludes()
|
java.util.Set |
getAllIpAddresses(int level)
|
java.util.Set |
getAllIpAddresses(ScanLevel level)
|
static 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 |
private static ScanLevel |
getScanLevel(int level)
|
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(ScanLevel level,
java.net.InetAddress begin,
java.net.InetAddress end)
|
void |
removeSpecific(int level,
java.net.InetAddress specific)
|
void |
removeSpecific(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 |
Field Detail |
private static final java.lang.String COMMENT_STR
private static final char COMMENT_CHAR
private static boolean m_loaded
private static VulnscandConfigFactory m_singleton
private static VulnscandConfiguration m_config
private static java.lang.String[] m_pluginLists
private static boolean[] m_safeChecks
private static java.util.Set m_excludes
private static org.apache.regexp.RE m_space
private static final java.lang.String RETRIEVE_IPADDR_SQL
private static final java.lang.String RETRIEVE_IPADDR_NODEID_SQL
Constructor Detail |
private VulnscandConfigFactory(java.lang.String configFile) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
configFile
- The configuration file to load.
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.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.Exception
public static VulnscandConfigFactory getInstance()
java.lang.IllegalStateException
- Thrown if the factory has not yet been initialized.public static 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
private static ScanLevel getScanLevel(int level)
public void addSpecific(int level, java.net.InetAddress specific)
public void addSpecific(ScanLevel level, java.net.InetAddress specific)
public void addRange(int level, java.net.InetAddress begin, java.net.InetAddress end)
public void addRange(ScanLevel level, java.net.InetAddress begin, java.net.InetAddress end)
public void removeSpecific(int level, java.net.InetAddress specific)
public void removeSpecific(ScanLevel level, java.net.InetAddress specific)
public void removeRange(int level, java.net.InetAddress begin, java.net.InetAddress end)
public void removeRange(ScanLevel level, java.net.InetAddress begin, java.net.InetAddress end)
public java.util.Set getAllIpAddresses(int level)
public java.util.Set getAllIpAddresses(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()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |