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

java.lang.Object
  extended by org.opennms.netmgt.poller.remote.support.DefaultPollerBackEnd
All Implemented Interfaces:
SpringServiceDaemon, PollerBackEnd, org.springframework.beans.factory.InitializingBean

public class DefaultPollerBackEnd
extends Object
implements PollerBackEnd, SpringServiceDaemon

Author:
Mathew Brozowski, DJ Gregor

Constructor Summary
DefaultPollerBackEnd()
           
 
Method Summary
 void afterPropertiesSet()
           
 void checkForDisconnectedMonitors()
           
 void configurationUpdated()
           
 Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()
          Return the set of available MonitoringLocationDefinitions
 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 pollResult)
          Report a poll result from the client to the server.
 void setDisconnectedTimeout(int disconnectedTimeout)
           
 void setEventIpcManager(EventIpcManager eventIpcManager)
           
 void setLocationMonitorDao(LocationMonitorDao locMonDao)
           
 void setMonitoredServiceDao(MonitoredServiceDao monSvcDao)
           
 void setPollerConfig(PollerConfig pollerConfig)
           
 void setTimeKeeper(TimeKeeper timeKeeper)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPollerBackEnd

public DefaultPollerBackEnd()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface SpringServiceDaemon
Throws:
Exception

checkForDisconnectedMonitors

public void checkForDisconnectedMonitors()
Specified by:
checkForDisconnectedMonitors in interface PollerBackEnd

configurationUpdated

public void configurationUpdated()
Specified by:
configurationUpdated in interface PollerBackEnd

getMonitoringLocations

public Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()
Description copied from interface: PollerBackEnd
Return the set of available MonitoringLocationDefinitions

Specified by:
getMonitoringLocations in interface PollerBackEnd

getMonitorName

public String getMonitorName(int locationMonitorId)
Description copied from interface: PollerBackEnd
Get monitor name

Specified by:
getMonitorName in interface PollerBackEnd

getPollerConfiguration

public PollerConfiguration getPollerConfiguration(int locationMonitorId)
Description copied from interface: PollerBackEnd
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)
Description copied from interface: PollerBackEnd
Get service monitor locators for creating serviceMonitors for the poller.

Specified by:
getServiceMonitorLocators in interface PollerBackEnd

pollerCheckingIn

public OnmsLocationMonitor.MonitorStatus pollerCheckingIn(int locationMonitorId,
                                                          Date currentConfigurationVersion)
Description copied from interface: PollerBackEnd
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)
Description copied from interface: PollerBackEnd
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

pollerStopping

public void pollerStopping(int locationMonitorId)
Description copied from interface: PollerBackEnd
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)
Description copied from interface: PollerBackEnd
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 pollResult)
Description copied from interface: PollerBackEnd
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

setDisconnectedTimeout

public void setDisconnectedTimeout(int disconnectedTimeout)

setEventIpcManager

public void setEventIpcManager(EventIpcManager eventIpcManager)

setLocationMonitorDao

public void setLocationMonitorDao(LocationMonitorDao locMonDao)

setMonitoredServiceDao

public void setMonitoredServiceDao(MonitoredServiceDao monSvcDao)

setPollerConfig

public void setPollerConfig(PollerConfig pollerConfig)

setTimeKeeper

public void setTimeKeeper(TimeKeeper timeKeeper)


Copyright © 2009. All Rights Reserved.