|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.common.components.PollerThread | +--org.opennms.bb.dp.discovery.Discovery
The main class for discovery
Field Summary | |
private DiscCapsdReceiver |
m_discCapsdReceiver
The thread that recieves the confirmation from capsd that a node has been added to the database - once this confirmation is got, the node is acknowledged as 'known'. |
private IPGenerator |
m_ipGenerator
The IP Generator object is used to create IP addresses and add those addresses to the passed queue. |
private long |
m_lNumThreads
The calcualted number of threads that maximize the use of the packets per second limitiation. |
private long |
m_lPktsPerSec
The calculated number of packets per second that discovery can send when querying the network. |
private int |
m_maxNumMonitorThreads
The maximum number of threads in the monitor thread pool which will be processing incoming ICMP poll requests from the ICMP service monitor. |
private PCQueue |
m_monitorRequestQ
The producer/cosumer queue that is the sink for the MonitorRequestReceiver and the source for the numerous monitor ping threads. |
private MonitorRequestReceiver |
m_monitorRequestReceiver
The MonitorRequestReceiver object listens for ICMP poll requests from the ICMP service monitor and adds those requests to the passed queue. |
private DiscPingManager |
m_pingManager
The discovery thread manager. |
private PCQueue |
m_pingRequestQ
The producer/cosumer queue that is the sink for the IPGenerator and the source for the numerous discovery ping threads. |
private static Properties |
m_properties
The properties that are specific to the discovery process. |
private String |
PROP_MAX_MONITOR_POLL_THREADS
The property name used to get max number of monitor pinger threads to use to service ICMP poll requests. |
Fields inherited from class org.opennms.bb.dp.common.components.PollerThread |
m_curOpStatus, STATUS_MASK, STATUS_NORMAL, STATUS_PAUSED, STATUS_PAUSING, STATUS_RESUMING, STATUS_SHUTDOWN, STATUS_STARTING, STATUS_TERMINATING |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
Discovery()
Instantiates the discovery process |
Method Summary | |
(package private) static void |
Copy the System properties and then load the bluebird and discovery specific files into the property object. |
private void |
computeNetParameters(float fNetPercent,
long lTimeout,
int iRetries)
This method is used by the discovery constructor to determine what the maximum number of packets per second should be and the number of icmp sending threads. |
static Properties |
getProperties()
Returns the discovery specific properties. |
static String |
getProperty(String key)
Returns the property identified by 'key' from the discovery specific properties. |
private Set |
loadDatabaseNodes()
This method is used by the class constructor to load the currently known IP Addresses from the database into the discovery VM. |
static void |
main(String[] args)
Start the discovery process |
void |
run()
Waits for control messages and takes appropriate action |
void |
shutdown()
Initiates the shutdown of the thread's run method in accordance with the base class' specification. |
void |
start()
Start all the threads |
Methods inherited from class org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdownThread |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, stop, stop, stop0, suspend, suspend0, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private long m_lPktsPerSec
The calculated number of packets per second that discovery can send when querying the network. Discovery should never send more than this number of packets in one second. This does not restrict the size of the packets, but for discovery all the packets should roughly be the same size.
private long m_lNumThreads
The calcualted number of threads that maximize the use of the packets per second limitiation. This is the number of threads that are sending ICMP request.
private IPGenerator m_ipGenerator
The IP Generator object is used to create IP addresses and add those addresses to the passed queue. The generator is a cyclic object that uses its own thread to generate the addresses.
private MonitorRequestReceiver m_monitorRequestReceiver
The MonitorRequestReceiver object listens for ICMP poll requests from the ICMP service monitor and adds those requests to the passed queue.
private DiscPingManager m_pingManager
The discovery thread manager. The manager is responsible for controlling numerous threads that constantly send ICMP request to remote addresses.
DiscPinger
private PCQueue m_pingRequestQ
The producer/cosumer queue that is the sink for the IPGenerator and the source for the numerous discovery ping threads. This object is passed to the IPGenerator and the DiscPingManager objects.
private PCQueue m_monitorRequestQ
The producer/cosumer queue that is the sink for the MonitorRequestReceiver and the source for the numerous monitor ping threads. This object is passed to the MonitorRequestReceiver and the DiscPingManager objects.
private final String PROP_MAX_MONITOR_POLL_THREADS
private int m_maxNumMonitorThreads
The maximum number of threads in the monitor thread pool which will be processing incoming ICMP poll requests from the ICMP service monitor. This value is configurable through the discovery properties. Default value is 10.
private DiscCapsdReceiver m_discCapsdReceiver
The thread that recieves the confirmation from capsd that a node has been added to the database - once this confirmation is got, the node is acknowledged as 'known'.
private static Properties m_properties
The properties that are specific to the discovery process. The properties are a combination of the JVM's system properties, plus the inclusion of the OpenNMS specific property files. There are two additional files that are loaded, if the system properties are correctly set.
In order to properly load the OpenNMS specific file(s) their location must be known in advance. Instead of hard coding the location of the files, the files are referenced by properties. The following list declares the properites that reference the specific files. The property files are loaded in the order they appear in the list.
Currently the string returned for the propertyFile(s) must be a file on the local filesystem. Later support for remote files via HTTP, JSDT, etc al may be supported.
Constructor Detail |
public Discovery() throws ClassNotFoundException, IOException
ClassNotFoundException
- Thrown if an error occurs loading
the database driver for collecting the known nodes.IOException
- Thrown if an file I/O error occurs
loading and parsing the configuration files.RuntimeException
- Thrown if an unexpected runtime
error occurs creating the discovery instance.java.lang.NullPointerException
- Thrown if an expected property
is null and the discovery initilization cannot recover.Method Detail |
static void()
Copy the System properties and then load the bluebird and discovery specific files into the property object. For more information see the javadoc comment for the m_properties element.
Additionally, this static loading will also look at the debugging options and will setup the Logging Facility. This can only be done after the properties have been loaded.
private Set loadDatabaseNodes() throws ClassNotFoundException
This method is used by the class constructor to load the currently known IP Addresses from the database into the discovery VM. The addresses are stored in a synchronzied Set collection so multiple threads can use the set together without causing data corruption.
If a non-fatal database error occurs, then an empty set is returned for use by the discovery process.
java.lang.NullPointerException
- Thrown if one of the database
parameters cannot be loaded.ClassNotFoundException
- Thrown if the database driver
cannot be loaded by the JVM.private void computeNetParameters(float fNetPercent, long lTimeout, int iRetries)
This method is used by the discovery constructor to determine what the maximum number of packets per second should be and the number of icmp sending threads. This is done in accordance with the method described in the OpenNMS polling documentation.
Currently there is no JAVA method for getting the interfaces and their transmission rates. So for now the transmission rate has be hard coded at 10Mbs until a correct method is introduced.
fNetPercent
- The maximum amount of the network interface's
bandwidth that may be used for discovery.lTimeout
- The (default) timeout that will be used by
discovery.iRetires
- The (default) number of retries that will be
used when sending icmp packets.public void start()
start
in class Thread
public void shutdown()
Initiates the shutdown of the thread's run method in accordance with the base class' specification. Once the class is notified to terminate, the method waits for the thread to exit. If the calling thread equals the thread for the instance, then the join method will not be called.
shutdown
in class PollerThread
org.opennms.bb.dp.common.components.PollerThread
PollerThread.STATUS_TERMINATING
,
Object.notifyAll()
public void run()
run
in class Thread
public static Properties getProperties()
public static String getProperty(String key)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |