public final class VulnscandConfigFactory extends Object
Modifier and Type | Method and Description |
---|---|
void |
addRange(int level,
InetAddress begin,
InetAddress end)
addRange
|
void |
addRange(ScanLevel level,
InetAddress begin,
InetAddress end)
addRange
|
void |
addSpecific(int level,
InetAddress specific)
addSpecific
|
void |
addSpecific(ScanLevel level,
InetAddress specific)
addSpecific
|
Set<Serializable> |
getAllExcludes()
getAllExcludes
|
Set<InetAddress> |
getAllIpAddresses(int level)
getAllIpAddresses
|
Set<InetAddress> |
getAllIpAddresses(ScanLevel level)
getAllIpAddresses
|
static VulnscandConfiguration |
getConfiguration()
Return the Vulnscand configuration object.
|
long |
getInitialSleepTime()
getInitialSleepTime
|
static VulnscandConfigFactory |
getInstance()
Return the singleton instance of this factory.
|
static int |
getInterfaceDbNodeId(Connection dbConn,
InetAddress ifAddress)
getInterfaceDbNodeId
|
int |
getManagedInterfacesScanLevel()
getManagedInterfacesScanLevel
|
boolean |
getManagedInterfacesStatus()
getManagedInterfacesStatus
|
int |
getMaxRescanThreadPoolSize()
getMaxRescanThreadPoolSize
|
int |
getMaxSuspectThreadPoolSize()
getMaxSuspectThreadPoolSize
|
String[] |
getPluginLists()
Gets the cached value of the plugin lists in the config file
|
long |
getRescanFrequency()
getRescanFrequency
|
boolean[] |
getSafeChecks()
Gets the cached value of the safe checks settings in the config file
|
InetAddress |
getServerAddress()
getServerAddress
|
String |
getServerPassword()
getServerPassword
|
int |
getServerPort()
getServerPort
|
String |
getServerUsername()
getServerUsername
|
boolean |
getStatus()
getStatus
|
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
static boolean |
isInterfaceInDB(Connection dbConn,
InetAddress ifAddress)
isInterfaceInDB
|
static void |
reload()
Reload the config from the default config file
|
void |
removeExcludeRange(InetAddress begin,
InetAddress end)
removeExcludeRange
|
void |
removeExcludeSpecific(InetAddress specific)
removeExcludeSpecific
|
void |
removeRange(int level,
InetAddress begin,
InetAddress end)
removeRange
|
void |
removeRange(ScanLevel level,
InetAddress begin,
InetAddress end)
removeRange
|
void |
removeSpecific(int level,
InetAddress specific)
removeSpecific
|
void |
removeSpecific(ScanLevel level,
InetAddress specific)
removeSpecific
|
static void |
saveCurrent()
Saves the current settings to disk
|
static InetAddress |
toInetAddress(long address)
Converts a 64-bit unsigned quantity to a IPv4 dotted decimal string
address.
|
static long |
toLong(InetAddress addr)
Deprecated.
See
org.opennms.core.utils.InetAddressCollection.toLong(InetAddress
addr)
|
public static void init() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- Thrown if the specified config file cannot be readorg.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.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static void reload() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- Thrown if the specified config file cannot be read/loadedorg.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.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static void saveCurrent() throws Exception
Exception
- if any.public static VulnscandConfigFactory getInstance()
IllegalStateException
- Thrown if the factory has not yet been initialized.public static VulnscandConfiguration getConfiguration()
VulnscandConfiguration
object.public static long toLong(InetAddress addr)
long
value. The address is converted in network byte order
(big endian). This is compatible 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 InetAddress toInetAddress(long address) throws UnknownHostException
Converts a 64-bit unsigned quantity to a IPv4 dotted decimal string address.
address
- The 64-bit quantity to convert.UnknownHostException
- if any.public static boolean isInterfaceInDB(Connection dbConn, InetAddress ifAddress) throws SQLException
isInterfaceInDB
dbConn
- a Connection
object.ifAddress
- a InetAddress
object.SQLException
- if any.public static int getInterfaceDbNodeId(Connection dbConn, InetAddress ifAddress) throws SQLException
getInterfaceDbNodeId
dbConn
- a Connection
object.ifAddress
- a InetAddress
object.SQLException
- if any.public void addSpecific(int level, InetAddress specific)
addSpecific
level
- a int.specific
- a InetAddress
object.public void addSpecific(ScanLevel level, InetAddress specific)
addSpecific
level
- a ScanLevel
object.specific
- a InetAddress
object.public void addRange(int level, InetAddress begin, InetAddress end)
addRange
level
- a int.begin
- a InetAddress
object.end
- a InetAddress
object.public void addRange(ScanLevel level, InetAddress begin, InetAddress end)
addRange
level
- a ScanLevel
object.begin
- a InetAddress
object.end
- a InetAddress
object.public void removeSpecific(int level, InetAddress specific)
removeSpecific
level
- a int.specific
- a InetAddress
object.public void removeSpecific(ScanLevel level, InetAddress specific)
removeSpecific
level
- a ScanLevel
object.specific
- a InetAddress
object.public void removeRange(int level, InetAddress begin, InetAddress end)
removeRange
level
- a int.begin
- a InetAddress
object.end
- a InetAddress
object.public void removeRange(ScanLevel level, InetAddress begin, InetAddress end)
removeRange
level
- a ScanLevel
object.begin
- a InetAddress
object.end
- a InetAddress
object.public Set<InetAddress> getAllIpAddresses(int level)
getAllIpAddresses
level
- a int.Set
object.public Set<InetAddress> getAllIpAddresses(ScanLevel level)
getAllIpAddresses
public Set<Serializable> getAllExcludes()
getAllExcludes
Set
object.public void removeExcludeRange(InetAddress begin, InetAddress end)
removeExcludeRange
begin
- a InetAddress
object.end
- a InetAddress
object.public void removeExcludeSpecific(InetAddress specific)
removeExcludeSpecific
specific
- a InetAddress
object.public long getRescanFrequency()
getRescanFrequency
public long getInitialSleepTime()
getInitialSleepTime
public InetAddress getServerAddress()
getServerAddress
InetAddress
object.public String[] getPluginLists()
String
objects.public boolean[] getSafeChecks()
public int getServerPort()
getServerPort
public boolean getStatus()
getStatus
public boolean getManagedInterfacesStatus()
getManagedInterfacesStatus
public int getManagedInterfacesScanLevel()
getManagedInterfacesScanLevel
public int getMaxSuspectThreadPoolSize()
getMaxSuspectThreadPoolSize
public int getMaxRescanThreadPoolSize()
getMaxRescanThreadPoolSize
Copyright © 2015. All Rights Reserved.