OpenNMS API 1.2.9

## org.opennms.netmgt.capsd
Class NtpPlugin

    java.lang.Object
      org.opennms.netmgt.capsd.AbstractPlugin
          org.opennms.netmgt.capsd.NtpPlugin

All Implemented Interfaces:
  Plugin

public final class NtpPlugin
extends AbstractPlugin

This plugin is used to check a host for NTP (Network Time Protocol) support. This is done by contacting the specified host on UDP port 123 and making a tie request. If a valid response is returned then the server is considered an NTP server.

Author:
  mhuot , Sowmya , Weave , OpenNMS

Field Summary
`private static int` `DEFAULT_PORT` The default port on which the host is checked to see if it supports NTP.
`private static int` `DEFAULT_RETRY` Default number of retries for DNS requests
`private static int` `DEFAULT_TIMEOUT` Default timeout (in milliseconds) for DNS requests.
`private static java.lang.String` `PROTOCOL_NAME` The protocol name that is tested by this plugin.

Constructor Summary
`NtpPlugin()`

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 nserver, int port, int retries, int timeout)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PROTOCOL_NAME

    private static final java.lang.String PROTOCOL_NAME

  The protocol name that is tested by this 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 NTP.

  See Also:
    Constant Field Values

### DEFAULT_RETRY

    private static final int DEFAULT_RETRY

  Default number of retries for DNS requests

  See Also:
    Constant Field Values

### DEFAULT_TIMEOUT

    private static final int DEFAULT_TIMEOUT

  Default timeout (in milliseconds) for DNS requests.

  See Also:
    Constant Field Values

Constructor Detail

### NtpPlugin

    public NtpPlugin()

Method Detail

### isServer

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

  Parameters:
    `nserver` - The address for the NTP server test.
    `port` - The port to test for NTP
    `timeout` - Timeout in milliseconds
  Returns:
    True if server, false if not.

### 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.

  In addition, the input qualifiers map also provides information about how the plugin should contact the remote server. The plugin may check the qualifier map for specific elements and then adjust its behavior as necessary

  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.9

Generated by ranger on May 19 2007 2335.