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 classOnmsNode.NodeLabelSourcestatic classOnmsNode.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 booleanaddCategory(OnmsCategory category)addCategoryvoidaddIpInterface(OnmsIpInterface iface)addIpInterfacevoidaddMetaData(String context, String key, String value)voidaddRequisionedMetaData(OnmsMetaData onmsMetaData)voidaddRequisitionedCategory(String category)voidaddSnmpInterface(OnmsSnmpInterface snmpIface)addSnmpInterfaceintcompareTo(OnmsNode o)compareTobooleancontainsInterface(InetAddress addr)booleancontainsService(InetAddress addr, String service)Optional<OnmsMetaData>findMetaDataForContextAndKey(String context, String key)OnmsAssetRecordgetAssetRecord()The assert record associated with this nodeSet<OnmsCategory>getCategories()getCategoriesDategetCreateTime()Time node was added to the database.OnmsIpInterfacegetCriticalInterface()getCriticalInterfaceStringgetForeignId()getForeignIdStringgetForeignSource()getForeignSourcebooleangetHasEgressFlows()booleangetHasFlows()booleangetHasIngressFlows()IntegergetId()Unique identifier for node.List<OnmsIpInterface>getInterfacesWithService(String svcName)getInterfacesWithServiceOnmsIpInterfacegetInterfaceWithAddress(InetAddress addr)OnmsIpInterfacegetInterfaceWithService(String svcName)getInterfaceWithServiceOnmsIpInterfacegetIpInterfaceByIpAddress(String ipAddress)getIpInterfaceByIpAddressOnmsIpInterfacegetIpInterfaceByIpAddress(InetAddress ipAddress)getIpInterfaceByIpAddressSet<OnmsIpInterface>getIpInterfaces()The interfaces on this nodeStringgetLabel()User-friendly name associated with the node.OnmsNode.NodeLabelSourcegetLabelSource()Flag indicating source of nodeLabel - 'U' = user defined - 'H' = IP hostname - 'S' = sysName - 'A' = IP address TODO: change this to an enumDategetLastCapsdPoll()Date and time of last Capsd scan.DategetLastEgressFlow()DategetLastIngressFlow()OnmsMonitoringLocationgetLocation()Monitoring location that this node is located in.List<OnmsMetaData>getMetaData()StringgetNetBiosDomain()NetBIOS domain name associated with the node.StringgetNetBiosName()NetBIOS workstation name associated with the node.StringgetNodeId()getNodeIdStringgetOperatingSystem()Operating system running on the node.OnmsNodegetParent()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.PathElementgetPathElement()getPathElementOnmsIpInterfacegetPrimaryInterface()getPrimaryInterfaceSet<String>getRequisitionedCategories()List<OnmsMetaData>getRequisitionedMetaData()Set<OnmsSnmpInterface>getSnmpInterfaces()The information from the SNMP interfaces/ipAddrTables for the nodeOnmsSnmpInterfacegetSnmpInterfaceWithIfIndex(int ifIndex)getSnmpInterfaceWithIfIndexStringgetSysContact()SNMP MIB-2 system.sysContact.0StringgetSysDescription()SNMP MIB-2 system.sysDescr.0StringgetSysLocation()SNMP MIB-2 system.sysLocation.0StringgetSysName()SNMP MIB-2 system.sysName.0StringgetSysObjectId()SNMP MIB-2 system.sysObjectID.0OnmsNode.NodeTypegetType()Flag indicating status of node - 'A' - active - 'D' - deleted TODO: Eventually this will be deprecated and deleted nodes will actually be deleted.booleanhasCategory(String categoryName)hasCategorybooleanisDown()isDownvoidmergeAgentAttributes(OnmsNode scannedNode)mergeAgentAttributesvoidmergeAssets(OnmsNode scannedNode)Truly merges the node's assert recordvoidmergeCategorySet(OnmsNode scannedNode)mergeCategorySetvoidmergeIpInterfaces(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)mergeIpInterfacesvoidmergeMetaData(OnmsNode scanned)Truly merges the node's meta-datavoidmergeNode(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)mergeNodevoidmergeNodeAttributes(OnmsNode scannedNode, EventForwarder eventForwarder)mergeNodeAttributesvoidmergeSnmpInterfaces(OnmsNode scannedNode, boolean deleteMissing)mergeSnmpInterfacesbooleanremoveCategory(OnmsCategory category)removeCategoryvoidremoveIpInterface(OnmsIpInterface iface)voidremoveMetaData(String context)voidremoveMetaData(String context, String key)voidremoveRequisitionedCategory(String category)voidreplaceCurrentAssetRecord(OnmsNode scannedNode)Simply replaces the current asset record with the new recordvoidsetAssetRecord(OnmsAssetRecord asset)setAssetRecordvoidsetCategories(Set<OnmsCategory> categories)setCategoriesvoidsetCreateTime(Date nodecreatetime)setCreateTimevoidsetForeignId(String foreignId)setForeignIdvoidsetForeignSource(String foreignSource)setForeignSourcevoidsetId(Integer nodeid)setIdvoidsetIpInterfaces(Set<OnmsIpInterface> ipinterfaces)setIpInterfacesvoidsetLabel(String nodelabel)setLabelvoidsetLabelSource(OnmsNode.NodeLabelSource nodelabelsource)setLabelSourcevoidsetLastCapsdPoll(Date lastcapsdpoll)setLastCapsdPollvoidsetLastEgressFlow(Date lastEgressFlow)voidsetLastIngressFlow(Date lastIngressFlow)voidsetLocation(OnmsMonitoringLocation location)Set the monitoring location that this node is located in.voidsetMetaData(List<OnmsMetaData> metaData)voidsetNetBiosDomain(String nodedomainname)setNetBiosDomainvoidsetNetBiosName(String nodenetbiosname)setNetBiosNamevoidsetNodeId(String nodeid)setNodeIdvoidsetOperatingSystem(String operatingsystem)setOperatingSystemvoidsetParent(OnmsNode parent)setParentvoidsetPathElement(PathElement pathElement)setPathElementvoidsetRequisionedMetaData(List<OnmsMetaData> requisitionedMetaData)voidsetRequisitionedCategories(Set<String> categories)voidsetSnmpInterfaces(Set<OnmsSnmpInterface> snmpinterfaces)setSnmpInterfacesvoidsetSysContact(String nodesyscontact)setSysContactvoidsetSysDescription(String nodesysdescription)setSysDescriptionvoidsetSysLocation(String nodesyslocation)setSysLocationvoidsetSysName(String nodesysname)setSysNamevoidsetSysObjectId(String nodesysoid)setSysObjectIdvoidsetType(OnmsNode.NodeType nodetype)setTypeStringtoString()toStringvoidvisit(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
OnmsNodein the database. It does not associate theOnmsNodewith 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
Dateobject. - Hibernate property:
- column="nodecreatetime" length="8" not-null="true"
-
setCreateTime
public void setCreateTime(Date nodecreatetime)
setCreateTime
- Parameters:
nodecreatetime- aDateobject.
-
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
OnmsNodeobject.
-
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
Stringobject.
-
setType
public void setType(OnmsNode.NodeType nodetype)
setType
- Parameters:
nodetype- aStringobject.
-
getSysObjectId
public String getSysObjectId()
SNMP MIB-2 system.sysObjectID.0- Returns:
- a
Stringobject.
-
setSysObjectId
public void setSysObjectId(String nodesysoid)
setSysObjectId
- Parameters:
nodesysoid- aStringobject.
-
setSysName
public void setSysName(String nodesysname)
setSysName
- Parameters:
nodesysname- aStringobject.
-
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
Stringobject.
-
setSysDescription
public void setSysDescription(String nodesysdescription)
setSysDescription
- Parameters:
nodesysdescription- aStringobject.
-
getSysLocation
public String getSysLocation()
SNMP MIB-2 system.sysLocation.0- Returns:
- a
Stringobject.
-
setSysLocation
public void setSysLocation(String nodesyslocation)
setSysLocation
- Parameters:
nodesyslocation- aStringobject.
-
getSysContact
public String getSysContact()
SNMP MIB-2 system.sysContact.0- Returns:
- a
Stringobject.
-
setSysContact
public void setSysContact(String nodesyscontact)
setSysContact
- Parameters:
nodesyscontact- aStringobject.
-
getLabel
public String getLabel()
User-friendly name associated with the node.- Returns:
- a
Stringobject.
-
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
Stringobject.
-
setLabelSource
public void setLabelSource(OnmsNode.NodeLabelSource nodelabelsource)
setLabelSource
- Parameters:
nodelabelsource- aStringobject.
-
getNetBiosName
public String getNetBiosName()
NetBIOS workstation name associated with the node.- Returns:
- a
Stringobject.
-
setNetBiosName
public void setNetBiosName(String nodenetbiosname)
setNetBiosName
- Parameters:
nodenetbiosname- aStringobject.
-
getNetBiosDomain
public String getNetBiosDomain()
NetBIOS domain name associated with the node.- Returns:
- a
Stringobject.
-
setNetBiosDomain
public void setNetBiosDomain(String nodedomainname)
setNetBiosDomain
- Parameters:
nodedomainname- aStringobject.
-
getOperatingSystem
public String getOperatingSystem()
Operating system running on the node.- Returns:
- a
Stringobject.
-
setOperatingSystem
public void setOperatingSystem(String operatingsystem)
setOperatingSystem
- Parameters:
operatingsystem- aStringobject.
-
getLastCapsdPoll
public Date getLastCapsdPoll()
Date and time of last Capsd scan.- Returns:
- a
Dateobject.
-
setLastCapsdPoll
public void setLastCapsdPoll(Date lastcapsdpoll)
setLastCapsdPoll
- Parameters:
lastcapsdpoll- aDateobject.
-
setForeignId
public void setForeignId(String foreignId)
setForeignId
- Parameters:
foreignId- aStringobject.
-
setForeignSource
public void setForeignSource(String foreignSource)
setForeignSource
- Parameters:
foreignSource- aStringobject.
-
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
OnmsAssetRecordobject.
-
setAssetRecord
public void setAssetRecord(OnmsAssetRecord asset)
setAssetRecord
- Parameters:
asset- aOnmsAssetRecordobject.
-
getPathElement
public PathElement getPathElement()
getPathElement
- Returns:
- a
PathElementobject.
-
setPathElement
public void setPathElement(PathElement pathElement)
setPathElement
- Parameters:
pathElement- aPathElementobject.
-
getIpInterfaces
public Set<OnmsIpInterface> getIpInterfaces()
The interfaces on this node- Returns:
- a
Setobject.
-
setIpInterfaces
public void setIpInterfaces(Set<OnmsIpInterface> ipinterfaces)
setIpInterfaces
- Parameters:
ipinterfaces- aSetobject.
-
addIpInterface
public void addIpInterface(OnmsIpInterface iface)
addIpInterface
- Parameters:
iface- aOnmsIpInterfaceobject.
-
removeIpInterface
public void removeIpInterface(OnmsIpInterface iface)
-
getSnmpInterfaces
public Set<OnmsSnmpInterface> getSnmpInterfaces()
The information from the SNMP interfaces/ipAddrTables for the node- Returns:
- a
Setobject.
-
setSnmpInterfaces
public void setSnmpInterfaces(Set<OnmsSnmpInterface> snmpinterfaces)
setSnmpInterfaces
- Parameters:
snmpinterfaces- aSetobject.
-
getCategories
public Set<OnmsCategory> getCategories()
getCategories
- Returns:
- a
Setobject.
-
setCategories
public void setCategories(Set<OnmsCategory> categories)
setCategories
- Parameters:
categories- aSetobject.
-
addCategory
public boolean addCategory(OnmsCategory category)
addCategory
- Parameters:
category- aOnmsCategoryobject.- Returns:
- a boolean.
-
removeCategory
public boolean removeCategory(OnmsCategory category)
removeCategory
- Parameters:
category- aOnmsCategoryobject.- Returns:
- a boolean.
-
hasCategory
public boolean hasCategory(String categoryName)
hasCategory
- Parameters:
categoryName- aStringobject.- 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:
visitin classOnmsEntity- Parameters:
visitor- aEntityVisitorobject.
-
addSnmpInterface
public void addSnmpInterface(OnmsSnmpInterface snmpIface)
addSnmpInterface
- Parameters:
snmpIface- aOnmsSnmpInterfaceobject.
-
isDown
public boolean isDown()
isDown
- Returns:
- a boolean.
-
getSnmpInterfaceWithIfIndex
public OnmsSnmpInterface getSnmpInterfaceWithIfIndex(int ifIndex)
getSnmpInterfaceWithIfIndex
- Parameters:
ifIndex- a int.- Returns:
- a
OnmsSnmpInterfaceobject.
-
getIpInterfaceByIpAddress
public OnmsIpInterface getIpInterfaceByIpAddress(String ipAddress)
getIpInterfaceByIpAddress
- Parameters:
ipAddress- aStringobject.- Returns:
- a
OnmsIpInterfaceobject.
-
getIpInterfaceByIpAddress
public OnmsIpInterface getIpInterfaceByIpAddress(InetAddress ipAddress)
getIpInterfaceByIpAddress
- Parameters:
ipAddress- aStringobject.- Returns:
- a
OnmsIpInterfaceobject.
-
compareTo
public int compareTo(OnmsNode o)
compareTo
- Specified by:
compareToin interfaceComparable<OnmsNode>- Parameters:
o- aOnmsNodeobject.- Returns:
- a int.
-
getPrimaryInterface
public OnmsIpInterface getPrimaryInterface()
getPrimaryInterface
This function should be kept similar toIpInterfaceDao#findPrimaryInterfaceByNodeId().- Returns:
- a
OnmsIpInterfaceobject.
-
getInterfaceWithService
public OnmsIpInterface getInterfaceWithService(String svcName)
getInterfaceWithService
- Parameters:
svcName- aStringobject.- Returns:
- a
OnmsIpInterfaceobject.
-
getInterfacesWithService
public List<OnmsIpInterface> getInterfacesWithService(String svcName)
getInterfacesWithService
- Parameters:
svcName- aStringobject.- Returns:
- a List of
OnmsIpInterfaceobjects.
-
getInterfaceWithAddress
public OnmsIpInterface getInterfaceWithAddress(InetAddress addr)
-
getCriticalInterface
public OnmsIpInterface getCriticalInterface()
getCriticalInterface
- Returns:
- a
OnmsIpInterfaceobject.
-
mergeAgentAttributes
public void mergeAgentAttributes(OnmsNode scannedNode)
mergeAgentAttributes
- Parameters:
scannedNode- aOnmsNodeobject.
-
mergeNodeAttributes
public void mergeNodeAttributes(OnmsNode scannedNode, EventForwarder eventForwarder)
mergeNodeAttributes
- Parameters:
scannedNode- aOnmsNodeobject.
-
mergeSnmpInterfaces
public void mergeSnmpInterfaces(OnmsNode scannedNode, boolean deleteMissing)
mergeSnmpInterfaces
- Parameters:
scannedNode- aOnmsNodeobject.deleteMissing- a boolean.
-
mergeIpInterfaces
public void mergeIpInterfaces(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeIpInterfaces
- Parameters:
scannedNode- aOnmsNodeobject.eventForwarder- aEventForwarderobject.deleteMissing- a boolean.
-
mergeCategorySet
public void mergeCategorySet(OnmsNode scannedNode)
mergeCategorySet
- Parameters:
scannedNode- aOnmsNodeobject.
-
mergeAssets
public void mergeAssets(OnmsNode scannedNode)
Truly merges the node's assert record- Parameters:
scannedNode- aOnmsNodeobject.
-
mergeMetaData
public void mergeMetaData(OnmsNode scanned)
Truly merges the node's meta-data- Parameters:
scannedNode- aOnmsNodeobject.
-
replaceCurrentAssetRecord
public void replaceCurrentAssetRecord(OnmsNode scannedNode)
Simply replaces the current asset record with the new record- Parameters:
scannedNode- aOnmsNodeobject.
-
mergeNode
public void mergeNode(OnmsNode scannedNode, EventForwarder eventForwarder, boolean deleteMissing)
mergeNode
- Parameters:
scannedNode- aOnmsNodeobject.eventForwarder- aEventForwarderobject.deleteMissing- a boolean.
-
containsService
public boolean containsService(InetAddress addr, String service)
-
containsInterface
public boolean containsInterface(InetAddress addr)
-
-