Class RrdGraphHelper


  • public class RrdGraphHelper
    extends Object
    This helper class iterates through the resourceTypes and resources and return a list of graph urls.
    Author:
    Christian Pape
    • Constructor Detail

      • RrdGraphHelper

        public RrdGraphHelper()
        Default constructor for instantiating new objects
    • Method Detail

      • getGraphNameTitleMappingForResourceId

        public Map<String,​String> getGraphNameTitleMappingForResourceId​(ResourceId resourceId)
        Returns the graph entries name/title mapping for a given resourceId.
        Parameters:
        resourceId - the resourceId
        Returns:
        a map of names/titles found
      • getGraphTitleNameMappingForResourceId

        public Map<String,​String> getGraphTitleNameMappingForResourceId​(ResourceId resourceId)
        Returns the graph entries title/name mapping for a given resourceId.
        Parameters:
        resourceId - the resourceId
        Returns:
        a map of titles/names found
      • getGraphResultsForResourceId

        public Map<String,​String> getGraphResultsForResourceId​(ResourceId resourceId)
        Returns the graph entries for a given resourceId.
        Parameters:
        resourceId - the resourceId
        Returns:
        a map of graphs found
      • getResourceTypeMapForNodeId

        public Map<OnmsResourceType,​List<OnmsResource>> getResourceTypeMapForNodeId​(int nodeId)
        Returns a map of resources for a given resourceType.
        Parameters:
        nodeId - the nodeId to search for resourceTypes
        Returns:
        the map of resources
      • getResourceTypeMapForNodeId

        public Map<OnmsResourceType,​List<OnmsResource>> getResourceTypeMapForNodeId​(String nodeId)
        Returns a map of resources for a given resourceType.
        Parameters:
        nodeId - the nodeId to search for resourceTypes
        Returns:
        the map of resources
      • getNodesWithResources

        public List<OnmsNode> getNodesWithResources()
        Returns a list of nodes with resources
        Returns:
        a list of nodes
      • getGraphNameFromQuery

        public static String getGraphNameFromQuery​(String query)
        Parses the name of the graph from the given query string. This is used to preserve backwards compatibility with existing dashlets that store the graphUrl instead of the graphName.
      • setNodeDao

        public void setNodeDao​(NodeDao nodeDao)
        This method sets the node dao.
        Parameters:
        nodeDao - the node dao to set
      • setGraphDao

        public void setGraphDao​(GraphDao graphDao)
        This method sets the graph dao.
        Parameters:
        graphDao - the graph dao to set
      • setResourceDao

        public void setResourceDao​(ResourceDao resourceDao)
        This method sets the resource dao.
        Parameters:
        resourceDao - the resource dao to set
      • setTransactionOperations

        public void setTransactionOperations​(org.springframework.transaction.support.TransactionOperations transactionOperations)
        This method sets the TransactionOperations instance.
        Parameters:
        transactionOperations - the instance to be set