public abstract class ChartServlet extends ImageServlet
This servlet returns a response that contains the binary data of an image (JPEG or PNG) that can be viewed in a web browser.
The chart servlet takes the following parameters (any applicable defaults are in bold and required parameters are in italics):
| key | value |
|---|---|
| measurementUnits | <MeasurementUnits.NONE> |
| showPeak | (false | true) |
| showHighRange | (false | true) |
| showValues | (false | true) |
| showAverage | (false | true) |
| showLowRange | (false | true) |
| showLow | (false | true) |
| showBaseline | (false | true) |
| baseline* | <double> |
| highRange* | <double> |
| lowRange* | <double> |
* only used and required if corresponding showXXX parameter is true
| Modifier and Type | Field and Description |
|---|---|
static String |
BASELINE_PARAM
Request parameter for baseline.
|
static String |
HIGHRANGE_PARAM
Request parameter for baseline.
|
static int |
IMAGE_HEIGHT_DEFAULT
Default image height.
|
static int |
IMAGE_WIDTH_DEFAULT
Default image width.
|
static String |
LOWRANGE_PARAM
Request parameter for baseline.
|
static String |
MEASUREMENT_UNITS_PARAM |
static String |
SHOW_AVERAGE_PARAM
Request parameter for whether or not to show average.
|
static String |
SHOW_BASELINE_PARAM
Request parameter for whether or not to show baseline.
|
static String |
SHOW_HIGHRANGE_PARAM
Request parameter for whether or not to show high range.
|
static String |
SHOW_LOW_PARAM
Request parameter for whether or not to show the low.
|
static String |
SHOW_LOWRANGE_PARAM
Request parameter for whether or not to show low range.
|
static String |
SHOW_PEAK_PARAM
Request parameter for whether or not to show the peak.
|
static String |
SHOW_VALUES_PARAM
Request parameter for whether or not to show the actual values.
|
protected org.rhq.core.domain.measurement.MeasurementUnits |
units |
IMAGE_FORMAT_JPEG, IMAGE_FORMAT_PARAM, IMAGE_FORMAT_PNG, IMAGE_HEIGHT_PARAM, IMAGE_WIDTH_PARAM| Constructor and Description |
|---|
ChartServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Chart |
createChart()
Create and return the chart.
|
protected Object |
createImage(javax.servlet.http.HttpServletRequest request)
Create the image being rendered.
|
protected int |
getDefaultImageHeight()
Return the default
imageHeight. |
protected int |
getDefaultImageWidth()
Return the default
imageWidth. |
protected boolean |
getDefaultShowAverage()
Return the default
showAverage. |
protected boolean |
getDefaultShowBaseline()
Return the default
showBaseline. |
protected boolean |
getDefaultShowHighRange()
Return the default
showHighRange. |
protected boolean |
getDefaultShowLow()
Return the default
showLow. |
protected boolean |
getDefaultShowLowRange()
Return the default
Range. |
protected boolean |
getDefaultShowPeak()
Return the default
showPeak. |
protected boolean |
getDefaultShowValues()
Return the default
showValues. |
boolean |
getShowAvg()
Return the value of property
showAverage. |
boolean |
getShowLow()
Return the value of property
showLow. |
boolean |
getShowPeak()
Return the value of property
showPeak. |
protected void |
initializeChart(Chart chart)
Initialize the chart.
|
protected void |
parseParameters(javax.servlet.http.HttpServletRequest request)
This method will be called automatically by the ChartServlet.
|
protected abstract void |
plotData(javax.servlet.http.HttpServletRequest request,
Chart chart)
This method will be called automatically by the ChartServlet.
|
protected void |
renderJpegImage(javax.servlet.ServletOutputStream out,
Object imgObj)
Render a JPEG version of the image into the output stream.
|
protected void |
renderPngImage(javax.servlet.ServletOutputStream out,
Object imgObj)
Render a PNG version of the image into the output stream.
|
doGet, getDefaultImageFormat, getImageFormat, getImageHeight, getImageWidth, initinvalidParamErr, invalidParamErr, invalidParamWarn, invalidParamWarn, invalidParamWarn, invalidParamWarn, invalidParamWarn, parseBooleanParameter, parseDoubleParameter, parseEnumParameter, parseIntParameter, parseLongParameter, parseRequiredBooleanParameter, parseRequiredDoubleParameter, parseRequiredIntParameter, parseRequiredLongParameter, parseRequiredStringParameter, parseRequiredStringParameter, parseStringParameter, parseStringParameter, requiredParamErrdoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic static final String MEASUREMENT_UNITS_PARAM
public static final int IMAGE_WIDTH_DEFAULT
public static final int IMAGE_HEIGHT_DEFAULT
public static final String SHOW_PEAK_PARAM
public static final String SHOW_HIGHRANGE_PARAM
public static final String SHOW_VALUES_PARAM
public static final String SHOW_AVERAGE_PARAM
public static final String SHOW_LOWRANGE_PARAM
public static final String SHOW_LOW_PARAM
public static final String SHOW_BASELINE_PARAM
public static final String BASELINE_PARAM
public static final String HIGHRANGE_PARAM
public static final String LOWRANGE_PARAM
protected org.rhq.core.domain.measurement.MeasurementUnits units
protected Object createImage(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
createImage in class ImageServletrequest - the servlet requestjavax.servlet.ServletExceptionprotected void renderPngImage(javax.servlet.ServletOutputStream out,
Object imgObj)
throws IOException
renderPngImage in class ImageServletout - the output streamIOExceptionprotected void renderJpegImage(javax.servlet.ServletOutputStream out,
Object imgObj)
throws IOException
renderJpegImage in class ImageServletout - the output streamIOExceptionprotected void parseParameters(javax.servlet.http.HttpServletRequest request)
parseParameters in class ImageServletrequest - the HTTP request objectprotected abstract Chart createChart()
protected void initializeChart(Chart chart)
chart - the chartprotected abstract void plotData(javax.servlet.http.HttpServletRequest request,
Chart chart)
throws javax.servlet.ServletException
request - the HTTP requestjavax.servlet.ServletExceptionpublic boolean getShowLow()
showLow.public boolean getShowPeak()
showPeak.public boolean getShowAvg()
showAverage.protected int getDefaultImageWidth()
imageWidth.getDefaultImageWidth in class ImageServletprotected int getDefaultImageHeight()
imageHeight.getDefaultImageHeight in class ImageServletprotected boolean getDefaultShowPeak()
showPeak.protected boolean getDefaultShowHighRange()
showHighRange.protected boolean getDefaultShowValues()
showValues.protected boolean getDefaultShowAverage()
showAverage.protected boolean getDefaultShowLowRange()
Range.protected boolean getDefaultShowLow()
showLow.protected boolean getDefaultShowBaseline()
showBaseline.Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.