org.opennms.netmgt.poller.monitors
Class TrivialTimeMonitor

java.lang.Object
  extended by org.opennms.netmgt.poller.monitors.IPv4Monitor
      extended by org.opennms.netmgt.poller.monitors.TrivialTimeMonitor
All Implemented Interfaces:
ServiceMonitor

@Distributable
public final class TrivialTimeMonitor
extends IPv4Monitor

This class is designed to be used by the service poller framework to test the availability of the trivial UNIX "time" service on remote interfaces. The class implements the ServiceMonitor interface that allows it to be used along with other plug-ins by the service poller framework.

Author:
Jeff Gehlbach, OpenNMS

Constructor Summary
TrivialTimeMonitor()
           
 
Method Summary
 PollStatus poll(MonitoredService svc, Map parameters)
          Poll the specified address for service availability.
 PollStatus pollTimeTcp(MonitoredService svc, Map parameters, PollStatus serviceStatus, TimeoutTracker tracker, InetAddress ipv4Addr, int port, int allowedSkew)
           
 PollStatus pollTimeUdp(MonitoredService svc, Map parameters, PollStatus serviceStatus, TimeoutTracker tracker, InetAddress ipv4Addr, int port, int allowedSkew)
           
 
Methods inherited from class org.opennms.netmgt.poller.monitors.IPv4Monitor
initialize, initialize, log, logDown, logDown, logUp, release, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrivialTimeMonitor

public TrivialTimeMonitor()
Method Detail

poll

public PollStatus poll(MonitoredService svc,
                       Map parameters)
Poll the specified address for service availability. During the poll an attempt is made to retrieve the time value from the remote system. This can be done via either TCP or UDP depending on the provided parameters (default TCP). If the time value returned is within the specified number of seconds of the local system's clock time, then the service is considered available.

Specified by:
poll in interface ServiceMonitor
Specified by:
poll in class IPv4Monitor
Parameters:
parameters - The package parameters (timeout, retry, etc...) to be used for this poll.
iface - The network interface to test the service on.
Returns:
The availability of the interface and if a transition event should be suppressed.
Throws:
RuntimeException - Thrown if the interface experiences errors during the poll.
See Also:
PollStatus.SERVICE_AVAILABLE, PollStatus.SERVICE_UNAVAILABLE

pollTimeTcp

public PollStatus pollTimeTcp(MonitoredService svc,
                              Map parameters,
                              PollStatus serviceStatus,
                              TimeoutTracker tracker,
                              InetAddress ipv4Addr,
                              int port,
                              int allowedSkew)

pollTimeUdp

public PollStatus pollTimeUdp(MonitoredService svc,
                              Map parameters,
                              PollStatus serviceStatus,
                              TimeoutTracker tracker,
                              InetAddress ipv4Addr,
                              int port,
                              int allowedSkew)


Copyright © 2009. All Rights Reserved.