OpenNMS API 1.1.4

org.opennms.netmgt.poller
Class PollableNode

java.lang.Object
  extended byorg.opennms.netmgt.poller.PollableNode

public class PollableNode
extends java.lang.Object

The PollableNode class...

Author:
James Zuo, Tarus Balog, Mike Davidson, OpenNMS

Field Summary
private static java.lang.String EVENT_SOURCE
           
private  java.util.Map m_interfaces
          Map of 'PollableInterface' objects keyed by IP address
private  boolean m_isDeleted
           
private  boolean m_isLocked
           
private  java.lang.Object m_lock
          Used to lock access to the PollableNode during a poll()
private  int m_nodeId
          nodeId
private  int m_status
          last known/current status of the node
private  boolean m_statusChangedFlag
          Set by poll() method.
 
Constructor Summary
PollableNode(int nodeId)
          Constructor.
 
Method Summary
 void addInterface(PollableInterface pInterface)
           
private  Event createEvent(java.lang.String uei, java.net.InetAddress address, java.lang.String svcName, java.util.Date date)
           
 void deleteAllInterfaces()
           
 void generateEvents()
           
 PollableInterface getInterface(java.lang.String ipAddress)
           
 java.util.Collection getInterfaces()
           
private  java.lang.String getIntNodeLabel(java.net.InetAddress ipaddr)
          Retrieve nodeLabel from the node table of the database given a particular IP Address.
 int getNodeId()
           
private  java.lang.String getNodeLabel(int nodeId)
          Retrieve nodeLabel from the node table of the database given a particular nodeId.
 boolean getNodeLock(long timeout)
           
 int getStatus()
           
 boolean isDeleted()
           
 void markAsDeleted()
           
 int poll(PollableService pSvc)
          Invokes a poll of the remote interface.
 void recalculateStatus()
          Responsible for recalculating this node's UP/DOWN status.
 void releaseNodeLock()
           
 void removeInterface(PollableInterface pInterface)
           
 void resetStatusChanged()
           
 boolean statusChanged()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_nodeId

private int m_nodeId
nodeId


m_status

private int m_status
last known/current status of the node


m_statusChangedFlag

private boolean m_statusChangedFlag
Set by poll() method.


m_interfaces

private java.util.Map m_interfaces
Map of 'PollableInterface' objects keyed by IP address


m_lock

private java.lang.Object m_lock
Used to lock access to the PollableNode during a poll()


m_isLocked

private boolean m_isLocked

m_isDeleted

private boolean m_isDeleted

EVENT_SOURCE

private static final java.lang.String EVENT_SOURCE
See Also:
Constant Field Values
Constructor Detail

PollableNode

public PollableNode(int nodeId)
Constructor.

Method Detail

getNodeId

public int getNodeId()

getInterfaces

public java.util.Collection getInterfaces()

addInterface

public void addInterface(PollableInterface pInterface)

deleteAllInterfaces

public void deleteAllInterfaces()

getInterface

public PollableInterface getInterface(java.lang.String ipAddress)

removeInterface

public void removeInterface(PollableInterface pInterface)

getStatus

public int getStatus()

statusChanged

public boolean statusChanged()

resetStatusChanged

public void resetStatusChanged()

markAsDeleted

public void markAsDeleted()

isDeleted

public boolean isDeleted()

recalculateStatus

public void recalculateStatus()
Responsible for recalculating this node's UP/DOWN status.


getNodeLock

public boolean getNodeLock(long timeout)
                    throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

releaseNodeLock

public void releaseNodeLock()
                     throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

generateEvents

public void generateEvents()

createEvent

private Event createEvent(java.lang.String uei,
                          java.net.InetAddress address,
                          java.lang.String svcName,
                          java.util.Date date)

getNodeLabel

private java.lang.String getNodeLabel(int nodeId)
                               throws java.sql.SQLException
Retrieve nodeLabel from the node table of the database given a particular nodeId.

Parameters:
nodeId - Node identifier
Returns:
nodeLabel Retreived nodeLabel
Throws:
java.sql.SQLException - if database error encountered

getIntNodeLabel

private java.lang.String getIntNodeLabel(java.net.InetAddress ipaddr)
                                  throws java.sql.SQLException
Retrieve nodeLabel from the node table of the database given a particular IP Address.

Parameters:
ipaddr - Interface IP Address
Returns:
nodeLabel Retreived nodeLabel
Throws:
java.sql.SQLException - if database error encountered

poll

public int poll(PollableService pSvc)
Invokes a poll of the remote interface. If the interface changes status then node outage processing will be invoked and the status of the entire node will be evaluated.


OpenNMS API 1.1.4

Generated by eevans on November 11 2004 1600.