|
OpenNMS API 1.1.4 | |||||||||
| 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.GpPlugin
This class is designed to be used by the capabilities daemon to test for the existance of a generic service by calling an external script or program. The external script or program will be passed two options: --hostname, the IP address of the host to be tested, and --timeout, the timeout in seconds. Additional options or arguments can be specified in the capsd configuration.
| Field Summary | |
private static int |
DEFAULT_RETRY
Default number of retries for GP requests |
private static int |
DEFAULT_TIMEOUT
Default timeout (in milliseconds) for GP requests |
private static java.lang.String |
PROTOCOL_NAME
The protocol supported by the plugin |
| Constructor Summary | |
GpPlugin()
|
|
| Method Summary | |
java.lang.String |
getProtocolName()
Returns the name of the protocol that this plugin checks on the target system for 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. |
private boolean |
isServer(java.net.InetAddress host,
int retry,
int timeout,
java.lang.String script,
java.lang.String args,
org.apache.regexp.RE regex,
java.lang.StringBuffer bannerResult)
Test to see if the passed script-host-argument combination is the endpoint for a GP server. |
| 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
| Constructor Detail |
public GpPlugin()
| Method Detail |
private boolean isServer(java.net.InetAddress host,
int retry,
int timeout,
java.lang.String script,
java.lang.String args,
org.apache.regexp.RE regex,
java.lang.StringBuffer bannerResult)
Test to see if the passed script-host-argument combination is the endpoint for a GP server. If there is a GP server at that destination then a value of true is returned from the method. Otherwise a false value is returned to the caller. In order to return true the script must generate a banner line which contains the text from the banner or match argument.
host - The host to pass to the scriptretry - The number of retry attempts to maketimeout - The timeout value for each retryscript - The external script or program to callargs - The arguments to pass to the scriptregex - The regular expression used to determine banner matchbannerResult -
public java.lang.String getProtocolName()
getProtocolName in interface PlugingetProtocolName in class AbstractPluginpublic boolean isProtocolSupported(java.net.InetAddress address)
isProtocolSupported in interface PluginisProtocolSupported in class AbstractPluginaddress - The address to check for support.
java.lang.UnsupportedOperationException - This is always
thrown by this plugin.
public boolean isProtocolSupported(java.net.InetAddress address,
java.util.Map qualifiers)
isProtocolSupported in interface PluginisProtocolSupported in class AbstractPluginaddress - The address to check for support.qualifiers - The map where qualification are set
by the plugin.
|
OpenNMS API 1.1.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||