Class NodeCollector
- java.lang.Object
-
- org.opennms.netmgt.enlinkd.common.Discovery
-
- org.opennms.netmgt.enlinkd.common.NodeCollector
-
- All Implemented Interfaces:
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(Object obj)
String
getInfo()
getInfoString
getLocation()
LocationAwareSnmpClient
getLocationAwareSnmpClient()
Node
getNode()
int
getNodeId()
InetAddress
getPrimaryIpAddress()
Returns the target address that the collection occurred for.String
getPrimaryIpAddressString()
SnmpAgentConfig
getSnmpAgentConfig()
String
getSysname()
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 InetAddress getPrimaryIpAddress()
Returns the target address that the collection occurred for.- Returns:
- a
InetAddress
object.
-
getPrimaryIpAddressString
public String getPrimaryIpAddressString()
-
getNodeId
public int getNodeId()
-
getSysoid
public String getSysoid()
-
getSysname
public String getSysname()
-
getLocation
public String getLocation()
-
getSnmpAgentConfig
public SnmpAgentConfig getSnmpAgentConfig()
-
getLocationAwareSnmpClient
public LocationAwareSnmpClient getLocationAwareSnmpClient()
-
getNode
public Node getNode()
-
-