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 Summary
Constructors 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 Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
collect()
boolean
equals(java.lang.Object obj)
java.lang.String
getInfo()
getInfojava.lang.String
getLocation()
LocationAwareSnmpClient
getLocationAwareSnmpClient()
Node
getNode()
int
getNodeId()
java.net.InetAddress
getPrimaryIpAddress()
Returns the target address that the collection occurred for.java.lang.String
getPrimaryIpAddressString()
SnmpAgentConfig
getSnmpAgentConfig()
java.lang.String
getSysname()
java.lang.String
getSysoid()
int
hashCode()
void
runDiscovery()
Performs the collection for the targeted IP address.-
Methods inherited from class org.opennms.netmgt.enlinkd.common.Discovery
getInitialSleepTime, getName, getPollInterval, getScheduler, isReady, run, schedule, setInitialSleepTime, setPollInterval, setScheduler, suspend, unschedule, wakeUp
-
-
-
-
Field Detail
-
m_node
protected final Node m_node
The node ID of the system used to collect the SNMP information
-
-
Constructor Detail
-
NodeCollector
public 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 therun
method is invoked.- Parameters:
nodeid
-config
- The SnmpPeer object to collect from.
-
-
Method Detail
-
collect
public abstract void collect()
-
runDiscovery
public void runDiscovery()
Performs the collection for the targeted IP address. The success or failure of the collection should be tested via the
failed
method.No synchronization is performed, so if this is used in a separate thread context synchronization must be added.
- Specified by:
runDiscovery
in classDiscovery
-
getPrimaryIpAddress
public java.net.InetAddress getPrimaryIpAddress()
Returns the target address that the collection occurred for.- Returns:
- a
InetAddress
object.
-
getPrimaryIpAddressString
public java.lang.String getPrimaryIpAddressString()
-
getInfo
public java.lang.String getInfo()
Description copied from class:Discovery
getInfo
-
getNodeId
public int getNodeId()
-
getSysoid
public java.lang.String getSysoid()
-
getSysname
public java.lang.String getSysname()
-
getLocation
public java.lang.String getLocation()
-
getSnmpAgentConfig
public SnmpAgentConfig getSnmpAgentConfig()
-
getLocationAwareSnmpClient
public LocationAwareSnmpClient getLocationAwareSnmpClient()
-
getNode
public Node getNode()
-
-