|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.capsd.AbstractPlugin
org.opennms.netmgt.capsd.IcmpPlugin
This class provides Capsd with the ability to check for ICMP support on new interfaces as them are passed into the system. In order to minimize the number of sockets and threads, this class creates a daemon thread to handle all responses and a single socket for sending echo request to various hosts.
Nested Class Summary | |
private static class |
IcmpPlugin.Ping
This class is used to encapsulate a ping request. |
Field Summary | |
private static int |
DEFAULT_RETRY
Default retries. |
private static int |
DEFAULT_TIMEOUT
Default timeout. |
private static short |
FILTER_ID
The filter identifier for the ping reply receiver |
private static IcmpSocket |
m_icmpSock
The ICMP socket used to send/receive replies |
private static ReplyReceiver |
m_receiver
The singular reply receiver |
private static short |
m_seqid
The sequence number for pings |
private static java.util.Map |
m_waiting
The set used to lookup thread identifiers The map of long thread identifiers to Packets that must be signaled. |
private static java.lang.Thread |
m_worker
The thread used to receive and process replies. |
private static java.lang.String |
PROTOCOL_NAME
The name of the protocol that is supported by this plugin |
Constructor Summary | |
IcmpPlugin()
Construts a new monitor. |
Method Summary | |
private static java.net.DatagramPacket |
getDatagram(java.net.InetAddress addr,
long tid)
Builds a datagram compatable with the ping ReplyReceiver class. |
java.lang.String |
getProtocolName()
Returns the name of the protocol that this plugin checks on the target system for support. |
private boolean |
isPingable(java.net.InetAddress ipv4Addr,
int retries,
long timeout)
This method is used to ping a remote host to test for ICMP support. |
boolean |
isProtocolSupported(java.net.InetAddress address)
Returns true if the protocol defined by this plugin is supported. |
boolean |
isProtocolSupported(java.net.InetAddress address,
java.util.Map qualifiers)
Returns true if the protocol defined by this plugin is supported. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String PROTOCOL_NAME
private static final int DEFAULT_RETRY
private static final int DEFAULT_TIMEOUT
private static final short FILTER_ID
private static short m_seqid
private static ReplyReceiver m_receiver
private static IcmpSocket m_icmpSock
private static java.util.Map m_waiting
Reply
class.
private static java.lang.Thread m_worker
Constructor Detail |
public IcmpPlugin() throws java.io.IOException
Method Detail |
private static java.net.DatagramPacket getDatagram(java.net.InetAddress addr, long tid)
private boolean isPingable(java.net.InetAddress ipv4Addr, int retries, long timeout)
ipv4Addr
- The address to poll.retries
- The number of times to retrytimeout
- The time to wait between each retry.
public java.lang.String getProtocolName()
getProtocolName
in interface Plugin
getProtocolName
in class AbstractPlugin
public boolean isProtocolSupported(java.net.InetAddress address)
isProtocolSupported
in interface Plugin
isProtocolSupported
in class AbstractPlugin
address
- The address to check for support.
public boolean isProtocolSupported(java.net.InetAddress address, java.util.Map qualifiers)
isProtocolSupported
in interface Plugin
isProtocolSupported
in class AbstractPlugin
address
- The address to check for support.qualifiers
- The map where qualification are set by the plugin.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |