|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.rrd.JRobinRrdStrategy
Provides a JRobin based implementation of RrdStrategy. It uses JRobin 1.4 in FILE mode (NIO is too memory consuming for the large number of files that we open)
Field Summary | |
private boolean |
m_initialized
|
Constructor Summary | |
JRobinRrdStrategy()
|
Method Summary | |
void |
closeFile(java.lang.Object rrdFile)
Closes the JRobin RrdDb. |
java.lang.Object |
createDefinition(java.lang.String creator,
java.lang.String directory,
java.lang.String dsName,
int step,
java.lang.String dsType,
int dsHeartbeat,
java.lang.String dsMin,
java.lang.String dsMax,
java.util.List rraList)
Creates and returns a RrdDef represented by the parameters. |
void |
createFile(java.lang.Object rrdDef)
Creates the JRobin RrdDb from the def by opening the file and then closing. |
java.io.InputStream |
createGraph(java.lang.String command,
java.io.File workDir)
This constructs a graphDef by parsing the rrdtool style command and using the values to create the JRobin graphDef. |
java.lang.Double |
fetchLastValue(java.lang.String fileName,
int interval)
Fetch the last value from the JRobin RrdDb file. |
private java.awt.Color |
getColor(java.lang.String colorValue)
|
java.lang.String |
getStats()
This implementation does not track and stats. |
void |
graphicsInitialize()
This Initializes the graphics subsystem only. |
void |
initialize()
Initialized the RrdDb to use the FILE factory because the NIO factory uses too much memory for our implementation. |
java.lang.Object |
openFile(java.lang.String fileName)
Opens the JRobin RrdDb by name and returns it. |
private void |
parseGraphColor(org.jrobin.graph.RrdGraphDef graphDef,
java.lang.String colorArg)
|
private java.lang.String[] |
tokenize(java.lang.String line,
java.lang.String delims,
boolean processQuoted)
|
void |
updateFile(java.lang.Object rrdFile,
java.lang.String data)
Creates a sample from the JRobin RrdDb and passes in the data provided. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean m_initialized
Constructor Detail |
public JRobinRrdStrategy()
Method Detail |
public void closeFile(java.lang.Object rrdFile) throws java.lang.Exception
closeFile
in interface RrdStrategy
rrdFile
- an rrd object created using openFile
java.lang.Exception
- if an error occurs closing the filepublic java.lang.Object createDefinition(java.lang.String creator, java.lang.String directory, java.lang.String dsName, int step, java.lang.String dsType, int dsHeartbeat, java.lang.String dsMin, java.lang.String dsMax, java.util.List rraList) throws java.lang.Exception
createDefinition
in interface RrdStrategy
creator
- -
A string representing who is creating this file for use in log
msgsdirectory
- -
The directory to create the file indsName
- -
The datasource name for use in the round robin databasestep
- -
the step for the databasedsType
- -
the type for the datasourcedsHeartbeat
- -
the heartbeat for the datasoucedsMin
- -
the minimum allowable value for the datasourcedsMax
- -
the maximum allowable value for the datasoucerraList
- -
a List of the round robin archives to create in the database
java.lang.Exception
- If an error occurs while creating the definitionpublic void createFile(java.lang.Object rrdDef) throws java.lang.Exception
createFile
in interface RrdStrategy
rrdDef
- an round robin database definition created using the
createDefinition call.
java.lang.Exception
- if an error occurs create the filepublic java.lang.Object openFile(java.lang.String fileName) throws java.lang.Exception
openFile
in interface RrdStrategy
fileName
- the name of the associated rrd file
java.lang.Exception
- if an error occurs opening the filepublic void updateFile(java.lang.Object rrdFile, java.lang.String data) throws java.lang.Exception
updateFile
in interface RrdStrategy
rrdFile
- an rrd object created using openFiledata
- a string of the form java.lang.Exception
- if an error occurs updating the filepublic void initialize() throws java.lang.Exception
initialize
in interface RrdStrategy
java.lang.Exception
- if an Error occurspublic void graphicsInitialize() throws java.lang.Exception
RrdStrategy
graphicsInitialize
in interface RrdStrategy
java.lang.Exception
public java.lang.Double fetchLastValue(java.lang.String fileName, int interval) throws java.lang.NumberFormatException, RrdException
fetchLastValue
in interface RrdStrategy
fileName
- a name the represents a round robin databaseinterval
- a step interval of the round robin database
java.lang.NumberFormatException
RrdException
private java.awt.Color getColor(java.lang.String colorValue)
private java.lang.String[] tokenize(java.lang.String line, java.lang.String delims, boolean processQuoted)
public java.io.InputStream createGraph(java.lang.String command, java.io.File workDir) throws java.io.IOException, RrdException
createGraph
in interface RrdStrategy
command
- the command needed to create the graphworkDir
- the directory that all referenced files are relative to
RrdException
- if an RRD error occurs
java.io.IOException
- if an IOError occursprivate void parseGraphColor(org.jrobin.graph.RrdGraphDef graphDef, java.lang.String colorArg) throws java.lang.IllegalArgumentException
colorArg
- Should have the form COLORTAG#RRGGBB
java.lang.IllegalArgumentException
http://www.jrobin.org/support/man/rrdgraph.html
public java.lang.String getStats()
getStats
in interface RrdStrategy
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |