|
|||||||||
| 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.AbstractTcpPlugin
org.opennms.netmgt.capsd.plugins.HttpPlugin
public class HttpPlugin
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
| Field Summary | |
|---|---|
static boolean |
CHECK_RETURN_CODE
Boolean indicating whether to check for a return code |
static String |
DEFAULT_URL
The query to send to the HTTP server |
protected static String |
PROPERTY_NAME_MAX_RET_CODE
|
protected static String |
PROPERTY_NAME_PORT
|
protected static String |
PROPERTY_NAME_RESPONSE_TEXT
|
protected static String |
PROPERTY_NAME_RETURN_CODE
|
protected static String |
PROPERTY_NAME_URL
|
static String |
PROTOCOL_NAME
|
static String |
QUERY_STRING
The query to send to the HTTP server |
static String |
RESPONSE_STRING
A string to look for in the response from the server |
| Constructor Summary | |
|---|---|
|
HttpPlugin()
|
protected |
HttpPlugin(String protocolName,
boolean checkReturnCode,
String queryString,
String responseString)
|
protected |
HttpPlugin(String protocolName,
boolean checkReturnCode,
String queryString,
String responseString,
int[] defaultPorts)
|
| Method Summary | |
|---|---|
protected boolean |
checkProtocol(Socket socket,
ConnectionConfig config)
|
protected boolean |
checkResponseBody(ConnectionConfig config,
String response)
Checks the response body as a substring or regular expression match according to the leading-tilde convention |
protected List<ConnectionConfig> |
getConnectionConfigList(Map<String,Object> qualifiers,
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 |
|---|
protected static final String PROPERTY_NAME_PORT
protected static final String PROPERTY_NAME_MAX_RET_CODE
protected static final String PROPERTY_NAME_RETURN_CODE
protected static final String PROPERTY_NAME_URL
protected static final String PROPERTY_NAME_RESPONSE_TEXT
public static final boolean CHECK_RETURN_CODE
public static final String PROTOCOL_NAME
public static final String QUERY_STRING
public static final String DEFAULT_URL
public static final String RESPONSE_STRING
| Constructor Detail |
|---|
public HttpPlugin()
protocol - defaultPort - defaultTimeout - defaultRetries -
protected HttpPlugin(String protocolName,
boolean checkReturnCode,
String queryString,
String responseString)
protected HttpPlugin(String protocolName,
boolean checkReturnCode,
String queryString,
String responseString,
int[] defaultPorts)
| Method Detail |
|---|
protected boolean checkProtocol(Socket socket,
ConnectionConfig config)
throws IOException
checkProtocol in class AbstractTcpPluginsChannel - isAServer -
IOException
protected List<ConnectionConfig> getConnectionConfigList(Map<String,Object> qualifiers,
InetAddress address)
getConnectionConfigList in class AbstractTcpPlugin
protected boolean checkResponseBody(ConnectionConfig config,
String response)
config - ConnectionConfig object from which response-text property is extractedresponse - Body of HTTP response to check
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||