|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.dp.capsd.components.CapsReader
The CapsReader class is used to query a remote host for its SNMP information and the services it supports. The SNMP data collected from the host includes:
In addition to collecting the SNMP information, each discovered interface is queried about the services it supports. The services are interogated via the plugins provided to the constructor.
Inner Class Summary | |
private class |
CapsReader.SignalAfter
The SignalAfter class is used to delay the notification of a signal until a predefined number of "signals" have occured. |
Field Summary | |
private static String |
IF_INDEX
The lookup string for looking up the value of ifIndex |
private static String |
IF_TYPE
The lookup string for looking up the value of ifType |
private static String |
IP_ADDR_ENT_ADDR
The lookup string for looking up the value of ipAdEntAddr |
private static String |
IP_ADDR_IF_INDEX
The lookup string for looking up the value of ipAdEntIfIndex |
private Set |
m_dupNodes
duplicate nodes set. |
private IfTable |
m_ifTable
The remote agents interface table. |
private IpAddrTable |
m_ipAddrTable
The remote agent's IP Address table. |
private IpNetToMediaTable |
m_ipNetToMediaTable
The remote agents Network to Media table. |
private IpRouteTable |
m_ipRouteTable
The remote agents routing information. |
private IPv4Address |
m_nodeAddress
The node address that is being queried by the reader. |
private List |
m_plugins
The list of plugin modules. |
private Dictionary |
m_services
Tracks the status of various plugin modules. |
private SnmpSession |
m_session
The SNMP session used to communicate with the remote interface. |
private SystemGroup |
m_sysGroup
The SNMP System Group information. |
Constructor Summary | |
CapsReader(String ifAddress,
List plugins,
Set dupNodes)
The class constructor used to create an instance of the CapsdReader. |
Method Summary | |
Set |
getDuplicateNodes()
Returns the duplicate nodes set. |
IPv4Address |
getIfAddress()
Returns the IP address of the host that was queried for information by the reader. |
IfTable |
getIfTable()
Returns the SNMP interface table collected from the remote host. |
private String |
getIpAddress(int ifIndex)
Returns the IP Address of the specified interface. |
IpAddrTable |
getIpAddrTable()
Returns the SNMP IP Address table from the remote host. |
IpNetToMediaTable |
getIpNetToMediaTable()
Returns the SNMP IP Network to Media table from the remote SNMP agent. |
IpRouteTable |
getIpRouteTable()
Returns the SNMP IP Route information from the remote. |
Dictionary |
getSupportedServices()
Returns the dictionary that contains the status mapping of interface address to supported protocols. |
SystemGroup |
getSystemGroup()
Returns the SNMP system group information collected from the remote host. |
private List |
ifProbe(InetAddress ifAddr)
This method is used to probe the passed interface address for service support using the currently loaded plugins. |
private void |
probe()
The probe method is used to check the remote interfaces discovered by through SNMP for service support using the registered plugins. |
void |
run()
The run method is required by the Runnable interface and actually preforms the bulk of the work for the CapsdReader object. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final String IF_INDEX
private static final String IF_TYPE
private static final String IP_ADDR_IF_INDEX
private static final String IP_ADDR_ENT_ADDR
private List m_plugins
The list of plugin modules. The list is used to query for protocol support on each discovered interface.
private IPv4Address m_nodeAddress
The node address that is being queried by the reader. The address will be tested for SNMP support and then by each of the service plugins.
private Set m_dupNodes
private SnmpSession m_session
The SNMP session used to communicate with the remote interface.
private SystemGroup m_sysGroup
The SNMP System Group information.
private IfTable m_ifTable
The remote agents interface table. This is a collection of interface entries.
private IpAddrTable m_ipAddrTable
The remote agent's IP Address table. This can be used to pair interfaces with their IP Addresses.
private IpRouteTable m_ipRouteTable
The remote agents routing information.
private IpNetToMediaTable m_ipNetToMediaTable
The remote agents Network to Media table.
private Dictionary m_services
Tracks the status of various plugin modules.
Constructor Detail |
public CapsReader(String ifAddress, List plugins, Set dupNodes)
The class constructor used to create an instance of the CapsdReader. The constructor will verify the validity of the passed address and initialize the object to query the remote host. In order to query the remote host the run method should be invoked to actually query the host.
ifAddress
- The IP Address of the remote interface.plugins
- The list of plugin modules to invoke.dupNodes
- Set of ip addresses already known to Capsd.SocketException
- Thrown if there is an error
settting up the SnmpSession to query the remote.UnknownHostException
- Thrown if a lookup
error occurs trying to resolve the address of the remote.SnmpSession
Method Detail |
private List ifProbe(InetAddress ifAddr)
This method is used to probe the passed interface address for service support using the currently loaded plugins. Each plugin is tested against the interface and a list of supported ServiceStatus objects are returned to the caller. If there are no supported services, or the plugins could not be loaded then a null object is returned.
ifAddr
- The interface address to test for services.private void probe()
The probe method is used to check the remote interfaces discovered by through SNMP for service support using the registered plugins. The list of interfaces are iterated though and probed if the interface is not unnammed (it must have an IP address bound to it).
The method modifies the serviceStatus dictionary and associates either a list of ServiceStatus information or a null with the interfaces address.
private String getIpAddress(int ifIndex)
Returns the IP Address of the specified interface. The interface is specified by the interface's index number from the remotes interface table. If no corresponding address or interface is found then a null address is returned.
ifIndex
- The interface's index number from the remote
SNMP agent.public void run()
The run method is required by the Runnable interface and actually preforms the bulk of the work for the CapsdReader object. When the run method is invoked the reader will attempt to connect to the remote host's SNMP agent, if any. While connected to the remote the MIB system group, interface table, net to media table, and other SNMP objects are collected by the reader.
Once the information has been collected by the reader the SNMP connection is closed and a set of capsd plugin checkers are run against the remote inteface(s). If there are multiple interfaces on the remote host then each interface is tried to determine what services are supported.
run
in interface Runnable
public IPv4Address getIfAddress()
Returns the IP address of the host that was queried for information by the reader.
public SystemGroup getSystemGroup()
Returns the SNMP system group information collected from the remote host. If there was an SNMP error or no agent on the remote then a null pointer is returned to the caller.
public IfTable getIfTable()
Returns the SNMP interface table collected from the remote host. If the host did not have an agent or an error occured during the collection then a null pointer is returned.
public IpAddrTable getIpAddrTable()
Returns the SNMP IP Address table from the remote host. Should and error occur or the host not have an SNMP agent then a null will be returned to the caller.
public IpRouteTable getIpRouteTable()
Returns the SNMP IP Route information from the remote. If an error should occur or the remote not have an SNMP agent then a null will be returned to the caller.
public IpNetToMediaTable getIpNetToMediaTable()
Returns the SNMP IP Network to Media table from the remote SNMP agent. If an error occurs during the collection or the remote does not have an SNMP agent then a null will be returned.
public Dictionary getSupportedServices()
Returns the dictionary that contains the status mapping of interface address to supported protocols. The dictionary key is the IP address of the interface. The mapped object is a list of supported services.
public Set getDuplicateNodes()
Returns the duplicate nodes set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |