OpenNMS API 1.2.3

org.opennms.netmgt.capsd
Class HttpPlugin

java.lang.Object
  extended byorg.opennms.netmgt.capsd.AbstractPlugin
      extended byorg.opennms.netmgt.capsd.AbstractTcpPlugin
          extended byorg.opennms.netmgt.capsd.HttpPlugin
All Implemented Interfaces:
Plugin
Direct Known Subclasses:
HttpsPlugin, NotesHttpPlugin

public class HttpPlugin
extends AbstractTcpPlugin

This class is designed to be used by the capabilities daemon to test for the existance of an HTTP server on remote interfaces. The class implements the Plugin interface that allows it to be used along with other plugins by the daemon. This plugin generates a HTTP GET request and checks the return code returned by the remote host to determine if it supports the protocol. The remote host's response will be deemed valid if the return code falls in the 100 to 599 range (inclusive). This is based on the following information from RFC 1945 (HTTP 1.0) HTTP 1.0 GET return codes: 1xx: Informational - Not used, future use 2xx: Success 3xx: Redirection 4xx: Client error 5xx: Server error

This plugin generates a HTTP GET request and checks the return code returned by the remote host to determine if it supports the protocol. The remote host's response will be deemed valid if the return code falls in the 100 to 599 range (inclusive). This is based on the following information from RFC 1945 (HTTP 1.0) HTTP 1.0 GET return codes: 1xx: Informational - Not used, future use 2xx: Success 3xx: Redirection 4xx: Client error 5xx: Server error

This plugin generates a HTTP GET request and checks the return code returned by the remote host to determine if it supports the protocol. The remote host's response will be deemed valid if the return code falls in the 100 to 599 range (inclusive). This is based on the following information from RFC 1945 (HTTP 1.0) HTTP 1.0 GET return codes: 1xx: Informational - Not used, future use 2xx: Success 3xx: Redirection 4xx: Client error 5xx: Server error

Version:
1.1.1.1
Author:
Sowmya , Weaver , OpenNMS

Field Summary
static boolean CHECK_RETURN_CODE
          Boolean indicating whether to check for a return code
private static int[] DEFAULT_PORTS
           The default ports on which the host is checked to see if it supports HTTP.
private static int DEFAULT_RETRY
          Default number of retries for HTTP requests.
private static int DEFAULT_TIMEOUT
          Default timeout (in milliseconds) for HTTP requests.
private  boolean m_checkReturnCode
          Boolean indicating whether to check for a return code
private  int[] m_defaultPorts
          The default ports to check on a server
private  java.lang.String m_queryString
          The query to send to the HTTP server
private  java.lang.String m_responseString
          A string to look for in the response from the server
static java.lang.String PROTOCOL_NAME
           
static java.lang.String QUERY_STRING
          The query to send to the HTTP server
static java.lang.String RESPONSE_STRING
          A string to look for in the response from the server
 
Fields inherited from class org.opennms.netmgt.capsd.AbstractTcpPlugin
m_defaultPort, m_defaultRetry, m_defaultTimeout, m_pluginName, m_protocolName
 
Constructor Summary
  HttpPlugin()
           
protected HttpPlugin(java.lang.String protocolName, boolean checkReturnCode, java.lang.String queryString, java.lang.String responseString)
           
protected HttpPlugin(java.lang.String protocolName, boolean checkReturnCode, java.lang.String queryString, java.lang.String responseString, int[] defaultPorts)
           
 
Method Summary
protected  boolean checkProtocol(java.net.Socket socket, ConnectionConfig config)
           
protected  java.util.List getConnectionConfigList(java.util.Map qualifiers, java.net.InetAddress address)
           
 
Methods inherited from class org.opennms.netmgt.capsd.AbstractTcpPlugin
checkConnection, closeSocket, createConnectionConfig, getKeyedInteger, getKeyedIntegerArray, getPluginName, getProtocolName, isProtocolSupported, isProtocolSupported, populateConnectionConfig, preconnectCheck, saveConfig, saveKeyedInteger, setPluginName, wrapSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECK_RETURN_CODE

public static final boolean CHECK_RETURN_CODE
Boolean indicating whether to check for a return code

See Also:
Constant Field Values

DEFAULT_PORTS

private static final int[] DEFAULT_PORTS

The default ports on which the host is checked to see if it supports HTTP.


DEFAULT_RETRY

private static final int DEFAULT_RETRY
Default number of retries for HTTP requests.

See Also:
Constant Field Values

DEFAULT_TIMEOUT

private static final int DEFAULT_TIMEOUT
Default timeout (in milliseconds) for HTTP requests.

See Also:
Constant Field Values

PROTOCOL_NAME

public static final java.lang.String PROTOCOL_NAME
See Also:
Constant Field Values

QUERY_STRING

public static final java.lang.String QUERY_STRING
The query to send to the HTTP server

See Also:
Constant Field Values

RESPONSE_STRING

public static final java.lang.String RESPONSE_STRING
A string to look for in the response from the server

See Also:
Constant Field Values

m_checkReturnCode

private boolean m_checkReturnCode
Boolean indicating whether to check for a return code


m_defaultPorts

private int[] m_defaultPorts
The default ports to check on a server


m_queryString

private java.lang.String m_queryString
The query to send to the HTTP server


m_responseString

private java.lang.String m_responseString
A string to look for in the response from the server

Constructor Detail

HttpPlugin

public HttpPlugin()

HttpPlugin

protected HttpPlugin(java.lang.String protocolName,
                     boolean checkReturnCode,
                     java.lang.String queryString,
                     java.lang.String responseString)

HttpPlugin

protected HttpPlugin(java.lang.String protocolName,
                     boolean checkReturnCode,
                     java.lang.String queryString,
                     java.lang.String responseString,
                     int[] defaultPorts)
Method Detail

checkProtocol

protected boolean checkProtocol(java.net.Socket socket,
                                ConnectionConfig config)
                         throws java.io.IOException
Specified by:
checkProtocol in class AbstractTcpPlugin
Returns:
Throws:
java.io.IOException

getConnectionConfigList

protected java.util.List getConnectionConfigList(java.util.Map qualifiers,
                                                 java.net.InetAddress address)
Overrides:
getConnectionConfigList in class AbstractTcpPlugin

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.