OpenNMS API 1.2.9

## org.opennms.netmgt.capsd
Class IfCollector

    java.lang.Object
      org.opennms.netmgt.capsd.IfCollector

All Implemented Interfaces:
  java.lang.Runnable

final class IfCollector
extends java.lang.Object
implements java.lang.Runnable

This class is designed to collect all the relevant information from the target designated during construction. The target is initially polled using all the configured plugins, then tested for SMB and SNMP. If either of those plugins were detected then an additional collection of the SMB/SNMP information is preformed. If any node has multiple interfaces in it then addition probes of those interfaces are performed. The SNMP/SMB collections are preformed only once though.

Author:
  Weave , OpenNMS

Nested Class Summary
`(package private) static class` `IfCollector.SupportedProtocol` This class is used to encapsulate the supported protocol information discovered for an interface.

Field Summary
`private boolean` `m_doSnmpCollection` Boolean flag which indicates if SNMP collection is to be done.
`private java.util.List` `m_nonIpInterfaces` List of SnmpInt32 objects representing each of the unnamed/non-IP interfaces found via SNMP
`private java.util.Set` `m_previouslyProbed`
`private java.util.List` `m_protocols` The list of supported protocols on this interface.
`private IfSmbCollector` `m_smbCollector` The SMB collector.
`private IfSnmpCollector` `m_snmpCollector` If the interface is determined to have SNMP capabilities then the collector is run.
`private java.util.Map` `m_subTargets` The list of sub-targets found via SNMP.
`private java.net.InetAddress` `m_target` The primary target internet address

Constructor Summary
`(package private)` `IfCollector()` Default constructor.
`(package private)` `IfCollector(java.net.InetAddress addr, boolean doSnmpCollection)` Constructs a new collector instance.
`(package private)` `IfCollector(java.net.InetAddress addr, boolean doSnmpCollection, java.util.Set previouslyProbed)`

Method Summary
`(package private) void` `deleteSnmpCollector()`
`(package private) java.util.Map` `getAdditionalTargets()` Returns the map of additional interface targets.
`(package private) java.util.List` `getNonIpInterfaces()` Returns the list of non-IP interfaces..
`(package private) IfSmbCollector` `getSmbCollector()` Returns the collected SMB information for the node.
`(package private) IfSnmpCollector` `getSnmpCollector()` Returns the Snmp Collection of information
`(package private) java.util.List` `getSupportedProtocols()` Returns the supported protocols for this interface.
`(package private) java.net.InetAddress` `getTarget()` Returns the target of this collection
`(package private) boolean` `hasAdditionalTargets()` Returns true if this target had additional interfaces found by SNMP
`(package private) boolean` `hasNonIpInterfaces()` Returns true if this target has non-IP interfaces found by SNMP
`(package private) boolean` `hasSmbCollection()` Returns true if the node supported SMB and the collection succeeded
`(package private) boolean` `hasSnmpCollection()` Returns true if the target supported SNMP and the collection succeeded.
`private static void` `probe(java.net.InetAddress target, java.util.List supports)` This method is used to probe the target addresses using the configured list of protocol specifications from the Configuration Manager.
`void` `run()` The main collection routine of the class.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_target

    private final java.net.InetAddress m_target

  The primary target internet address

### m_smbCollector

    private IfSmbCollector m_smbCollector

  The SMB collector. If the interface is determine to have SMB connectivity then the collector is run.

### m_snmpCollector

    private IfSnmpCollector m_snmpCollector

  If the interface is determined to have SNMP capabilities then the collector is run.

### m_protocols

    private java.util.List m_protocols

  The list of supported protocols on this interface.

### m_subTargets

    private java.util.Map m_subTargets

  The list of sub-targets found via SNMP. Indexed by InetAddress

### m_nonIpInterfaces

    private java.util.List m_nonIpInterfaces

  List of SnmpInt32 objects representing each of the unnamed/non-IP interfaces found via SNMP

### m_doSnmpCollection

    private boolean m_doSnmpCollection

  Boolean flag which indicates if SNMP collection is to be done.

### m_previouslyProbed

    private java.util.Set m_previouslyProbed

Constructor Detail

### IfCollector

    IfCollector()

  Default constructor. This constructor is disallowed since the collector must have a target IP address to collect on. This constructor will always throw an Unsupported Operation Exception.

### IfCollector

    IfCollector(java.net.InetAddress addr,
                boolean doSnmpCollection)

  Constructs a new collector instance. The collector's target is passed as an argument to the constructor. Very little initialization is preformed in the constructor. The main work of the class is preformed in the `run`method. This provides a well known interface that can be collected in a thread pool or directly invoked.

Parameters:
  `addr` - The target of the poll.
  `doSnmpCollection` - Flag which indicates if SNMP collection should be done.

### IfCollector

    IfCollector(java.net.InetAddress addr,
                boolean doSnmpCollection,
                java.util.Set previouslyProbed)

Method Detail

### probe

    private static void probe(java.net.InetAddress target,
                              java.util.List supports)

  This method is used to probe the target addresses using the configured list of protocol specifications from the Configuration Manager. The list of supported protocols are added to the supports list. Any failures in the plugins are logged and discarded.

  Parameters:
    `target` - The target to probe
    `supports` - The supported protocols (SupportedProtocol)

### getTarget

    java.net.InetAddress getTarget()

  Returns the target of this collection

### getSupportedProtocols

    java.util.List getSupportedProtocols()

  Returns the supported protocols for this interface.

### hasAdditionalTargets

    boolean hasAdditionalTargets()

  Returns true if this target had additional interfaces found by SNMP

### getAdditionalTargets

    java.util.Map getAdditionalTargets()

  Returns the map of additional interface targets. The keys are instances of `addresses`and the mapped values are `lists`of supported protocols.

### hasNonIpInterfaces

    boolean hasNonIpInterfaces()

  Returns true if this target has non-IP interfaces found by SNMP

### getNonIpInterfaces

    java.util.List getNonIpInterfaces()

  Returns the list of non-IP interfaces..

### hasSmbCollection

    boolean hasSmbCollection()

  Returns true if the node supported SMB and the collection succeeded

### getSmbCollector

    IfSmbCollector getSmbCollector()

  Returns the collected SMB information for the node.

### hasSnmpCollection

    boolean hasSnmpCollection()

  Returns true if the target supported SNMP and the collection succeeded.

### getSnmpCollector

    IfSnmpCollector getSnmpCollector()

  Returns the Snmp Collection of information

### deleteSnmpCollector

    void deleteSnmpCollector()

### run

    public void run()

  The main collection routine of the class. This method is used to poll the address, and any additional interfaces discovered via SNMP.

  Specified by:
    `run` in interface `java.lang.Runnable`

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.