Class NodeCollector
- java.lang.Object
- 
- org.opennms.netmgt.enlinkd.common.Discovery
- 
- org.opennms.netmgt.enlinkd.common.NodeCollector
 
 
- 
- All Implemented Interfaces:
- java.lang.Runnable,- ReadyRunnable
 - Direct Known Subclasses:
- NodeDiscoveryBridge,- NodeDiscoveryCdp,- NodeDiscoveryIpNetToMedia,- NodeDiscoveryIsis,- NodeDiscoveryLldp,- NodeDiscoveryOspf
 
 public abstract class NodeCollector extends Discovery This class is designed to collect the necessary SNMP information from the target address and store the collected information. When the class is initially constructed no information is collected. The SNMP Session creating and collection occurs in the main run method of the instance. This allows the collection to occur in a thread if necessary.
- 
- 
Constructor SummaryConstructors Constructor Description NodeCollector(LocationAwareSnmpClient locationAwareSnmpClient, long interval, long initial, Node node)Constructs a new SNMP collector for a node using the passed interface as the collection point.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidcollect()booleanequals(java.lang.Object obj)java.lang.StringgetInfo()getInfojava.lang.StringgetLocation()LocationAwareSnmpClientgetLocationAwareSnmpClient()NodegetNode()intgetNodeId()java.net.InetAddressgetPrimaryIpAddress()Returns the target address that the collection occurred for.java.lang.StringgetPrimaryIpAddressString()SnmpAgentConfiggetSnmpAgentConfig()java.lang.StringgetSysname()java.lang.StringgetSysoid()inthashCode()voidrunDiscovery()Performs the collection for the targeted IP address.- 
Methods inherited from class org.opennms.netmgt.enlinkd.common.DiscoverygetInitialSleepTime, getName, getPollInterval, getScheduler, isReady, run, schedule, setInitialSleepTime, setPollInterval, setScheduler, suspend, unschedule, wakeUp
 
- 
 
- 
- 
- 
Field Detail- 
m_nodeprotected final Node m_node The node ID of the system used to collect the SNMP information
 
- 
 - 
Constructor Detail- 
NodeCollectorpublic NodeCollector(LocationAwareSnmpClient locationAwareSnmpClient, long interval, long initial, Node node) Constructs a new SNMP collector for a node using the passed interface as the collection point. The collection does not occur until therunmethod is invoked.- Parameters:
- nodeid-
- config- The SnmpPeer object to collect from.
 
 
- 
 - 
Method Detail- 
collectpublic abstract void collect() 
 - 
runDiscoverypublic void runDiscovery() Performs the collection for the targeted IP address. The success or failure of the collection should be tested via the failedmethod.No synchronization is performed, so if this is used in a separate thread context synchronization must be added. - Specified by:
- runDiscoveryin class- Discovery
 
 - 
getPrimaryIpAddresspublic java.net.InetAddress getPrimaryIpAddress() Returns the target address that the collection occurred for.- Returns:
- a InetAddressobject.
 
 - 
getPrimaryIpAddressStringpublic java.lang.String getPrimaryIpAddressString() 
 - 
getInfopublic java.lang.String getInfo() Description copied from class:DiscoverygetInfo 
 - 
getNodeIdpublic int getNodeId() 
 - 
getSysoidpublic java.lang.String getSysoid() 
 - 
getSysnamepublic java.lang.String getSysname() 
 - 
getLocationpublic java.lang.String getLocation() 
 - 
getSnmpAgentConfigpublic SnmpAgentConfig getSnmpAgentConfig() 
 - 
getLocationAwareSnmpClientpublic LocationAwareSnmpClient getLocationAwareSnmpClient() 
 - 
getNodepublic Node getNode() 
 
- 
 
-