org.opennms.bb.dp.discovery.components
Class DiscCapsdReceiver

java.lang.Object
  |
  +--org.opennms.bb.dp.discovery.components.DiscCapsdReceiver

public final class DiscCapsdReceiver
extends Object

DiscCapsdReceiver is the thread that handles JSDT communication from capsd. It adds the received IP addresses to the 'knownNodes'

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

Inner Class Summary
private  class DiscCapsdReceiver.DiscCapsdConsumer
          The JSDT channel consumer that receives messages from the capabilities poller and other potential interfaces that discovery new interfaces.
 
Field Summary
private  com.sun.media.jsdt.Channel m_channel
          The actual channel between the discovery process and the capabilities poller.
private  PollerClient m_client
          The client class for the JSDT registry to work correctly.
private  DiscCapsdReceiver.DiscCapsdConsumer m_consumer
          The consumer that reads in the new addresses from the capabilities process.
private  Set m_knownNodes
          The set of known interfaces.
private  boolean m_paused
          The current status of either paused or normal.
private  com.sun.media.jsdt.Session m_session
          The JSDT session on which messages are sent.
 
Constructor Summary
DiscCapsdReceiver(Set knownNodes)
          Creates a new discovery capabilities bridge that receives new node notification from capsd.
 
Method Summary
 void close()
          Closes the connection to the JSDT session and channel.
private  boolean jsdtConnect(String clientName)
          Connect to the discovery-capsd JSDT channel.
 void pause()
          Pauses the recipt of messages from the JSDT channel.
 void resume()
          Resumes the receipt of messages from the JSDT channel.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_knownNodes

private Set m_knownNodes
The set of known interfaces. Each interface is a String in IPv4 dotted decimal address format.

m_paused

private volatile boolean m_paused
The current status of either paused or normal. This is used to either accept or reject JSDT messages.

m_client

private PollerClient m_client
The client class for the JSDT registry to work correctly. This is actually a private derived class.

m_session

private com.sun.media.jsdt.Session m_session
The JSDT session on which messages are sent.

m_channel

private com.sun.media.jsdt.Channel m_channel
The actual channel between the discovery process and the capabilities poller.

m_consumer

private DiscCapsdReceiver.DiscCapsdConsumer m_consumer
The consumer that reads in the new addresses from the capabilities process.
Constructor Detail

DiscCapsdReceiver

public DiscCapsdReceiver(Set knownNodes)

Creates a new discovery capabilities bridge that receives new node notification from capsd. When a notification is received it is parsed and then added to the list of known nodes.

Parameters:
knownNodes - The set containing the known interfaces.
Method Detail

jsdtConnect

private boolean jsdtConnect(String clientName)
                     throws InterruptedException
Connect to the discovery-capsd JSDT channel.
Parameters:
clientName - The name of this client
Throws:
InterruptedException - Thrown if the running thread is interrupted by another thread.

resume

public void resume()

Resumes the receipt of messages from the JSDT channel.


pause

public void pause()

Pauses the recipt of messages from the JSDT channel. All messages will be discarded.


close

public void close()

Closes the connection to the JSDT session and channel.