Class OnmsNode
- java.lang.Object
-
- org.opennms.netmgt.model.OnmsEntity
-
- org.opennms.netmgt.model.OnmsNode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<OnmsNode>
@Entity public class OnmsNode extends OnmsEntity implements java.io.Serializable, java.lang.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, java.lang.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(java.lang.String context, java.lang.String key, java.lang.String value)
void
addRequisionedMetaData(OnmsMetaData onmsMetaData)
void
addRequisitionedCategory(java.lang.String category)
void
addSnmpInterface(OnmsSnmpInterface snmpIface)
addSnmpInterfaceint
compareTo(OnmsNode o)
compareToboolean
containsInterface(java.net.InetAddress addr)
boolean
containsService(java.net.InetAddress addr, java.lang.String service)
java.util.Optional<OnmsMetaData>
findMetaDataForContextAndKey(java.lang.String context, java.lang.String key)
OnmsAssetRecord
getAssetRecord()
The assert record associated with this nodejava.util.Set<OnmsCategory>
getCategories()
getCategoriesjava.util.Date
getCreateTime()
Time node was added to the database.OnmsIpInterface
getCriticalInterface()
getCriticalInterfacejava.lang.String
getForeignId()
getForeignIdjava.lang.String
getForeignSource()
getForeignSourceboolean
getHasEgressFlows()
boolean
getHasFlows()
boolean
getHasIngressFlows()
java.lang.Integer
getId()
Unique identifier for node.java.util.List<OnmsIpInterface>
getInterfacesWithService(java.lang.String svcName)
getInterfacesWithServiceOnmsIpInterface
getInterfaceWithAddress(java.net.InetAddress addr)
OnmsIpInterface
getInterfaceWithService(java.lang.String svcName)
getInterfaceWithServiceOnmsIpInterface
getIpInterfaceByIpAddress(java.lang.String ipAddress)
getIpInterfaceByIpAddressOnmsIpInterface
getIpInterfaceByIpAddress(java.net.InetAddress ipAddress)
getIpInterfaceByIpAddressjava.util.Set<OnmsIpInterface>
getIpInterfaces()
The interfaces on this nodejava.lang.String
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 enumjava.util.Date
getLastCapsdPoll()
Date and time of last Capsd scan.java.util.Date
getLastEgressFlow()
java.util.Date
getLastIngressFlow()
OnmsMonitoringLocation
getLocation()
Monitoring location that this node is located in.java.util.List<OnmsMetaData>
getMetaData()
java.lang.String
getNetBiosDomain()
NetBIOS domain name associated with the node.java.lang.String
getNetBiosName()
NetBIOS workstation name associated with the node.java.lang.String
getNodeId()
getNodeIdjava.lang.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()
getPathElementOnmsIpInterface
getPrimaryInterface()
getPrimaryInterfacejava.util.Set<java.lang.String>
getRequisitionedCategories()
java.util.List<OnmsMetaData>
getRequisitionedMetaData()
java.util.Set<OnmsSnmpInterface>
getSnmpInterfaces()
The information from the SNMP interfaces/ipAddrTables for the nodeOnmsSnmpInterface
getSnmpInterfaceWithIfIndex(int ifIndex)
getSnmpInterfaceWithIfIndexjava.lang.String
getSysContact()
SNMP MIB-2 system.sysContact.0java.lang.String
getSysDescription()
SNMP MIB-2 system.sysDescr.0java.lang.String
getSysLocation()
SNMP MIB-2 system.sysLocation.0java.lang.String
getSysName()
SNMP MIB-2 system.sysName.0java.lang.String
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(java.lang.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(java.lang.String context)
void
removeMetaData(java.lang.String context, java.lang.String key)
void
removeRequisitionedCategory(java.lang.String category)
void
replaceCurrentAssetRecord(OnmsNode scannedNode)
Simply replaces the current asset record with the new recordvoid
setAssetRecord(OnmsAssetRecord asset)
setAssetRecordvoid
setCategories(java.util.Set<OnmsCategory> categories)
setCategoriesvoid
setCreateTime(java.util.Date nodecreatetime)
setCreateTimevoid
setForeignId(java.lang.String foreignId)
setForeignIdvoid
setForeignSource(java.lang.String foreignSource)
setForeignSourcevoid
setId(java.lang.Integer nodeid)
setIdvoid
setIpInterfaces(java.util.Set<OnmsIpInterface> ipinterfaces)
setIpInterfacesvoid
setLabel(java.lang.String nodelabel)
setLabelvoid
setLabelSource(OnmsNode.NodeLabelSource nodelabelsource)
setLabelSourcevoid
setLastCapsdPoll(java.util.Date lastcapsdpoll)
setLastCapsdPollvoid
setLastEgressFlow(java.util.Date lastEgressFlow)
void
setLastIngressFlow(java.util.Date lastIngressFlow)
void
setLocation(OnmsMonitoringLocation location)
Set the monitoring location that this node is located in.void
setMetaData(java.util.List<OnmsMetaData> metaData)
void
setNetBiosDomain(java.lang.String nodedomainname)
setNetBiosDomainvoid
setNetBiosName(java.lang.String nodenetbiosname)
setNetBiosNamevoid
setNodeId(java.lang.String nodeid)
setNodeIdvoid
setOperatingSystem(java.lang.String operatingsystem)
setOperatingSystemvoid
setParent(OnmsNode parent)
setParentvoid
setPathElement(PathElement pathElement)
setPathElementvoid
setRequisionedMetaData(java.util.List<OnmsMetaData> requisitionedMetaData)
void
setRequisitionedCategories(java.util.Set<java.lang.String> categories)
void
setSnmpInterfaces(java.util.Set<OnmsSnmpInterface> snmpinterfaces)
setSnmpInterfacesvoid
setSysContact(java.lang.String nodesyscontact)
setSysContactvoid
setSysDescription(java.lang.String nodesysdescription)
setSysDescriptionvoid
setSysLocation(java.lang.String nodesyslocation)
setSysLocationvoid
setSysName(java.lang.String nodesysname)
setSysNamevoid
setSysObjectId(java.lang.String nodesysoid)
setSysObjectIdvoid
setType(OnmsNode.NodeType nodetype)
setTypejava.lang.String
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, java.lang.String label)
Constructor for OnmsNode.
- Parameters:
location
- The location where this node is locatedlabel
- The node label
-
-
Method Detail
-
getId
public java.lang.Integer getId()
Unique identifier for node.- Returns:
- a
Integer
object.
-
getNodeId
public java.lang.String getNodeId()
getNodeId
- Returns:
- a
String
object.
-
setId
public void setId(java.lang.Integer nodeid)
setId
- Parameters:
nodeid
- aInteger
object.
-
setNodeId
public void setNodeId(java.lang.String nodeid)
setNodeId
- Parameters:
nodeid
- aString
object.
-
getCreateTime
public java.util.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(java.util.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 java.lang.String getSysObjectId()
SNMP MIB-2 system.sysObjectID.0- Returns:
- a
String
object.
-
setSysObjectId
public void setSysObjectId(java.lang.String nodesysoid)
setSysObjectId
- Parameters:
nodesysoid
- aString
object.
-
getSysName
public java.lang.String getSysName()
SNMP MIB-2 system.sysName.0- Returns:
- a
String
object.
-
setSysName
public void setSysName(java.lang.String nodesysname)
setSysName
- Parameters:
nodesysname
- aString
object.
-
getHasFlows
public boolean getHasFlows()
-
getHasIngressFlows
public boolean getHasIngressFlows()
-
getHasEgressFlows
public boolean getHasEgressFlows()
-
getLastIngressFlow
public java.util.Date getLastIngressFlow()
-
setLastIngressFlow
public void setLastIngressFlow(java.util.Date lastIngressFlow)
-
getLastEgressFlow
public java.util.Date getLastEgressFlow()
-
setLastEgressFlow
public void setLastEgressFlow(java.util.Date lastEgressFlow)
-
getSysDescription
public java.lang.String getSysDescription()
SNMP MIB-2 system.sysDescr.0- Returns:
- a
String
object.
-
setSysDescription
public void setSysDescription(java.lang.String nodesysdescription)
setSysDescription
- Parameters:
nodesysdescription
- aString
object.
-
getSysLocation
public java.lang.String getSysLocation()
SNMP MIB-2 system.sysLocation.0- Returns:
- a
String
object.
-
setSysLocation
public void setSysLocation(java.lang.String nodesyslocation)
setSysLocation
- Parameters:
nodesyslocation
- aString
object.
-
getSysContact
public java.lang.String getSysContact()
SNMP MIB-2 system.sysContact.0- Returns:
- a
String
object.
-
setSysContact
public void setSysContact(java.lang.String nodesyscontact)
setSysContact
- Parameters:
nodesyscontact
- aString
object.
-
getLabel
public java.lang.String getLabel()
User-friendly name associated with the node.- Returns:
- a
String
object.
-
setLabel
public void setLabel(java.lang.String nodelabel)
setLabel
- Parameters:
nodelabel
- aString
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 java.lang.String getNetBiosName()
NetBIOS workstation name associated with the node.- Returns:
- a
String
object.
-
setNetBiosName
public void setNetBiosName(java.lang.String nodenetbiosname)
setNetBiosName
- Parameters:
nodenetbiosname
- aString
object.
-
getNetBiosDomain
public java.lang.String getNetBiosDomain()
NetBIOS domain name associated with the node.- Returns:
- a
String
object.
-
setNetBiosDomain
public void setNetBiosDomain(java.lang.String nodedomainname)
setNetBiosDomain
- Parameters:
nodedomainname
- aString
object.
-
getOperatingSystem
public java.lang.String getOperatingSystem()
Operating system running on the node.- Returns:
- a
String
object.
-
setOperatingSystem
public void setOperatingSystem(java.lang.String operatingsystem)
setOperatingSystem
- Parameters:
operatingsystem
- aString
object.
-
getLastCapsdPoll
public java.util.Date getLastCapsdPoll()
Date and time of last Capsd scan.- Returns:
- a
Date
object.
-
setLastCapsdPoll
public void setLastCapsdPoll(java.util.Date lastcapsdpoll)
setLastCapsdPoll
- Parameters:
lastcapsdpoll
- aDate
object.
-
getForeignId
public java.lang.String getForeignId()
getForeignId
- Returns:
- a
String
object.
-
setForeignId
public void setForeignId(java.lang.String foreignId)
setForeignId
- Parameters:
foreignId
- aString
object.
-
getForeignSource
public java.lang.String getForeignSource()
getForeignSource
- Returns:
- a
String
object.
-
setForeignSource
public void setForeignSource(java.lang.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 java.util.Set<OnmsIpInterface> getIpInterfaces()
The interfaces on this node- Returns:
- a
Set
object.
-
setIpInterfaces
public void setIpInterfaces(java.util.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 java.util.Set<OnmsSnmpInterface> getSnmpInterfaces()
The information from the SNMP interfaces/ipAddrTables for the node- Returns:
- a
Set
object.
-
setSnmpInterfaces
public void setSnmpInterfaces(java.util.Set<OnmsSnmpInterface> snmpinterfaces)
setSnmpInterfaces
- Parameters:
snmpinterfaces
- aSet
object.
-
getCategories
public java.util.Set<OnmsCategory> getCategories()
getCategories
- Returns:
- a
Set
object.
-
setCategories
public void setCategories(java.util.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(java.lang.String categoryName)
hasCategory
- Parameters:
categoryName
- aString
object.- Returns:
- a boolean.
-
getRequisitionedCategories
public java.util.Set<java.lang.String> getRequisitionedCategories()
-
setRequisitionedCategories
public void setRequisitionedCategories(java.util.Set<java.lang.String> categories)
-
addRequisitionedCategory
public void addRequisitionedCategory(java.lang.String category)
-
removeRequisitionedCategory
public void removeRequisitionedCategory(java.lang.String category)
-
getMetaData
public java.util.List<OnmsMetaData> getMetaData()
-
findMetaDataForContextAndKey
public java.util.Optional<OnmsMetaData> findMetaDataForContextAndKey(java.lang.String context, java.lang.String key)
-
setMetaData
public void setMetaData(java.util.List<OnmsMetaData> metaData)
-
addMetaData
public void addMetaData(java.lang.String context, java.lang.String key, java.lang.String value)
-
removeMetaData
public void removeMetaData(java.lang.String context, java.lang.String key)
-
removeMetaData
public void removeMetaData(java.lang.String context)
-
getRequisitionedMetaData
public java.util.List<OnmsMetaData> getRequisitionedMetaData()
-
setRequisionedMetaData
public void setRequisionedMetaData(java.util.List<OnmsMetaData> requisitionedMetaData)
-
addRequisionedMetaData
public void addRequisionedMetaData(OnmsMetaData onmsMetaData)
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
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(java.lang.String ipAddress)
getIpInterfaceByIpAddress
- Parameters:
ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
getIpInterfaceByIpAddress
public OnmsIpInterface getIpInterfaceByIpAddress(java.net.InetAddress ipAddress)
getIpInterfaceByIpAddress
- Parameters:
ipAddress
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
compareTo
public int compareTo(OnmsNode o)
compareTo
-
getPrimaryInterface
public OnmsIpInterface getPrimaryInterface()
getPrimaryInterface
This function should be kept similar toIpInterfaceDao#findPrimaryInterfaceByNodeId()
.- Returns:
- a
OnmsIpInterface
object.
-
getInterfaceWithService
public OnmsIpInterface getInterfaceWithService(java.lang.String svcName)
getInterfaceWithService
- Parameters:
svcName
- aString
object.- Returns:
- a
OnmsIpInterface
object.
-
getInterfacesWithService
public java.util.List<OnmsIpInterface> getInterfacesWithService(java.lang.String svcName)
getInterfacesWithService
- Parameters:
svcName
- aString
object.- Returns:
- a List of
OnmsIpInterface
objects.
-
getInterfaceWithAddress
public OnmsIpInterface getInterfaceWithAddress(java.net.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(java.net.InetAddress addr, java.lang.String service)
-
containsInterface
public boolean containsInterface(java.net.InetAddress addr)
-
-