Class RrdGraphHelper
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.dashlets.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 Summary
Constructors Constructor Description RrdGraphHelper()
Default constructor for instantiating new objects
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getGraphNameFromQuery(String query)
Parses the name of the graph from the given query string.Map<String,String>
getGraphNameTitleMappingForResourceId(ResourceId resourceId)
Returns the graph entries name/title mapping for a given resourceId.Map<String,String>
getGraphResultsForResourceId(ResourceId resourceId)
Returns the graph entries for a given resourceId.Map<String,String>
getGraphTitleNameMappingForResourceId(ResourceId resourceId)
Returns the graph entries title/name mapping for a given resourceId.List<OnmsNode>
getNodesWithResources()
Returns a list of nodes with resourcesMap<OnmsResourceType,List<OnmsResource>>
getResourceTypeMapForNodeId(int nodeId)
Returns a map of resources for a given resourceType.Map<OnmsResourceType,List<OnmsResource>>
getResourceTypeMapForNodeId(String nodeId)
Returns a map of resources for a given resourceType.void
setGraphDao(GraphDao graphDao)
This method sets the graph dao.void
setNodeDao(NodeDao nodeDao)
This method sets the node dao.void
setResourceDao(ResourceDao resourceDao)
This method sets the resource dao.void
setTransactionOperations(org.springframework.transaction.support.TransactionOperations transactionOperations)
This method sets theTransactionOperations
instance.
-
-
-
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 theTransactionOperations
instance.- Parameters:
transactionOperations
- the instance to be set
-
-