|
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.JniRrdStrategy
Provides an rrdtool based implementation of RrdStrategy. It uses the existing JNI based single-threaded interface to write the rrdtool compatibile RRD files. The JNI interface takes command-like arguments and doesn't provide open files so the the Objects used to represent open files are really partial command strings See the individual methods for more details
Field Summary | |
(package private) boolean |
graphicsInitialized
|
(package private) boolean |
initialized
|
Constructor Summary | |
(package private) |
JniRrdStrategy()
|
Method Summary | |
private void |
checkState(java.lang.String methodName)
Ensures that the initialize method has been called. |
void |
closeFile(java.lang.Object rrd)
The 'closes' the rrd file. |
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)
Constructs an rrdtool create command string that can be used to create the rrd file and returns it as the rrdDefinition object. |
void |
createFile(java.lang.Object rrdDef)
Creates a the rrd file from the rrdDefinition. |
java.io.InputStream |
createGraph(java.lang.String command,
java.io.File workDir)
Executes the given graph comnmand as process with workDir as the current directory. |
java.lang.Double |
fetchLastValue(java.lang.String rrdFile,
int interval)
Fetches the last value directly from the rrd file using the JNI Interface. |
java.lang.String |
getStats()
No stats are kept for this implementation. |
void |
graphicsInitialize()
This Initializes the graphics subsystem only. |
void |
initialize()
Initialized the JNI Interface |
java.lang.Object |
openFile(java.lang.String fileName)
The 'opens' the given rrd file. |
void |
updateFile(java.lang.Object rrd,
java.lang.String data)
This 'updates' the given rrd file by providing data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
boolean initialized
boolean graphicsInitialized
Constructor Detail |
JniRrdStrategy()
Method Detail |
public void closeFile(java.lang.Object rrd) throws java.lang.Exception
closeFile
in interface RrdStrategy
rrd
- an rrd object created using openFile
java.lang.Exception
- if an error occurs closing the fileprivate void checkState(java.lang.String methodName)
methodName
- the name of the method we are called from
IllegalState
- exception of intialize has not been called.public 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 rrd, java.lang.String data) throws java.lang.Exception
updateFile
in interface RrdStrategy
rrd
- 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 rrdFile, int interval) throws java.lang.NumberFormatException, RrdException
fetchLastValue
in interface RrdStrategy
rrdFile
- a name the represents a round robin databaseinterval
- a step interval of the round robin database
java.lang.NumberFormatException
RrdException
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 occurspublic 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 |