OpenNMS API 1.2.9

## org.opennms.web.graph
Class RRDGraphServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.opennms.web.graph.RRDGraphServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RRDGraphServlet
extends javax.servlet.http.HttpServlet

A servlet that creates a graph of network performance data using the RRDTool .

This servlet executes an rrdtool graph command in another process, piping its PNG file to standard out. The servlet then reads that PNG file and returns it on the `ServletOutputStream`.

This servlet requires the following parameters:

- report The name of the key in the rrdtool-graph properties file that contains information (including the command line options) to execute specific graph query.
- rrd The name of the ".rrd" file to graph. The file must exist in the input directory specified in the rrdtool-graph properties file.
- start The start time.
- end The end time.

Author:
  Lawrence Karnowski , OpenNMS
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` `commandPrefix` The prefix for the RRDtool command (including the executable's pathname) as specified in the rrdtool-graph properties file.
`protected java.lang.String` `mimeType` The mime type of the image we will return.
`protected java.util.Map` `reportMap` Holds the graph definitions specified in the rrdtool-graph properties file.
`private static long` `serialVersionUID`
`protected java.io.File` `workDir` The working directory as specifed in the rrdtool-graph properties file.

Fields inherited from class javax.servlet.http.HttpServlet
``

Fields inherited from class javax.servlet.GenericServlet
``

Constructor Summary
`RRDGraphServlet()`

Method Summary
`protected java.lang.String` `createPrefabCommand(javax.servlet.http.HttpServletRequest request, java.lang.String reportName, java.lang.String[] rrds, java.lang.String propertiesFile, java.lang.String start, java.lang.String end)`
`void` `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Checks the parameters passed to this servlet, and if all are okay, executes the RRDTool command in another process and pipes its PNG output to the `ServletOutputStream` back to the requesting web browser.
`void` `init()` Initializes this servlet by reading the rrdtool-graph properties file.

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

### workDir

    protected java.io.File workDir

  The working directory as specifed in the rrdtool-graph properties file.

### commandPrefix

    protected java.lang.String commandPrefix

  The prefix for the RRDtool command (including the executable's pathname) as specified in the rrdtool-graph properties file.

### mimeType

    protected java.lang.String mimeType

  The mime type of the image we will return.

### reportMap

    protected java.util.Map reportMap

  Holds the graph definitions specified in the rrdtool-graph properties file. It maps report names to `PrefabGraph`instances.

Constructor Detail

### RRDGraphServlet

    public RRDGraphServlet()

Method Detail

### init

    public void init()
              throws javax.servlet.ServletException

  Initializes this servlet by reading the rrdtool-graph properties file.

  Throws:
    `javax.servlet.ServletException`

### doGet

    public void doGet(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException

  Checks the parameters passed to this servlet, and if all are okay, executes the RRDTool command in another process and pipes its PNG output to the `ServletOutputStream` back to the requesting web browser.

  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

### createPrefabCommand

    protected java.lang.String createPrefabCommand(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.String reportName,
                                                   java.lang.String[] rrds,
                                                   java.lang.String propertiesFile,
                                                   java.lang.String start,
                                                   java.lang.String end)
                                            throws javax.servlet.ServletException

  Throws:
    `javax.servlet.ServletException`

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.