Class RrdGraphHelper
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.dashlets.RrdGraphHelper
-
public class RrdGraphHelper extends java.lang.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 java.lang.String
getGraphNameFromQuery(java.lang.String query)
Parses the name of the graph from the given query string.java.util.Map<java.lang.String,java.lang.String>
getGraphNameTitleMappingForResourceId(ResourceId resourceId)
Returns the graph entries name/title mapping for a given resourceId.java.util.Map<java.lang.String,java.lang.String>
getGraphResultsForResourceId(ResourceId resourceId)
Returns the graph entries for a given resourceId.java.util.Map<java.lang.String,java.lang.String>
getGraphTitleNameMappingForResourceId(ResourceId resourceId)
Returns the graph entries title/name mapping for a given resourceId.java.util.List<OnmsNode>
getNodesWithResources()
Returns a list of nodes with resourcesjava.util.Map<OnmsResourceType,java.util.List<OnmsResource>>
getResourceTypeMapForNodeId(int nodeId)
Returns a map of resources for a given resourceType.java.util.Map<OnmsResourceType,java.util.List<OnmsResource>>
getResourceTypeMapForNodeId(java.lang.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 java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.String> getGraphResultsForResourceId(ResourceId resourceId)
Returns the graph entries for a given resourceId.- Parameters:
resourceId
- the resourceId- Returns:
- a map of graphs found
-
getResourceTypeMapForNodeId
public java.util.Map<OnmsResourceType,java.util.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 java.util.Map<OnmsResourceType,java.util.List<OnmsResource>> getResourceTypeMapForNodeId(java.lang.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 java.util.List<OnmsNode> getNodesWithResources()
Returns a list of nodes with resources- Returns:
- a list of nodes
-
getGraphNameFromQuery
public static java.lang.String getGraphNameFromQuery(java.lang.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
-
-