|
OpenNMS API 1.2.9 | |||||||||
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.NsclientPlugin
This class is designed to be used by the capabilities daemon to test whether a NSClient service is running on the remote server and if the given command can be successfully executed against the service.
Field Summary | |
private static int |
DEFAULT_RETRY
Default number of retries for TCP requests. |
private static int |
DEFAULT_TIMEOUT
Default timeout (in milliseconds) for TCP requests. |
private static java.lang.String |
PROTOCOL_NAME
The protocol supported by the plugin |
Constructor Summary | |
NsclientPlugin()
|
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 NsclientPacket |
isServer(java.net.InetAddress host,
int port,
java.lang.String command,
int retries,
int timeout,
NsclientCheckParams params)
Test to see if the paassed host-port pair is an endpoint for a TCP 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 NsclientPlugin()
Method Detail |
public java.lang.String getProtocolName()
getProtocolName
in interface Plugin
getProtocolName
in class AbstractPlugin
public boolean isProtocolSupported(java.net.InetAddress address)
The NsclientPlugin does not support undirected checks, we must have a map of parameters to determine how to issue a check to the target server.
isProtocolSupported
in interface Plugin
isProtocolSupported
in class AbstractPlugin
address
- 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)
The following parameters are used by this plugin:
NsclientPacket.RES_STATE_OK
or
NsclientPacket.RES_STATE_WARNING
.
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.
private NsclientPacket isServer(java.net.InetAddress host, int port, java.lang.String command, int retries, int timeout, NsclientCheckParams params)
Test to see if the paassed host-port pair is an endpoint for a TCP server. If there is a TCP server at the destination value then a connection is made using the params variable data and a check is requested from the remote NSClient service.
host
- The remote host to connect to.port
- The remote port on the host.command
- The command to execute on the remote server.retries
- The number of retries to attempt when connecting.timeout
- The TCP socket timeout to use.params
- The NSClient parameters used to validate the response.
|
OpenNMS API 1.2.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |