@Transactional public class DefaultPollerBackEnd extends Object implements PollerBackEnd, SpringServiceDaemon
DefaultPollerBackEnd class.
CONNECTION_HOST_ADDRESS_KEY, CONNECTION_HOST_NAME_KEY, HOST_ADDRESS_KEY, HOST_NAME_KEY
Constructor and Description |
---|
DefaultPollerBackEnd() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
afterPropertiesSet
|
void |
checkForDisconnectedMonitors()
checkForDisconnectedMonitors
|
void |
configurationUpdated()
configurationUpdated
|
void |
destroy()
destroy
|
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 |
saveResponseTimeData(String locationMonitor,
OnmsMonitoredService monSvc,
double responseTime,
Package pkg)
saveResponseTimeData
|
void |
setDisconnectedTimeout(int disconnectedTimeout)
setDisconnectedTimeout
|
void |
setEventIpcManager(EventIpcManager eventIpcManager)
setEventIpcManager
|
void |
setLocationMonitorDao(LocationMonitorDao locMonDao)
setLocationMonitorDao
|
void |
setMinimumConfigurationReloadInterval(long value)
setMinimumConfigurationReloadInterval
|
void |
setMonitoredServiceDao(MonitoredServiceDao monSvcDao)
setMonitoredServiceDao
|
void |
setPollerConfig(PollerConfig pollerConfig)
setPollerConfig
|
void |
setTimeKeeper(TimeKeeper timeKeeper)
setTimeKeeper
|
void |
start()
start
|
protected void |
updateConnectionHostDetails(OnmsLocationMonitor mon,
Map<String,String> pollerDetails) |
public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
- if any.public void start()
start
start
in interface SpringServiceDaemon
Exception
- if any.public void destroy()
destroy
destroy
in interface org.springframework.beans.factory.DisposableBean
public void checkForDisconnectedMonitors()
checkForDisconnectedMonitors
checkForDisconnectedMonitors
in interface PollerBackEnd
public void configurationUpdated()
configurationUpdated
configurationUpdated
in interface PollerBackEnd
@Transactional(readOnly=true) public Collection<OnmsMonitoringLocationDefinition> getMonitoringLocations()
getMonitoringLocations
getMonitoringLocations
in interface PollerBackEnd
Collection
object.@Transactional(readOnly=true) public String getMonitorName(int locationMonitorId)
getMonitorName
in interface PollerBackEnd
locationMonitorId
- a int.String
object.@Transactional(readOnly=true) public PollerConfiguration getPollerConfiguration(int locationMonitorId)
getPollerConfiguration
in interface PollerBackEnd
locationMonitorId
- the id of the requesting location monitor@Transactional(readOnly=true) public Collection<ServiceMonitorLocator> getServiceMonitorLocators(DistributionContext context)
getServiceMonitorLocators
in interface PollerBackEnd
context
- a DistributionContext
object.Collection
object.public OnmsLocationMonitor.MonitorStatus pollerCheckingIn(int locationMonitorId, Date currentConfigurationVersion)
pollerCheckingIn
in interface PollerBackEnd
locationMonitorId
- the id of the location monitor that is checking incurrentConfigurationVersion
- the version of the configuration that the location monitor is currently usingpublic boolean pollerStarting(int locationMonitorId, Map<String,String> pollerDetails)
pollerStarting
in interface PollerBackEnd
locationMonitorId
- the id of the requesting location monitorpollerDetails
- TODOprotected void updateConnectionHostDetails(OnmsLocationMonitor mon, Map<String,String> pollerDetails)
public void pollerStopping(int locationMonitorId)
pollerStopping
in interface PollerBackEnd
locationMonitorId
- the id of the requesting location monitorpublic int registerLocationMonitor(String monitoringLocationId)
registerLocationMonitor
in interface PollerBackEnd
monitoringLocationId
- the id of the monitoredLocation to associate with
this location monitorpublic void reportResult(int locationMonitorId, int serviceId, PollStatus pollResult)
reportResult
in interface PollerBackEnd
locationMonitorId
- the id of the location monitor that did the pollserviceId
- the id of the service that was polledpollResult
- a PollStatus
object.public void saveResponseTimeData(String locationMonitor, OnmsMonitoredService monSvc, double responseTime, Package pkg)
saveResponseTimeData
saveResponseTimeData
in interface PollerBackEnd
locationMonitor
- a String
object.monSvc
- a OnmsMonitoredService
object.responseTime
- a double.pkg
- a Package
object.public void setDisconnectedTimeout(int disconnectedTimeout)
setDisconnectedTimeout
disconnectedTimeout
- a int.public void setMinimumConfigurationReloadInterval(long value)
setMinimumConfigurationReloadInterval
value
- public void setEventIpcManager(EventIpcManager eventIpcManager)
setEventIpcManager
eventIpcManager
- a EventIpcManager
object.public void setLocationMonitorDao(LocationMonitorDao locMonDao)
setLocationMonitorDao
locMonDao
- a LocationMonitorDao
object.public void setMonitoredServiceDao(MonitoredServiceDao monSvcDao)
setMonitoredServiceDao
monSvcDao
- a MonitoredServiceDao
object.public void setPollerConfig(PollerConfig pollerConfig)
setPollerConfig
pollerConfig
- a PollerConfig
object.public void setTimeKeeper(TimeKeeper timeKeeper)
setTimeKeeper
timeKeeper
- a TimeKeeper
object.Copyright © 2015. All rights reserved.