public abstract class ChartRequestHandler extends RequestHandler
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
LABEL |
MAPPER
Constructor and Description |
---|
ChartRequestHandler(java.lang.String reqType,
java.lang.String respType,
java.lang.String nodeName)
Constructs a chart model handler for a specific graph view.
|
Modifier and Type | Method and Description |
---|---|
protected ChartModel |
createChartModel()
Creates the chart model using
getSeries()
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 void |
populateChart(ChartModel cm,
com.fasterxml.jackson.databind.node.ObjectNode payload)
Subclasses should populate the chart model by adding
datapoints . |
void |
process(com.fasterxml.jackson.databind.node.ObjectNode payload)
Processes the incoming message payload from the client.
|
bool, chain, eventType, get, number, sendMessage, sendMessage, string, string
protected static final java.lang.String LABEL
public ChartRequestHandler(java.lang.String reqType, java.lang.String respType, java.lang.String nodeName)
reqType
- type of the request eventrespType
- type of the response eventnodeName
- name of JSON node holding data pointpublic void process(com.fasterxml.jackson.databind.node.ObjectNode payload)
RequestHandler
process
in class RequestHandler
payload
- request message payloadprotected ChartModel createChartModel()
getSeries()
to initialize it, ready to be populated.
This default implementation returns a chart model for all series.
protected abstract java.lang.String[] getSeries()
protected abstract void populateChart(ChartModel cm, com.fasterxml.jackson.databind.node.ObjectNode payload)
datapoints
.
cm.addDataPoint() .data(SERIES_ONE, ...) .data(SERIES_TWO, ...) ... ;The request payload is provided in case there are request filtering parameters.
cm
- the chart modelpayload
- request payload