org.opennms.bb.dp.capsd
Class Capsd

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.opennms.bb.dp.common.components.PollerThread
              |
              +--org.opennms.bb.dp.capsd.Capsd
All Implemented Interfaces:
Runnable

public class Capsd
extends PollerThread

The Capability daemon - it is notified by the discovery process when a new node is discovered - it then polls for all the capabilities for this node and is responsible for loading the data collected into the database.

Once a node is added to the database, its sends an indication back to the discovery which then flags this node as 'known'.

Version:
$Revision: 1.19 $
Author:
Sowmya, OpenNMS

Field Summary
(package private)  int CTRL_COMM_SOCKET
           
(package private)  CapsdPluginLoader m_capsdPluginLoader
          capsd plugins for capability checks
(package private)  CapsdReadManager m_capsReadMgr
          thread maintaning a pool of threads for SNMP/service queries
(package private)  PCQueue m_capsReadQ
          Queue to which nodes received from discovery are added
(package private)  ServerSocket m_ctrlMessagesSocket
          CTRL MESSAGES - this communication needs to be replaced with JSDT comm.
(package private)  PCQueue m_databaseQ
          Queue between the capability read and the the database writer
(package private)  CapsdWriteManager m_databaseWriter
          thread maintaining a pool of threads to add data to the database
(package private)  CapsdDiscReceiver m_discReceiver
          thread listening for nodes discovered
private  Set m_dupNodes
          Used to filter out duplicate addresses being sent to Capsd from discovery due to the lag between the time an address is sent to Capsd and when it is sent back to the discovery process as a "known" node.
private static Properties m_properties
          The properties that are specific to the capsd process.
 
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
Capsd()
          Construts the Capsd object
 
Method Summary
(package private) static void ()
          Copy the System properties and then load the bluebird and capsd specific files into the property object.
static Properties getProperties()
           
static String getProperty(String key)
           
static void main(String[] args)
           
 void run()
          Waits for control messages and takes appropriate action
 void shutdown()
          Start the shutdown and notify run() to shutdown
 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

m_capsdPluginLoader

CapsdPluginLoader m_capsdPluginLoader
capsd plugins for capability checks

m_discReceiver

CapsdDiscReceiver m_discReceiver
thread listening for nodes discovered

m_capsReadMgr

CapsdReadManager m_capsReadMgr
thread maintaning a pool of threads for SNMP/service queries

m_capsReadQ

PCQueue m_capsReadQ
Queue to which nodes received from discovery are added

m_databaseWriter

CapsdWriteManager m_databaseWriter
thread maintaining a pool of threads to add data to the database

m_databaseQ

PCQueue m_databaseQ
Queue between the capability read and the the database writer

m_dupNodes

private Set m_dupNodes
Used to filter out duplicate addresses being sent to Capsd from discovery due to the lag between the time an address is sent to Capsd and when it is sent back to the discovery process as a "known" node. A duplicate address is any node or interface "known" by Capsd. This includes any interfaces found via SNMP queries.

m_ctrlMessagesSocket

ServerSocket m_ctrlMessagesSocket
CTRL MESSAGES - this communication needs to be replaced with JSDT comm. with the SCM

CTRL_COMM_SOCKET

int CTRL_COMM_SOCKET

m_properties

private static Properties m_properties

The properties that are specific to the capsd 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

Capsd

public Capsd()
      throws CapsdPluginException,
             com.sun.media.jsdt.JSDTException,
             FileNotFoundException,
             SQLException
Construts the Capsd object
Throws:
CapsdPLuginException - thrown when capsd plugins cannot be loaded
com.sun.media.jsdt.JSDTException - thrown when the JSDT communication channel cannot be established
Method Detail

static void ()

Copy the System properties and then load the bluebird and capsd 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.


start

public void start()
Start all the threads
Overrides:
start in class Thread

shutdown

public void shutdown()
Start the shutdown and notify run() to shutdown
Overrides:
shutdown in class PollerThread
Following copied from class: org.opennms.bb.dp.common.components.PollerThread
See Also:
PollerThread.STATUS_TERMINATING, Object.notifyAll()

run

public void run()
Waits for control messages and takes appropriate action
Overrides:
run in class Thread

getProperties

public static Properties getProperties()

getProperty

public static String getProperty(String key)

main

public static void main(String[] args)