org.opennms.netmgt.poller.remote.support
Class ExceptionProtectedPollerBackEnd

java.lang.Object
  extended by org.opennms.netmgt.poller.remote.support.ExceptionProtectedPollerBackEnd
All Implemented Interfaces:
PollerBackEnd

public class ExceptionProtectedPollerBackEnd
extends Object
implements PollerBackEnd

ExceptionProtectedPollerBackEnd. This turns all server side exceptions into RemoteAccessExceptions so the ServerUnreachableAdapter can handle the code correctly.

Version:
$Id: $
Author:
brozow

Constructor Summary
ExceptionProtectedPollerBackEnd()
           
 
Method Summary
 void checkForDisconnectedMonitors()
          checkForDisconnectedMonitors
 void configurationUpdated()
          configurationUpdated
 Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()
          getMonitoringLocations
 String getMonitorName(int locationMonitorId)
          Get monitor name
 PollerConfiguration getPollerConfiguration(int locationMonitorId)
          Gets the poller configuration assigned to this monitoring location
 Collection<ServiceMonitorLocator> getServiceMonitorLocators(DistributionContext context)
          Get service monitor locators for creating serviceMonitors for the poller.
 OnmsLocationMonitor.MonitorStatus pollerCheckingIn(int locationMonitorId, Date currentConfigurationVersion)
          Checkin with the backend to let it know that the poller is still alive and to find out if there are any configuration changes.
 boolean pollerStarting(int locationMonitorId, Map<String,String> pollerDetails)
          Notifies the backend that a registered poller is starting
 void pollerStopping(int locationMonitorId)
          Notifies the backend that a registered poller is stopping
 int registerLocationMonitor(String monitoringLocationId)
          Register a new location monitor
 void reportResult(int locationMonitorID, int serviceId, PollStatus status)
          Report a poll result from the client to the server.
 void setDelegate(PollerBackEnd delegate)
          setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionProtectedPollerBackEnd

public ExceptionProtectedPollerBackEnd()
Method Detail

setDelegate

public void setDelegate(PollerBackEnd delegate)

setDelegate

Parameters:
delegate - a PollerBackEnd object.

checkForDisconnectedMonitors

public void checkForDisconnectedMonitors()

checkForDisconnectedMonitors

Specified by:
checkForDisconnectedMonitors in interface PollerBackEnd

configurationUpdated

public void configurationUpdated()

configurationUpdated

Specified by:
configurationUpdated in interface PollerBackEnd

getMonitorName

public String getMonitorName(int locationMonitorId)
Get monitor name

Specified by:
getMonitorName in interface PollerBackEnd
Parameters:
locationMonitorId - a int.
Returns:
a String object.

getMonitoringLocations

public Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()

getMonitoringLocations

Specified by:
getMonitoringLocations in interface PollerBackEnd
Returns:
a Collection object.

getPollerConfiguration

public PollerConfiguration getPollerConfiguration(int locationMonitorId)
Gets the poller configuration assigned to this monitoring location

Specified by:
getPollerConfiguration in interface PollerBackEnd
Parameters:
locationMonitorId - the id of the requesting location monitor
Returns:
the PollerConfiguration for the indicicated location monitor

getServiceMonitorLocators

public Collection<ServiceMonitorLocator> getServiceMonitorLocators(DistributionContext context)
Get service monitor locators for creating serviceMonitors for the poller.

Specified by:
getServiceMonitorLocators in interface PollerBackEnd
Parameters:
context - a DistributionContext object.
Returns:
a Collection object.

pollerCheckingIn

public OnmsLocationMonitor.MonitorStatus pollerCheckingIn(int locationMonitorId,
                                                          Date currentConfigurationVersion)
Checkin with the backend to let it know that the poller is still alive and to find out if there are any configuration changes.

Specified by:
pollerCheckingIn in interface PollerBackEnd
Parameters:
locationMonitorId - the id of the location monitor that is checking in
currentConfigurationVersion - the version of the configuration that the location monitor is currently using
Returns:
true if the configuration should be updated.

pollerStarting

public boolean pollerStarting(int locationMonitorId,
                              Map<String,String> pollerDetails)
Notifies the backend that a registered poller is starting

Specified by:
pollerStarting in interface PollerBackEnd
Parameters:
locationMonitorId - the id of the requesting location monitor
pollerDetails - TODO
Returns:
a boolean.

pollerStopping

public void pollerStopping(int locationMonitorId)
Notifies the backend that a registered poller is stopping

Specified by:
pollerStopping in interface PollerBackEnd
Parameters:
locationMonitorId - the id of the requesting location monitor

registerLocationMonitor

public int registerLocationMonitor(String monitoringLocationId)
Register a new location monitor

Specified by:
registerLocationMonitor in interface PollerBackEnd
Parameters:
monitoringLocationId - the id of the monitoredLocation to associate with this location monitor
Returns:
the id of the new locations monitor

reportResult

public void reportResult(int locationMonitorID,
                         int serviceId,
                         PollStatus status)
Report a poll result from the client to the server.

Specified by:
reportResult in interface PollerBackEnd
Parameters:
locationMonitorID - the id of the location monitor that did the poll
serviceId - the id of the service that was polled
status - a PollStatus object.


Copyright © 2011. All Rights Reserved.