Package org.onosproject.ui.chart
Class ChartRequestHandler
- java.lang.Object
- 
- org.onosproject.ui.RequestHandler
- 
- org.onosproject.ui.chart.ChartRequestHandler
 
 
- 
 public abstract class ChartRequestHandler extends RequestHandler Message handler specifically for the chart views.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static java.lang.StringLABEL- 
Fields inherited from class org.onosproject.ui.RequestHandlerMAPPER
 
- 
 - 
Constructor SummaryConstructors Constructor Description ChartRequestHandler(java.lang.String reqType, java.lang.String respType, java.lang.String nodeName)Constructs a chart model handler for a specific graph view.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ChartModelcreateChartModel()Creates the chart model usinggetSeries()to initialize it, ready to be populated.protected abstract java.lang.String[]getSeries()Subclasses should return the array of series with which to initialize their chart model.protected abstract voidpopulateChart(ChartModel cm, com.fasterxml.jackson.databind.node.ObjectNode payload)Subclasses should populate the chart model by addingdatapoints.voidprocess(com.fasterxml.jackson.databind.node.ObjectNode payload)Processes the incoming message payload from the client.- 
Methods inherited from class org.onosproject.ui.RequestHandlerbool, chain, eventType, get, number, sendMessage, sendMessage, string, string
 
- 
 
- 
- 
- 
Field Detail- 
LABELprotected static final java.lang.String LABEL - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ChartRequestHandlerpublic ChartRequestHandler(java.lang.String reqType, java.lang.String respType, java.lang.String nodeName)Constructs a chart model handler for a specific graph view. When chart requests come in, the handler will generate the appropriate chart data points and send back the response to the client.- Parameters:
- reqType- type of the request event
- respType- type of the response event
- nodeName- name of JSON node holding data point
 
 
- 
 - 
Method Detail- 
processpublic void process(com.fasterxml.jackson.databind.node.ObjectNode payload) Description copied from class:RequestHandlerProcesses the incoming message payload from the client.- Specified by:
- processin class- RequestHandler
- Parameters:
- payload- request message payload
 
 - 
createChartModelprotected ChartModel createChartModel() Creates the chart model usinggetSeries()to initialize it, ready to be populated.This default implementation returns a chart model for all series. - Returns:
- an empty chart model
 
 - 
getSeriesprotected abstract java.lang.String[] getSeries() Subclasses should return the array of series with which to initialize their chart model.- Returns:
- the series name
 
 - 
populateChartprotected abstract void populateChart(ChartModel cm, com.fasterxml.jackson.databind.node.ObjectNode payload) Subclasses should populate the chart model by addingdatapoints.cm.addDataPoint() .data(SERIES_ONE, ...) .data(SERIES_TWO, ...) ... ;The request payload is provided in case there are request filtering parameters.- Parameters:
- cm- the chart model
- payload- request payload
 
 
- 
 
-