org.opennms.netmgt.capsd.plugins
Class DhcpPlugin

java.lang.Object
  extended by org.opennms.netmgt.capsd.AbstractPlugin
      extended by org.opennms.netmgt.capsd.plugins.DhcpPlugin
All Implemented Interfaces:
Plugin

public final class DhcpPlugin
extends AbstractPlugin

This class is designed to be used by the capabilities daemon to test if a remote interface is running a functional DHCP server as defined by RFC 2131. This class relies on the DHCP API provided by JDHCP v1.1.1. (please refer to http://www.dhcp.org/javadhcp). The class implements the Plugin interface that allows it to be used along with other plugins by the daemon.

Author:
Mike, Weave, OpenNMS

Constructor Summary
DhcpPlugin()
           
 
Method Summary
 String getProtocolName()
          This method returns the name of the protocol supported by this plugin.
 boolean isProtocolSupported(InetAddress host)
          Returns true if the protocol defined by this plugin is supported.
 boolean isProtocolSupported(InetAddress host, Map<String,Object> 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
 

Constructor Detail

DhcpPlugin

public DhcpPlugin()
Method Detail

getProtocolName

public String getProtocolName()
This method returns the name of the protocol supported by this plugin.

Specified by:
getProtocolName in interface Plugin
Specified by:
getProtocolName in class AbstractPlugin
Returns:
The name of the protocol for the plugin.

isProtocolSupported

public boolean isProtocolSupported(InetAddress host)
Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. This method is used to test the passed host for DHCP server support. The remote host is queried using the DHCP protocol by sending a formatted datagram to the DHCP server port. If a response is received by the DHCP listenter that matches our original request then a value of true is returned to the caller.

Specified by:
isProtocolSupported in interface Plugin
Specified by:
isProtocolSupported in class AbstractPlugin
Parameters:
host - The address to check for support.
Returns:
True if the protocol is supported by the address.

isProtocolSupported

public boolean isProtocolSupported(InetAddress host,
                                   Map<String,Object> qualifiers)
Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. The qualifier map passed to the method is used by the plugin to return additional information by key-name. These key-value pairs can be added to service events if needed. Returns true if the protocol defined by this plugin is supported. If the protocol is not supported then a false value is returned to the caller. The qualifier map passed to the method is used by the plugin to return additional information by key-name. These key-value pairs can be added to service events if needed. This method is used to test the passed host for DHCP server support. The remote host is queried using the DHCP protocol by sending a formatted datagram to the DHCP server port. If a response is received by the DHCP listenter that matches our original request then a value of true is returned to the caller.

Specified by:
isProtocolSupported in interface Plugin
Specified by:
isProtocolSupported in class AbstractPlugin
Parameters:
host - The address to check for support.
qualifiers - The map where qualification are set by the plugin.
Returns:
True if the protocol is supported by the address.


Copyright © 2011. All Rights Reserved.