|
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.vulnscand.Scheduler
This class implements a simple scheduler to ensure that Vulnscand rescans occurs at the expected intervals.
Field Summary | |
private static java.lang.String |
FIBER_NAME
The prefix for the fiber name. |
private long |
m_initialSleep
The configured initial sleep (in milliseconds) prior to scheduling rescans |
private long |
m_interval
The configured interval (in milliseconds) between rescans |
private java.util.List |
m_knownAddresses
List of NessusScanConfiguration objects representing the IP addresses that will be scheduled. |
private java.lang.String |
m_name
The name of this fiber. |
private FifoQueue |
m_scheduledScanQ
The rescan queue where new NessusScan objects are enqueued for execution. |
private int |
m_status
The status for this fiber. |
private java.lang.Thread |
m_worker
The worker thread that executes this instance. |
private static java.lang.String |
SQL_DB_RETRIEVE_IP_INTERFACE
The SQL statement used to retrieve all non-deleted/non-forced unamanaged IP interfaces from the 'ipInterface' table. |
private static java.lang.String |
SQL_GET_LAST_POLL_TIME
SQL used to retrieve the last poll time for all the managed interfaces belonging to a particular node. |
Fields inherited from interface org.opennms.core.fiber.PausableFiber |
PAUSE_PENDING, PAUSED, RESUME_PENDING |
Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
Constructor Summary | |
(package private) |
Scheduler(FifoQueue rescanQ)
Constructs a new instance of the scheduler. |
Method Summary | |
(package private) void |
addToKnownAddresses(java.net.InetAddress address,
int scanLevel)
Creates a NessusScanConfiguration object representing the specified node and adds it to the known node list for scheduling. |
private java.util.Set |
getAllManagedInterfaces()
|
java.lang.String |
getName()
Returns the name of this fiber. |
int |
getStatus()
Returns the current of this fiber. |
void |
pause()
Pauses the scheduler if it is current running. |
void |
resume()
Resumes the scheduler if it has been paused. |
void |
run()
The main method of the scheduler. |
void |
start()
Starts the fiber. |
void |
stop()
Stops the fiber. |
(package private) void |
unscheduleAddress(java.net.InetAddress address)
Removes the specified node from the known node list. |
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 FIBER_NAME
private static final java.lang.String SQL_DB_RETRIEVE_IP_INTERFACE
private static final java.lang.String SQL_GET_LAST_POLL_TIME
private java.lang.String m_name
private int m_status
private java.lang.Thread m_worker
private java.util.List m_knownAddresses
private long m_interval
private long m_initialSleep
private FifoQueue m_scheduledScanQ
Constructor Detail |
Scheduler(FifoQueue rescanQ) throws java.sql.SQLException
Method Detail |
private java.util.Set getAllManagedInterfaces()
void addToKnownAddresses(java.net.InetAddress address, int scanLevel) throws java.sql.SQLException
address
- the internet address.scanLevel
- the scan level.
java.sql.SQLException
- if there is any problem accessing the databasevoid unscheduleAddress(java.net.InetAddress address)
address
- Address of interface to be removed.public void start()
start
in interface Fiber
java.lang.IllegalStateException
- Thrown if the fiber is already running.public void stop()
stop
in interface Fiber
java.lang.IllegalStateException
- Throws if the fiber has never been started.public void pause()
pause
in interface PausableFiber
java.lang.IllegalStateException
- Throws if the operation could not be completed due to the
fiber's state.public void resume()
resume
in interface PausableFiber
java.lang.IllegalStateException
- Throws if the operation could not be completed due to the
fiber's state.public int getStatus()
getStatus
in interface Fiber
public java.lang.String getName()
getName
in interface Fiber
Fiber
.public void run()
run
in interface java.lang.Runnable
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |