OpenNMS API 1.2.3

org.opennms.netmgt.capsd
Class SmtpPlugin

java.lang.Object
  extended byorg.opennms.netmgt.capsd.AbstractPlugin
      extended byorg.opennms.netmgt.capsd.SmtpPlugin
All Implemented Interfaces:
Plugin

public final class SmtpPlugin
extends AbstractPlugin

This class is designed to be used by the capabilities daemon to test for the existance of an SMTP server on remote interfaces. The class implements the Plugin interface that allows it to be used along with other plugins by the daemon.

Author:
Sowmya , Weave , OpenNMS

Field Summary
private static int DEFAULT_PORT
           The default port on which the host is checked to see if it supports SMTP.
private static int DEFAULT_RETRY
          Default number of retries for SMTP requests.
private static int DEFAULT_TIMEOUT
          Default timeout (in milliseconds) for SMTP requests.
private static java.lang.String LOCALHOST_NAME
          The name of the local host.
private static org.apache.regexp.RE MULTILINE_RESULT
          The regular expression test used to determine if the reply is a multi line reply.
private static java.lang.String PROTOCOL_NAME
           The capability name of the plugin.
 
Constructor Summary
SmtpPlugin()
           
 
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 port, int retries, int timeout)
           Test to see if the passed host-port pair is the endpoint for an SMTP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MULTILINE_RESULT

private static final org.apache.regexp.RE MULTILINE_RESULT
The regular expression test used to determine if the reply is a multi line reply. A multi line reply is one that each line, but the last, is in the form of "ddd-" where 'ddd' is the result code.


PROTOCOL_NAME

private static final java.lang.String PROTOCOL_NAME

The capability name of the plugin.

See Also:
Constant Field Values

DEFAULT_PORT

private static final int DEFAULT_PORT

The default port on which the host is checked to see if it supports SMTP.

See Also:
Constant Field Values

DEFAULT_RETRY

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

See Also:
Constant Field Values

DEFAULT_TIMEOUT

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

See Also:
Constant Field Values

LOCALHOST_NAME

private static java.lang.String LOCALHOST_NAME
The name of the local host.

Constructor Detail

SmtpPlugin

public SmtpPlugin()
Method Detail

isServer

private boolean isServer(java.net.InetAddress host,
                         int port,
                         int retries,
                         int timeout)

Test to see if the passed host-port pair is the endpoint for an SMTP server. If there is an SMTP server at that destination then a value of true is returned from the method. Otherwise a false value is returned to the caller.

Parameters:
host - The remote host to connect to.
port - The remote port on the host.
Returns:
True if server supports SMTP on the specified port, false otherwise

getProtocolName

public java.lang.String getProtocolName()
Returns the name of the protocol that this plugin checks on the target system for support.

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

isProtocolSupported

public boolean isProtocolSupported(java.net.InetAddress address)
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.

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

isProtocolSupported

public boolean isProtocolSupported(java.net.InetAddress address,
                                   java.util.Map 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.

Specified by:
isProtocolSupported in interface Plugin
Specified by:
isProtocolSupported in class AbstractPlugin
Parameters:
address - 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.

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.