org.opennms.web.svclayer.support
Class DefaultDistributedStatusService

java.lang.Object
  extended by org.opennms.web.svclayer.support.DefaultDistributedStatusService
All Implemented Interfaces:
DistributedStatusService, org.springframework.beans.factory.InitializingBean

public class DefaultDistributedStatusService
extends Object
implements DistributedStatusService, org.springframework.beans.factory.InitializingBean

Author:
DJ Gregor, Mathew Brozowski, Jeff Gehlbach

Nested Class Summary
static class DefaultDistributedStatusService.LocationStatusComparator
           
static class DefaultDistributedStatusService.MonitoredServiceComparator
           
static class DefaultDistributedStatusService.ServiceGraphComparator
          Comparator for ServiceGraph objects.
static class DefaultDistributedStatusService.Severity
           
 
Constructor Summary
DefaultDistributedStatusService()
           
 
Method Summary
 void afterPropertiesSet()
           
 DefaultDistributedStatusService.Severity calculateCurrentStatus(Collection<OnmsLocationMonitor> monitors, Collection<OnmsMonitoredService> applicationServices, Collection<OnmsLocationSpecificStatus> statuses)
           
 DefaultDistributedStatusService.Severity calculateCurrentStatus(OnmsLocationMonitor monitor, Collection<OnmsMonitoredService> applicationServices, Collection<OnmsLocationSpecificStatus> statuses)
           
 String calculatePercentageUptime(Collection<OnmsMonitoredService> applicationServices, Collection<OnmsLocationSpecificStatus> statuses, Date startDate, Date endDate)
          Calculate the percentage of time that all services are up for this application on this remote monitor.
 DefaultDistributedStatusService.Severity calculateStatus(Collection<PollStatus> pollStatuses)
           
 SimpleWebTable createFacilityStatusTable(Date start, Date end)
           
 DistributedStatusHistoryModel createHistoryModel(String locationName, String monitorId, String applicationName, String timeSpan, String previousLocationName)
           
 SimpleWebTable createStatusTable(DistributedStatusDetailsCommand command, org.springframework.validation.Errors errors)
           
protected  List<OnmsLocationSpecificStatus> findLocationSpecificStatus(DistributedStatusDetailsCommand command, org.springframework.validation.Errors errors)
           
 int getApplicationCount()
           
 GraphDao getGraphDao()
           
 ResourceDao getResourceDao()
           
 boolean isLayoutApplicationsVertically()
           
 void setApplicationDao(ApplicationDao applicationDao)
           
 void setGraphDao(GraphDao graphDao)
           
 void setLayoutApplicationsVertically(boolean layoutApplicationsVertically)
           
 void setLocationMonitorDao(LocationMonitorDao locationMonitorDao)
           
 void setMonitoredServiceDao(MonitoredServiceDao monitoredServiceDao)
           
 void setResourceDao(ResourceDao resourceDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDistributedStatusService

public DefaultDistributedStatusService()
Method Detail

getApplicationCount

public int getApplicationCount()
Specified by:
getApplicationCount in interface DistributedStatusService

createStatusTable

public SimpleWebTable createStatusTable(DistributedStatusDetailsCommand command,
                                        org.springframework.validation.Errors errors)
Specified by:
createStatusTable in interface DistributedStatusService

findLocationSpecificStatus

protected List<OnmsLocationSpecificStatus> findLocationSpecificStatus(DistributedStatusDetailsCommand command,
                                                                      org.springframework.validation.Errors errors)

createFacilityStatusTable

public SimpleWebTable createFacilityStatusTable(Date start,
                                                Date end)
Specified by:
createFacilityStatusTable in interface DistributedStatusService

calculateCurrentStatus

public DefaultDistributedStatusService.Severity calculateCurrentStatus(Collection<OnmsLocationMonitor> monitors,
                                                                       Collection<OnmsMonitoredService> applicationServices,
                                                                       Collection<OnmsLocationSpecificStatus> statuses)

calculateCurrentStatus

public DefaultDistributedStatusService.Severity calculateCurrentStatus(OnmsLocationMonitor monitor,
                                                                       Collection<OnmsMonitoredService> applicationServices,
                                                                       Collection<OnmsLocationSpecificStatus> statuses)

calculateStatus

public DefaultDistributedStatusService.Severity calculateStatus(Collection<PollStatus> pollStatuses)

calculatePercentageUptime

public String calculatePercentageUptime(Collection<OnmsMonitoredService> applicationServices,
                                        Collection<OnmsLocationSpecificStatus> statuses,
                                        Date startDate,
                                        Date endDate)
Calculate the percentage of time that all services are up for this application on this remote monitor.

Parameters:
applicationServices - services to report on
statuses - status entries to use for report
startDate - start date. The report starts on this date.
endDate - end date. The report ends the last millisecond prior this date.
Returns:
representation of the percentage uptime out to three decimal places. Null is returned if there is no data.

createHistoryModel

public DistributedStatusHistoryModel createHistoryModel(String locationName,
                                                        String monitorId,
                                                        String applicationName,
                                                        String timeSpan,
                                                        String previousLocationName)
Specified by:
createHistoryModel in interface DistributedStatusService

afterPropertiesSet

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

setMonitoredServiceDao

public void setMonitoredServiceDao(MonitoredServiceDao monitoredServiceDao)

setLocationMonitorDao

public void setLocationMonitorDao(LocationMonitorDao locationMonitorDao)

setApplicationDao

public void setApplicationDao(ApplicationDao applicationDao)

getResourceDao

public ResourceDao getResourceDao()

setResourceDao

public void setResourceDao(ResourceDao resourceDao)

getGraphDao

public GraphDao getGraphDao()

setGraphDao

public void setGraphDao(GraphDao graphDao)

setLayoutApplicationsVertically

public void setLayoutApplicationsVertically(boolean layoutApplicationsVertically)

isLayoutApplicationsVertically

public boolean isLayoutApplicationsVertically()


Copyright © 2009. All Rights Reserved.