Class OnmsNode
- java.lang.Object
-
- org.opennms.netmgt.model.OnmsEntity
-
- org.opennms.netmgt.model.OnmsNode
-
- All Implemented Interfaces:
Serializable
,Comparable<OnmsNode>
@Entity 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.- See Also:
- Serialized Form
- Hibernate class:
- table="node"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OnmsNode.NodeLabelSource
static class
OnmsNode.NodeType
-
Constructor Summary
Constructors Constructor Description OnmsNode()
Constructor for OnmsNode.OnmsNode(OnmsMonitoringLocation location)
Constructor for OnmsNode.OnmsNode(OnmsMonitoringLocation location, String label)
Constructor for OnmsNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addCategory(OnmsCategory category)
addCategoryvoid
addIpInterface(OnmsIpInterface iface)
addIpInterfacevoid
addMetaData(String context, String key, String value)
void
addRequisionedMetaData(OnmsMetaData onmsMetaData)
void
addRequisitionedCategory(String category)
void
addSnmpInterface(OnmsSnmpInterface snmpIface)
addSnmpInterfaceint
compareTo(OnmsNode o)
compareToboolean
containsInterface(InetAddress addr)
boolean
containsService(InetAddress addr, String service)
Optional<OnmsMetaData>
findMetaDataForContextAndKey(String context, String key)
OnmsAssetRecord
getAssetRecord()
The assert record associated with this nodeSet<OnmsCategory>
getCategories()
getCategoriesDate
getCreateTime()
Time node was added to the database.OnmsIpInterface
getCriticalInterface()
getCriticalInterfaceString
getForeignId()
getForeignIdString
getForeignSource()
getForeignSourceboolean
getHasEgressFlows()
boolean
getHasFlows()
boolean
getHasIngressFlows()
Integer
getId()
Unique identifier for node.List<OnmsIpInterface>
getInterfacesWithService(String svcName)
getInterfacesWithServiceOnmsIpInterface
getInterfaceWithAddress(InetAddress addr)
OnmsIpInterface
getInterfaceWithService(String svcName)
getInterfaceWithServiceOnmsIpInterface
getIpInterfaceByIpAddress(String ipAddress)
getIpInterfaceByIpAddressOnmsIpInterface
getIpInterfaceByIpAddress(InetAddress ipAddress)
getIpInterfaceByIpAddressSet<OnmsIpInterface>
getIpInterfaces()
The interfaces on this nodeString
getLabel()
User-friendly name associated with the node.OnmsNode.NodeLabelSource
getLabelSource()
Flag indicating source of nodeLabel - 'U' = user defined - 'H' = IP hostname - 'S' = sysName - 'A' = IP address TODO: change this to an enumDate
getLastCapsdPoll()
Date and time of last Capsd scan.Date
getLastEgressFlow()
Date
getLastIngressFlow()
OnmsMonitoringLocation
getLocation()
Monitoring location that this node is located in.List<OnmsMetaData>
getMetaData()
String
getNetBiosDomain()
NetBIOS domain name associated with the node.String
getNetBiosName()
NetBIOS workstation name associated with the node.String
getNodeId()
getNodeIdString
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()
getPathElementOnmsIpInterface
getPrimaryInterface()
getPrimaryInterfaceSet<String>
getRequisitionedCategories()
List<OnmsMetaData>
getRequisitionedMetaData()
Set<OnmsSnmpInterface>
getSnmpInterfaces()
The information from the SNMP interfaces/ipAddrTables for the nodeOnmsSnmpInterface
getSnmpInterfaceWithIfIndex(int ifIndex)
getSnmpInterfaceWithIfIndexString
getSysContact()
SNMP MIB-2 system.sysContact.0String
getSysDescription()
SNMP MIB-2 system.sysDescr.0String
getSysLocation()
SNMP MIB-2 system.sysLocation.0String
getSysName()
SNMP MIB-2 system.sysName.0String
getSysObjectId()
SNMP MIB-2 system.sysObjectID.0OnmsNode.NodeType
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)
hasCategoryboolean
isDown()
isDownvoid
mergeAgentAttributes(OnmsNode scannedNode)
mergeAgentAttributesvoid
mergeAssets(OnmsNode scannedNode)
Truly merges the node's assert recordvoid
mergeCategorySet(OnmsNode scannedNode)
mergeCategorySetvoid
mergeIpInterfaces(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeIpInterfacesvoid
mergeMetaData(OnmsNode scanned)
Truly merges the node's meta-datavoid
mergeNode(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeNodevoid
mergeNodeAttributes(OnmsNode scannedNode, EventForwarder eventForwarder)
mergeNodeAttributesvoid
mergeSnmpInterfaces(OnmsNode scannedNode, boolean deleteMissing)
mergeSnmpInterfacesboolean
removeCategory(OnmsCategory category)
removeCategoryvoid
removeIpInterface(OnmsIpInterface iface)
void
removeMetaData(String context)
void
removeMetaData(String context, String key)
void
removeRequisitionedCategory(String category)
void
replaceCurrentAssetRecord(OnmsNode scannedNode)
Simply replaces the current asset record with the new recordvoid
setAssetRecord(OnmsAssetRecord asset)
setAssetRecordvoid
setCategories(Set<OnmsCategory> categories)
setCategoriesvoid
setCreateTime(Date nodecreatetime)
setCreateTimevoid
setForeignId(String foreignId)
setForeignIdvoid
setForeignSource(String foreignSource)
setForeignSourcevoid
setId(Integer nodeid)
setIdvoid
setIpInterfaces(Set<OnmsIpInterface> ipinterfaces)
setIpInterfacesvoid
setLabel(String nodelabel)
setLabelvoid
setLabelSource(OnmsNode.NodeLabelSource nodelabelsource)
setLabelSourcevoid
setLastCapsdPoll(Date lastcapsdpoll)
setLastCapsdPollvoid
setLastEgressFlow(Date lastEgressFlow)
void
setLastIngressFlow(Date lastIngressFlow)
void
setLocation(OnmsMonitoringLocation location)
Set the monitoring location that this node is located in.void
setMetaData(List<OnmsMetaData> metaData)
void
setNetBiosDomain(String nodedomainname)
setNetBiosDomainvoid
setNetBiosName(String nodenetbiosname)
setNetBiosNamevoid
setNodeId(String nodeid)
setNodeIdvoid
setOperatingSystem(String operatingsystem)
setOperatingSystemvoid
setParent(OnmsNode parent)
setParentvoid
setPathElement(PathElement pathElement)
setPathElementvoid
setRequisionedMetaData(List<OnmsMetaData> requisitionedMetaData)
void
setRequisitionedCategories(Set<String> categories)
void
setSnmpInterfaces(Set<OnmsSnmpInterface> snmpinterfaces)
setSnmpInterfacesvoid
setSysContact(String nodesyscontact)
setSysContactvoid
setSysDescription(String nodesysdescription)
setSysDescriptionvoid
setSysLocation(String nodesyslocation)
setSysLocationvoid
setSysName(String nodesysname)
setSysNamevoid
setSysObjectId(String nodesysoid)
setSysObjectIdvoid
setType(OnmsNode.NodeType nodetype)
setTypeString
toString()
toStringvoid
visit(EntityVisitor visitor)
visit-
Methods inherited from class org.opennms.netmgt.model.OnmsEntity
hasNewValue
-
-
-
-
Constructor Detail
-
OnmsNode
public OnmsNode()
Constructor for OnmsNode. This constructor should only be used by JAXB and by unit tests that do not need to persist the
OnmsNode
in the database. It does not associate theOnmsNode
with a requiredOnmsMonitoringLocation
.
-
OnmsNode
public OnmsNode(OnmsMonitoringLocation location)
Constructor for OnmsNode.
- Parameters:
location
- The location where this node is located
-
OnmsNode
public OnmsNode(OnmsMonitoringLocation location, String label)
Constructor for OnmsNode.
- Parameters:
location
- The location where this node is locatedlabel
- The node label
-
-
Method Detail
-
getCreateTime
public Date getCreateTime()
Time node was added to the database.- Returns:
- a
Date
object. - Hibernate property:
- column="nodecreatetime" length="8" not-null="true"
-
setCreateTime
public void setCreateTime(Date nodecreatetime)
setCreateTime
- Parameters:
nodecreatetime
- aDate
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.
-
getType
public OnmsNode.NodeType 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(OnmsNode.NodeType nodetype)
setType
- Parameters:
nodetype
- aString
object.
-
getSysObjectId
public String getSysObjectId()
SNMP MIB-2 system.sysObjectID.0- Returns:
- a
String
object.
-
setSysObjectId
public void setSysObjectId(String nodesysoid)
setSysObjectId
- Parameters:
nodesysoid
- aString
object.
-
setSysName
public void setSysName(String nodesysname)
setSysName
- Parameters:
nodesysname
- aString
object.
-
getHasFlows
public boolean getHasFlows()
-
getHasIngressFlows
public boolean getHasIngressFlows()
-
getHasEgressFlows
public boolean getHasEgressFlows()
-
getLastIngressFlow
public Date getLastIngressFlow()
-
setLastIngressFlow
public void setLastIngressFlow(Date lastIngressFlow)
-
getLastEgressFlow
public Date getLastEgressFlow()
-
setLastEgressFlow
public void setLastEgressFlow(Date lastEgressFlow)
-
getSysDescription
public String getSysDescription()
SNMP MIB-2 system.sysDescr.0- Returns:
- a
String
object.
-
setSysDescription
public void setSysDescription(String nodesysdescription)
setSysDescription
- Parameters:
nodesysdescription
- aString
object.
-
getSysLocation
public String getSysLocation()
SNMP MIB-2 system.sysLocation.0- Returns:
- a
String
object.
-
setSysLocation
public void setSysLocation(String nodesyslocation)
setSysLocation
- Parameters:
nodesyslocation
- aString
object.
-
getSysContact
public String getSysContact()
SNMP MIB-2 system.sysContact.0- Returns:
- a
String
object.
-
setSysContact
public void setSysContact(String nodesyscontact)
setSysContact
- Parameters:
nodesyscontact
- aString
object.
-
getLabel
public String getLabel()
User-friendly name associated with the node.- Returns:
- a
String
object.
-
getLabelSource
public OnmsNode.NodeLabelSource 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(OnmsNode.NodeLabelSource nodelabelsource)
setLabelSource
- Parameters:
nodelabelsource
- aString
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
- aString
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
- aString
object.
-
getOperatingSystem
public String getOperatingSystem()
Operating system running on the node.- Returns:
- a
String
object.
-
setOperatingSystem
public void setOperatingSystem(String operatingsystem)
setOperatingSystem
- Parameters:
operatingsystem
- aString
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
- aDate
object.
-
setForeignId
public void setForeignId(String foreignId)
setForeignId
- Parameters:
foreignId
- aString
object.
-
setForeignSource
public void setForeignSource(String foreignSource)
setForeignSource
- Parameters:
foreignSource
- aString
object.
-
getLocation
public OnmsMonitoringLocation getLocation()
Monitoring location that this node is located in.
-
setLocation
public void setLocation(OnmsMonitoringLocation location)
Set the monitoring location that this node is located in.
-
getAssetRecord
public OnmsAssetRecord getAssetRecord()
The assert record associated with this node- Returns:
- a
OnmsAssetRecord
object.
-
setAssetRecord
public void setAssetRecord(OnmsAssetRecord asset)
setAssetRecord
- Parameters:
asset
- aOnmsAssetRecord
object.
-
getPathElement
public PathElement getPathElement()
getPathElement
- Returns:
- a
PathElement
object.
-
setPathElement
public void setPathElement(PathElement pathElement)
setPathElement
- Parameters:
pathElement
- aPathElement
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
- aSet
object.
-
addIpInterface
public void addIpInterface(OnmsIpInterface iface)
addIpInterface
- Parameters:
iface
- aOnmsIpInterface
object.
-
removeIpInterface
public void removeIpInterface(OnmsIpInterface iface)
-
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
- aSet
object.
-
getCategories
public Set<OnmsCategory> getCategories()
getCategories
- Returns:
- a
Set
object.
-
setCategories
public void setCategories(Set<OnmsCategory> categories)
setCategories
- Parameters:
categories
- aSet
object.
-
addCategory
public boolean addCategory(OnmsCategory category)
addCategory
- Parameters:
category
- aOnmsCategory
object.- Returns:
- a boolean.
-
removeCategory
public boolean removeCategory(OnmsCategory category)
removeCategory
- Parameters:
category
- aOnmsCategory
object.- Returns:
- a boolean.
-
hasCategory
public boolean hasCategory(String categoryName)
hasCategory
- Parameters:
categoryName
- aString
object.- Returns:
- a boolean.
-
addRequisitionedCategory
public void addRequisitionedCategory(String category)
-
removeRequisitionedCategory
public void removeRequisitionedCategory(String category)
-
getMetaData
public List<OnmsMetaData> getMetaData()
-
findMetaDataForContextAndKey
public Optional<OnmsMetaData> findMetaDataForContextAndKey(String context, String key)
-
setMetaData
public void setMetaData(List<OnmsMetaData> metaData)
-
removeMetaData
public void removeMetaData(String context)
-
getRequisitionedMetaData
public List<OnmsMetaData> getRequisitionedMetaData()
-
setRequisionedMetaData
public void setRequisionedMetaData(List<OnmsMetaData> requisitionedMetaData)
-
addRequisionedMetaData
public void addRequisionedMetaData(OnmsMetaData onmsMetaData)
-
toString
public String toString()
toString
-
visit
public void visit(EntityVisitor visitor)
visit
- Specified by:
visit
in classOnmsEntity
- Parameters:
visitor
- aEntityVisitor
object.
-
addSnmpInterface
public void addSnmpInterface(OnmsSnmpInterface snmpIface)
addSnmpInterface
- Parameters:
snmpIface
- aOnmsSnmpInterface
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
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
getIpInterfaceByIpAddress
public OnmsIpInterface getIpInterfaceByIpAddress(InetAddress ipAddress)
getIpInterfaceByIpAddress
- Parameters:
ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
compareTo
public int compareTo(OnmsNode o)
compareTo
- Specified by:
compareTo
in interfaceComparable<OnmsNode>
- Parameters:
o
- aOnmsNode
object.- Returns:
- a int.
-
getPrimaryInterface
public OnmsIpInterface getPrimaryInterface()
getPrimaryInterface
This function should be kept similar toIpInterfaceDao#findPrimaryInterfaceByNodeId()
.- Returns:
- a
OnmsIpInterface
object.
-
getInterfaceWithService
public OnmsIpInterface getInterfaceWithService(String svcName)
getInterfaceWithService
- Parameters:
svcName
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
getInterfacesWithService
public List<OnmsIpInterface> getInterfacesWithService(String svcName)
getInterfacesWithService
- Parameters:
svcName
- aString
object.- Returns:
- a List of
OnmsIpInterface
objects.
-
getInterfaceWithAddress
public OnmsIpInterface getInterfaceWithAddress(InetAddress addr)
-
getCriticalInterface
public OnmsIpInterface getCriticalInterface()
getCriticalInterface
- Returns:
- a
OnmsIpInterface
object.
-
mergeAgentAttributes
public void mergeAgentAttributes(OnmsNode scannedNode)
mergeAgentAttributes
- Parameters:
scannedNode
- aOnmsNode
object.
-
mergeNodeAttributes
public void mergeNodeAttributes(OnmsNode scannedNode, EventForwarder eventForwarder)
mergeNodeAttributes
- Parameters:
scannedNode
- aOnmsNode
object.
-
mergeSnmpInterfaces
public void mergeSnmpInterfaces(OnmsNode scannedNode, boolean deleteMissing)
mergeSnmpInterfaces
- Parameters:
scannedNode
- aOnmsNode
object.deleteMissing
- a boolean.
-
mergeIpInterfaces
public void mergeIpInterfaces(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeIpInterfaces
- Parameters:
scannedNode
- aOnmsNode
object.eventForwarder
- aEventForwarder
object.deleteMissing
- a boolean.
-
mergeCategorySet
public void mergeCategorySet(OnmsNode scannedNode)
mergeCategorySet
- Parameters:
scannedNode
- aOnmsNode
object.
-
mergeAssets
public void mergeAssets(OnmsNode scannedNode)
Truly merges the node's assert record- Parameters:
scannedNode
- aOnmsNode
object.
-
mergeMetaData
public void mergeMetaData(OnmsNode scanned)
Truly merges the node's meta-data- Parameters:
scannedNode
- aOnmsNode
object.
-
replaceCurrentAssetRecord
public void replaceCurrentAssetRecord(OnmsNode scannedNode)
Simply replaces the current asset record with the new record- Parameters:
scannedNode
- aOnmsNode
object.
-
mergeNode
public void mergeNode(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeNode
- Parameters:
scannedNode
- aOnmsNode
object.eventForwarder
- aEventForwarder
object.deleteMissing
- a boolean.
-
containsService
public boolean containsService(InetAddress addr, String service)
-
containsInterface
public boolean containsInterface(InetAddress addr)
-
-