org.opennms.netmgt.model
Class OnmsNode

java.lang.Object
  extended by org.opennms.netmgt.model.OnmsEntity
      extended by org.opennms.netmgt.model.OnmsNode
All Implemented Interfaces:
Serializable, Comparable<OnmsNode>

public class OnmsNode
extends OnmsEntity
implements Serializable, Comparable<OnmsNode>

Contains information on nodes discovered and potentially managed by OpenNMS. sys* properties map to SNMP MIB 2 system table information.

Version:
$Id: $
Author:
ranger
See Also:
Serialized Form

Constructor Summary
OnmsNode()
          Constructor for OnmsNode.
OnmsNode(OnmsDistPoller distPoller)
          Constructor for OnmsNode.
 
Method Summary
 void addArpInterface(OnmsArpInterface iface)
          addArpInterface
 boolean addCategory(OnmsCategory category)
          addCategory
 void addIpInterface(OnmsIpInterface iface)
          addIpInterface
 void addSnmpInterface(OnmsSnmpInterface snmpIface)
          addSnmpInterface
 int compareTo(OnmsNode o)
          compareTo
 Set<OnmsArpInterface> getArpInterfaces()
          The arp interfaces on this node
 OnmsAssetRecord getAssetRecord()
          The assert record associated with this node
 Set<OnmsCategory> getCategories()
          getCategories
 Date getCreateTime()
          Time node was added to the database.
 OnmsIpInterface getCriticalInterface()
          getCriticalInterface
 OnmsDistPoller getDistPoller()
          Distributed Poller responsible for this node
 String getForeignId()
          getForeignId
 String getForeignSource()
          getForeignSource
 Integer getId()
          Unique identifier for node.
 OnmsIpInterface getInterfaceWithService(String svcName)
          getInterfaceWithService
 OnmsIpInterface getIpInterfaceByIpAddress(String ipAddress)
          getIpInterfaceByIpAddress
 Set<OnmsIpInterface> getIpInterfaces()
          The interfaces on this node
 String getLabel()
          User-friendly name associated with the node.
 String getLabelSource()
          Flag indicating source of nodeLabel - 'U' = user defined - 'H' = IP hostname - 'S' = sysName - 'A' = IP address TODO: change this to an enum
 Date getLastCapsdPoll()
          Date and time of last Capsd scan.
 String getNetBiosDomain()
          NetBIOS domain name associated with the node.
 String getNetBiosName()
          NetBIOS workstation name associated with the node.
 String getNodeId()
          getNodeId
 String getOperatingSystem()
          Operating system running on the node.
 OnmsNode getParent()
          In the case that the node is virtual or an independent device in a chassis that should be reflected as a subcomponent or "child", this field reflects the nodeID of the chassis/physical node/"parent" device.
 PathElement getPathElement()
          getPathElement
 OnmsIpInterface getPrimaryInterface()
          getPrimaryInterface
 Set<OnmsSnmpInterface> getSnmpInterfaces()
          The information from the SNMP interfaces/ipAddrTables for the node
 OnmsSnmpInterface getSnmpInterfaceWithIfIndex(int ifIndex)
          getSnmpInterfaceWithIfIndex
 String getSysContact()
          SNMP MIB-2 system.sysContact.0
 String getSysDescription()
          SNMP MIB-2 system.sysDescr.0
 String getSysLocation()
          SNMP MIB-2 system.sysLocation.0
 String getSysName()
          SNMP MIB-2 system.sysName.0
 String getSysObjectId()
          SNMP MIB-2 system.sysObjectID.0
 String getType()
          Flag indicating status of node - 'A' - active - 'D' - deleted TODO: Eventually this will be deprecated and deleted nodes will actually be deleted.
 boolean hasCategory(String categoryName)
          hasCategory
 boolean isDown()
          isDown
 void mergeAdditionalCategories(OnmsNode scannedNode)
          mergeAdditionalCategories
 void mergeAgentAttributes(OnmsNode scannedNode)
          mergeAgentAttributes
 void mergeAssets(OnmsNode scannedNode)
          Truly merges the node's assert record
 void mergeCategorySet(OnmsNode scannedNode)
          mergeCategorySet
 void mergeIpInterfaces(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
          mergeIpInterfaces
 void mergeNode(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
          mergeNode
 void mergeNodeAttributes(OnmsNode scannedNode)
          mergeNodeAttributes
 void mergeSnmpInterfaces(OnmsNode scannedNode, boolean deleteMissing)
          mergeSnmpInterfaces
 boolean removeCategory(OnmsCategory category)
          removeCategory
 void replaceCurrentAssetRecord(OnmsNode scannedNode)
          Simply replaces the current asset record with the new record
 void setArpInterfaces(Set<OnmsArpInterface> arpInterfaces)
          setArpInterfaces
 void setAssetRecord(OnmsAssetRecord asset)
          setAssetRecord
 void setCategories(Set<OnmsCategory> categories)
          setCategories
 void setCreateTime(Date nodecreatetime)
          setCreateTime
 void setDistPoller(OnmsDistPoller distpoller)
          setDistPoller
 void setForeignId(String foreignId)
          setForeignId
 void setForeignSource(String foreignSource)
          setForeignSource
 void setId(Integer nodeid)
          setId
 void setIpInterfaces(Set<OnmsIpInterface> ipinterfaces)
          setIpInterfaces
 void setLabel(String nodelabel)
          setLabel
 void setLabelSource(String nodelabelsource)
          setLabelSource
 void setLastCapsdPoll(Date lastcapsdpoll)
          setLastCapsdPoll
 void setNetBiosDomain(String nodedomainname)
          setNetBiosDomain
 void setNetBiosName(String nodenetbiosname)
          setNetBiosName
 void setNodeId(String nodeid)
          setNodeId
 void setOperatingSystem(String operatingsystem)
          setOperatingSystem
 void setParent(OnmsNode parent)
          setParent
 void setPathElement(PathElement pathElement)
          setPathElement
 void setSnmpInterfaces(Set<OnmsSnmpInterface> snmpinterfaces)
          setSnmpInterfaces
 void setSysContact(String nodesyscontact)
          setSysContact
 void setSysDescription(String nodesysdescription)
          setSysDescription
 void setSysLocation(String nodesyslocation)
          setSysLocation
 void setSysName(String nodesysname)
          setSysName
 void setSysObjectId(String nodesysoid)
          setSysObjectId
 void setType(String nodetype)
          setType
 String toString()
          toString
 void visit(EntityVisitor visitor)
          visit
 
Methods inherited from class org.opennms.netmgt.model.OnmsEntity
hasNewValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OnmsNode

public OnmsNode()

Constructor for OnmsNode.


OnmsNode

public OnmsNode(OnmsDistPoller distPoller)

Constructor for OnmsNode.

Parameters:
distPoller - a OnmsDistPoller object.
Method Detail

getId

public Integer getId()
Unique identifier for node.

Returns:
a Integer object.

getNodeId

public String getNodeId()

getNodeId

Returns:
a String object.

setId

public void setId(Integer nodeid)

setId

Parameters:
nodeid - a Integer object.

setNodeId

public void setNodeId(String nodeid)

setNodeId

Parameters:
nodeid - a String object.

getCreateTime

public Date getCreateTime()
Time node was added to the database.

Returns:
a Date object.

setCreateTime

public void setCreateTime(Date nodecreatetime)

setCreateTime

Parameters:
nodecreatetime - a Date object.

getParent

public OnmsNode getParent()
In the case that the node is virtual or an independent device in a chassis that should be reflected as a subcomponent or "child", this field reflects the nodeID of the chassis/physical node/"parent" device.

Returns:
a OnmsNode object.

setParent

public void setParent(OnmsNode parent)

setParent

Parameters:
parent - a OnmsNode object.

getType

public String getType()
Flag indicating status of node - 'A' - active - 'D' - deleted TODO: Eventually this will be deprecated and deleted nodes will actually be deleted.

Returns:
a String object.

setType

public void setType(String nodetype)

setType

Parameters:
nodetype - a String object.

getSysObjectId

public String getSysObjectId()
SNMP MIB-2 system.sysObjectID.0

Returns:
a String object.

setSysObjectId

public void setSysObjectId(String nodesysoid)

setSysObjectId

Parameters:
nodesysoid - a String object.

getSysName

public String getSysName()
SNMP MIB-2 system.sysName.0

Returns:
a String object.

setSysName

public void setSysName(String nodesysname)

setSysName

Parameters:
nodesysname - a String object.

getSysDescription

public String getSysDescription()
SNMP MIB-2 system.sysDescr.0

Returns:
a String object.

setSysDescription

public void setSysDescription(String nodesysdescription)

setSysDescription

Parameters:
nodesysdescription - a String object.

getSysLocation

public String getSysLocation()
SNMP MIB-2 system.sysLocation.0

Returns:
a String object.

setSysLocation

public void setSysLocation(String nodesyslocation)

setSysLocation

Parameters:
nodesyslocation - a String object.

getSysContact

public String getSysContact()
SNMP MIB-2 system.sysContact.0

Returns:
a String object.

setSysContact

public void setSysContact(String nodesyscontact)

setSysContact

Parameters:
nodesyscontact - a String object.

getLabel

public String getLabel()
User-friendly name associated with the node.

Returns:
a String object.

setLabel

public void setLabel(String nodelabel)

setLabel

Parameters:
nodelabel - a String object.

getLabelSource

public String getLabelSource()
Flag indicating source of nodeLabel - 'U' = user defined - 'H' = IP hostname - 'S' = sysName - 'A' = IP address TODO: change this to an enum

Returns:
a String object.

setLabelSource

public void setLabelSource(String nodelabelsource)

setLabelSource

Parameters:
nodelabelsource - a String object.

getNetBiosName

public String getNetBiosName()
NetBIOS workstation name associated with the node.

Returns:
a String object.

setNetBiosName

public void setNetBiosName(String nodenetbiosname)

setNetBiosName

Parameters:
nodenetbiosname - a String object.

getNetBiosDomain

public String getNetBiosDomain()
NetBIOS domain name associated with the node.

Returns:
a String object.

setNetBiosDomain

public void setNetBiosDomain(String nodedomainname)

setNetBiosDomain

Parameters:
nodedomainname - a String object.

getOperatingSystem

public String getOperatingSystem()
Operating system running on the node.

Returns:
a String object.

setOperatingSystem

public void setOperatingSystem(String operatingsystem)

setOperatingSystem

Parameters:
operatingsystem - a String object.

getLastCapsdPoll

public Date getLastCapsdPoll()
Date and time of last Capsd scan.

Returns:
a Date object.

setLastCapsdPoll

public void setLastCapsdPoll(Date lastcapsdpoll)

setLastCapsdPoll

Parameters:
lastcapsdpoll - a Date object.

getForeignId

public String getForeignId()

getForeignId

Returns:
a String object.

setForeignId

public void setForeignId(String foreignId)

setForeignId

Parameters:
foreignId - a String object.

getForeignSource

public String getForeignSource()

getForeignSource

Returns:
a String object.

setForeignSource

public void setForeignSource(String foreignSource)

setForeignSource

Parameters:
foreignSource - a String object.

getDistPoller

public OnmsDistPoller getDistPoller()
Distributed Poller responsible for this node

Returns:
a OnmsDistPoller object.

setDistPoller

public void setDistPoller(OnmsDistPoller distpoller)

setDistPoller

Parameters:
distpoller - a OnmsDistPoller object.

getAssetRecord

public OnmsAssetRecord getAssetRecord()
The assert record associated with this node

Returns:
a OnmsAssetRecord object.

setAssetRecord

public void setAssetRecord(OnmsAssetRecord asset)

setAssetRecord

Parameters:
asset - a OnmsAssetRecord object.

getPathElement

public PathElement getPathElement()

getPathElement

Returns:
a PathElement object.

setPathElement

public void setPathElement(PathElement pathElement)

setPathElement

Parameters:
pathElement - a PathElement object.

getIpInterfaces

public Set<OnmsIpInterface> getIpInterfaces()
The interfaces on this node

Returns:
a Set object.

setIpInterfaces

public void setIpInterfaces(Set<OnmsIpInterface> ipinterfaces)

setIpInterfaces

Parameters:
ipinterfaces - a Set object.

addIpInterface

public void addIpInterface(OnmsIpInterface iface)

addIpInterface

Parameters:
iface - a OnmsIpInterface object.

getSnmpInterfaces

public Set<OnmsSnmpInterface> getSnmpInterfaces()
The information from the SNMP interfaces/ipAddrTables for the node

Returns:
a Set object.

setSnmpInterfaces

public void setSnmpInterfaces(Set<OnmsSnmpInterface> snmpinterfaces)

setSnmpInterfaces

Parameters:
snmpinterfaces - a Set object.

getArpInterfaces

public Set<OnmsArpInterface> getArpInterfaces()
The arp interfaces on this node

Returns:
a Set object.

setArpInterfaces

public void setArpInterfaces(Set<OnmsArpInterface> arpInterfaces)

setArpInterfaces

Parameters:
arpInterfaces - a Set object.

addArpInterface

public void addArpInterface(OnmsArpInterface iface)

addArpInterface

Parameters:
iface - a OnmsArpInterface object.

getCategories

public Set<OnmsCategory> getCategories()

getCategories

Returns:
a Set object.

setCategories

public void setCategories(Set<OnmsCategory> categories)

setCategories

Parameters:
categories - a Set object.

addCategory

public boolean addCategory(OnmsCategory category)

addCategory

Parameters:
category - a OnmsCategory object.
Returns:
a boolean.

removeCategory

public boolean removeCategory(OnmsCategory category)

removeCategory

Parameters:
category - a OnmsCategory object.
Returns:
a boolean.

hasCategory

public boolean hasCategory(String categoryName)

hasCategory

Parameters:
categoryName - a String object.
Returns:
a boolean.

toString

public String toString()

toString

Overrides:
toString in class Object
Returns:
a String object.

visit

public void visit(EntityVisitor visitor)

visit

Specified by:
visit in class OnmsEntity
Parameters:
visitor - a EntityVisitor object.

addSnmpInterface

public void addSnmpInterface(OnmsSnmpInterface snmpIface)

addSnmpInterface

Parameters:
snmpIface - a OnmsSnmpInterface object.

isDown

public boolean isDown()

isDown

Returns:
a boolean.

getSnmpInterfaceWithIfIndex

public OnmsSnmpInterface getSnmpInterfaceWithIfIndex(int ifIndex)

getSnmpInterfaceWithIfIndex

Parameters:
ifIndex - a int.
Returns:
a OnmsSnmpInterface object.

getIpInterfaceByIpAddress

public OnmsIpInterface getIpInterfaceByIpAddress(String ipAddress)

getIpInterfaceByIpAddress

Parameters:
ipAddress - a String object.
Returns:
a OnmsIpInterface object.

compareTo

public int compareTo(OnmsNode o)

compareTo

Specified by:
compareTo in interface Comparable<OnmsNode>
Parameters:
o - a OnmsNode object.
Returns:
a int.

getPrimaryInterface

public OnmsIpInterface getPrimaryInterface()

getPrimaryInterface

Returns:
a OnmsIpInterface object.

getInterfaceWithService

public OnmsIpInterface getInterfaceWithService(String svcName)

getInterfaceWithService

Parameters:
svcName - a String object.
Returns:
a OnmsIpInterface object.

getCriticalInterface

public OnmsIpInterface getCriticalInterface()

getCriticalInterface

Returns:
a OnmsIpInterface object.

mergeAgentAttributes

public void mergeAgentAttributes(OnmsNode scannedNode)

mergeAgentAttributes

Parameters:
scannedNode - a OnmsNode object.

mergeNodeAttributes

public void mergeNodeAttributes(OnmsNode scannedNode)

mergeNodeAttributes

Parameters:
scannedNode - a OnmsNode object.

mergeAdditionalCategories

public void mergeAdditionalCategories(OnmsNode scannedNode)

mergeAdditionalCategories

Parameters:
scannedNode - a OnmsNode object.

mergeSnmpInterfaces

public void mergeSnmpInterfaces(OnmsNode scannedNode,
                                boolean deleteMissing)

mergeSnmpInterfaces

Parameters:
scannedNode - a OnmsNode object.
deleteMissing - a boolean.

mergeIpInterfaces

public void mergeIpInterfaces(OnmsNode scannedNode,
                              EventForwarder eventForwarder,
                              boolean deleteMissing)

mergeIpInterfaces

Parameters:
scannedNode - a OnmsNode object.
eventForwarder - a EventForwarder object.
deleteMissing - a boolean.

mergeCategorySet

public void mergeCategorySet(OnmsNode scannedNode)

mergeCategorySet

Parameters:
scannedNode - a OnmsNode object.

mergeAssets

public void mergeAssets(OnmsNode scannedNode)
Truly merges the node's assert record

Parameters:
scannedNode - a OnmsNode object.

replaceCurrentAssetRecord

public void replaceCurrentAssetRecord(OnmsNode scannedNode)
Simply replaces the current asset record with the new record

Parameters:
scannedNode - a OnmsNode object.

mergeNode

public void mergeNode(OnmsNode scannedNode,
                      EventForwarder eventForwarder,
                      boolean deleteMissing)

mergeNode

Parameters:
scannedNode - a OnmsNode object.
eventForwarder - a EventForwarder object.
deleteMissing - a boolean.


Copyright © 2011. All Rights Reserved.