Class DefaultSurveillanceViewService

  • All Implemented Interfaces:
    SurveillanceViewService

    public class DefaultSurveillanceViewService
    extends java.lang.Object
    implements SurveillanceViewService
    Service class that encapsulate helper methods for surveillance views.
    Author:
    Christian Pape
    • Constructor Detail

      • DefaultSurveillanceViewService

        public DefaultSurveillanceViewService()
    • Method Detail

      • setNodeDao

        public void setNodeDao​(NodeDao nodeDao)
        Method to set the node dao.
        Parameters:
        nodeDao - the NodeDao to be used
      • setMonitoredServiceDao

        public void setMonitoredServiceDao​(MonitoredServiceDao monitoredServiceDao)
        Method to set the monitored service dao.
        Parameters:
        monitoredServiceDao - the MonitoredServiceDao to be used
      • setResourceDao

        public void setResourceDao​(ResourceDao resourceDao)
        Method to set the resource dao.
        Parameters:
        resourceDao - the ResourceDao to be used
      • setGraphDao

        public void setGraphDao​(GraphDao graphDao)
        Method to set the graph dao.
        Parameters:
        graphDao - the GraphDao to be used
      • setNotificationDao

        public void setNotificationDao​(NotificationDao notificationDao)
        Method to set the notification dao.
        Parameters:
        notificationDao - the NotificationDao to be used
      • setCategoryDao

        public void setCategoryDao​(CategoryDao categoryDao)
        Method to set the category dao.
        Parameters:
        categoryDao - the CategoryDao to be used
      • setAlarmDao

        public void setAlarmDao​(AlarmDao alarmDao)
        Method to set the alarm dao.
        Parameters:
        alarmDao - the AlarmDao to be used
      • setGroupDao

        public void setGroupDao​(GroupDao groupDao)
        Method to set the group dao.
        Parameters:
        groupDao - the GroupDao to be used
      • setOutageDao

        public void setOutageDao​(OutageDao outageDao)
        Method to set the outage dao.
        Parameters:
        outageDao - the OutageDao to be used
      • setTransactionOperations

        public void setTransactionOperations​(org.springframework.transaction.support.TransactionOperations transactionOperations)
        Method to set the transaction operations instance
        Parameters:
        transactionOperations -
      • getOnmsCategoriesFromViewCategories

        public java.util.Set<OnmsCategory> getOnmsCategoriesFromViewCategories​(java.util.Collection<Category> viewCats)
        Returns a list of OpenNMS categories for a given collection of view categories
        Specified by:
        getOnmsCategoriesFromViewCategories in interface SurveillanceViewService
        Parameters:
        viewCats - the categories to search for
        Returns:
        the set of OpenNMS categories
      • getNodesForCategories

        public java.util.List<OnmsNode> getNodesForCategories​(java.util.Set<OnmsCategory> rowCategories,
                                                              java.util.Set<OnmsCategory> colCategories)
        Returns the list of OpenNMS node instances for a given set of row and column categories.
        Specified by:
        getNodesForCategories in interface SurveillanceViewService
        Parameters:
        rowCategories - the row categories
        colCategories - the column categories
        Returns:
        the list of nodes found
      • getAlarmsForCategories

        public java.util.List<OnmsAlarm> getAlarmsForCategories​(java.util.Set<OnmsCategory> rowCategories,
                                                                java.util.Set<OnmsCategory> colCategories)
        Returns the list of OpenNMS alarm instances for a given set of row and column categories.
        Specified by:
        getAlarmsForCategories in interface SurveillanceViewService
        Parameters:
        rowCategories - the row categories
        colCategories - the column categories
        Returns:
        the list of alarms found
      • getNotificationsForCategories

        public java.util.List<OnmsNotification> getNotificationsForCategories​(java.util.Set<OnmsCategory> rowCategories,
                                                                              java.util.Set<OnmsCategory> colCategories,
                                                                              java.util.Map<OnmsNotification,​java.lang.String> customSeverity)
        Returns the list og OpenNMS notification instacnes for a given set of row and column categories.
        Specified by:
        getNotificationsForCategories in interface SurveillanceViewService
        Parameters:
        rowCategories - the row categories
        colCategories - the column categories
        customSeverity - the custom severity to be used
        Returns:
        a list of notifications found
      • getResourceTypeMapForNodeId

        public java.util.Map<OnmsResourceType,​java.util.List<OnmsResource>> getResourceTypeMapForNodeId​(int nodeId)
        Returns a map of OpenNMS resource type/resource mappings for a given node id.
        Specified by:
        getResourceTypeMapForNodeId in interface SurveillanceViewService
        Parameters:
        nodeId - the node id to search resources for
        Returns:
        the mappings of resource types and resources
      • getResourceTypeMapForNodeId

        public java.util.Map<OnmsResourceType,​java.util.List<OnmsResource>> getResourceTypeMapForNodeId​(java.lang.String nodeId)
        Returns a map of OpenNMS resource type/resource mappings for a given node id.
        Specified by:
        getResourceTypeMapForNodeId in interface SurveillanceViewService
        Parameters:
        nodeId - the node id to search resources for
        Returns:
        the mappings of resource types and resources
      • getGraphResultsForResourceId

        public java.util.Map<java.lang.String,​java.lang.String> getGraphResultsForResourceId​(ResourceId resourceId)
        Returns a map of graphs for a given resource id.
        Specified by:
        getGraphResultsForResourceId in interface SurveillanceViewService
        Parameters:
        resourceId - the resource id to search graphs for
        Returns:
        the map of graphs
      • selectDefaultViewForUsername

        public View selectDefaultViewForUsername​(java.lang.String username)
        Returns the default view for a given username.

        1. If a view which name equals the username exists it will be returned 2. If a view which name equals the user's group exists it will be returned 3. the default view defined by the default-view attribute will be returned

        Specified by:
        selectDefaultViewForUsername in interface SurveillanceViewService
        Parameters:
        username - the username to be used
        Returns:
        the default view for this user
      • getExecutorService

        public com.google.common.util.concurrent.ListeningExecutorService getExecutorService()
        Returns the executor pool.
        Specified by:
        getExecutorService in interface SurveillanceViewService
        Returns:
        the executor service pool