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

@Transactional
public class DefaultPollerBackEnd
extends Object
implements PollerBackEnd, SpringServiceDaemon

DefaultPollerBackEnd class.

Version:
$Id: $
Author:
Mathew Brozowski, DJ Gregor, Mathew Brozowski, DJ Gregor

Constructor Summary
DefaultPollerBackEnd()
           
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
 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 pollResult)
          Report a poll result from the client to the server.
 void setDisconnectedTimeout(int disconnectedTimeout)
          setDisconnectedTimeout
 void setEventIpcManager(EventIpcManager eventIpcManager)
          setEventIpcManager
 void setLocationMonitorDao(LocationMonitorDao locMonDao)
          setLocationMonitorDao
 void setMonitoredServiceDao(MonitoredServiceDao monSvcDao)
          setMonitoredServiceDao
 void setPollerConfig(PollerConfig pollerConfig)
          setPollerConfig
 void setTimeKeeper(TimeKeeper timeKeeper)
          setTimeKeeper
 void start()
          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

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception - if any.

start

public void start()
           throws Exception

start

Specified by:
start in interface SpringServiceDaemon
Throws:
Exception - if any.

checkForDisconnectedMonitors

public void checkForDisconnectedMonitors()

checkForDisconnectedMonitors

Specified by:
checkForDisconnectedMonitors in interface PollerBackEnd

configurationUpdated

public void configurationUpdated()

configurationUpdated

Specified by:
configurationUpdated in interface PollerBackEnd

getMonitoringLocations

@Transactional(readOnly=true)
public Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()

getMonitoringLocations

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

getMonitorName

@Transactional(readOnly=true)
public String getMonitorName(int locationMonitorId)
Get monitor name

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

getPollerConfiguration

@Transactional(readOnly=true)
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

@Transactional(readOnly=true)
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 pollResult)
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
pollResult - a PollStatus object.

setDisconnectedTimeout

public void setDisconnectedTimeout(int disconnectedTimeout)

setDisconnectedTimeout

Parameters:
disconnectedTimeout - a int.

setEventIpcManager

public void setEventIpcManager(EventIpcManager eventIpcManager)

setEventIpcManager

Parameters:
eventIpcManager - a EventIpcManager object.

setLocationMonitorDao

public void setLocationMonitorDao(LocationMonitorDao locMonDao)

setLocationMonitorDao

Parameters:
locMonDao - a LocationMonitorDao object.

setMonitoredServiceDao

public void setMonitoredServiceDao(MonitoredServiceDao monSvcDao)

setMonitoredServiceDao

Parameters:
monSvcDao - a MonitoredServiceDao object.

setPollerConfig

public void setPollerConfig(PollerConfig pollerConfig)

setPollerConfig

Parameters:
pollerConfig - a PollerConfig object.

setTimeKeeper

public void setTimeKeeper(TimeKeeper timeKeeper)

setTimeKeeper

Parameters:
timeKeeper - a TimeKeeper object.


Copyright © 2011. All Rights Reserved.