Package org.opennms.netmgt.rrd.rrdtool
Class AbstractJniRrdStrategy<D,F>
- java.lang.Object
-
- org.opennms.netmgt.rrd.rrdtool.AbstractJniRrdStrategy<D,F>
-
- All Implemented Interfaces:
RrdStrategy<D,F>
- Direct Known Subclasses:
JniRrdStrategy
,MultithreadedJniRrdStrategy
public abstract class AbstractJniRrdStrategy<D,F> extends java.lang.Object implements RrdStrategy<D,F>
-
-
Constructor Summary
Constructors Constructor Description AbstractJniRrdStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
createGraph(java.lang.String command, java.io.File workDir)
Creates an InputStream representing the bytes of a graph created from round robin data.RrdGraphDetails
createGraphReturnDetails(java.lang.String command, java.io.File workDir)
Creates an RrdGraphDetails object representing the graph created from round robin data.java.lang.String
getDefaultFileExtension()
getDefaultFileExtensionint
getGraphLeftOffset()
getGraphLeftOffsetint
getGraphRightOffset()
getGraphRightOffsetint
getGraphTopOffsetWithText()
getGraphTopOffsetWithTextjava.lang.String
getStats()
No stats are kept for this implementation.void
promoteEnqueuedFiles(java.util.Collection<java.lang.String> rrdFiles)
In the event that this is a queuing implementation of the RrdStrategy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.rrd.RrdStrategy
closeFile, createDefinition, createFile, fetchLastValue, fetchLastValue, fetchLastValueInRange, openFile, setConfigurationProperties, updateFile
-
-
-
-
Method Detail
-
createGraph
public java.io.InputStream createGraph(java.lang.String command, java.io.File workDir) throws java.io.IOException, RrdException
Creates an InputStream representing the bytes of a graph created from round robin data. It accepts an rrdtool graph command. The underlying implementation converts this command to a format appropriate for it . Executes the given graph command as process with workDir as the current directory. The output stream of the command (a PNG image) is copied to a the InputStream returned from the method.- Specified by:
createGraph
in interfaceRrdStrategy<D,F>
- Parameters:
command
- the command needed to create the graphworkDir
- the directory that all referenced files are relative to- Returns:
- an input stream representing the bytes of a graph image as a PNG file
- Throws:
java.io.IOException
- if an IOError occursRrdException
- if an RRD error occurs
-
getGraphLeftOffset
public int getGraphLeftOffset()
getGraphLeftOffset
- Specified by:
getGraphLeftOffset
in interfaceRrdStrategy<D,F>
- Returns:
- a int.
-
getGraphRightOffset
public int getGraphRightOffset()
getGraphRightOffset
- Specified by:
getGraphRightOffset
in interfaceRrdStrategy<D,F>
- Returns:
- a int.
-
getGraphTopOffsetWithText
public int getGraphTopOffsetWithText()
getGraphTopOffsetWithText
- Specified by:
getGraphTopOffsetWithText
in interfaceRrdStrategy<D,F>
- Returns:
- a int.
-
getStats
public java.lang.String getStats()
No stats are kept for this implementation.- Specified by:
getStats
in interfaceRrdStrategy<D,F>
- Returns:
- a
String
object.
-
getDefaultFileExtension
public java.lang.String getDefaultFileExtension()
getDefaultFileExtension
- Specified by:
getDefaultFileExtension
in interfaceRrdStrategy<D,F>
- Returns:
- a
String
object.
-
createGraphReturnDetails
public RrdGraphDetails createGraphReturnDetails(java.lang.String command, java.io.File workDir) throws java.io.IOException, RrdException
Creates an RrdGraphDetails object representing the graph created from round robin data. It accepts an rrdtool graph command. The underlying implementation converts this command to a format appropriate for it .- Specified by:
createGraphReturnDetails
in interfaceRrdStrategy<D,F>
- Parameters:
command
- the command needed to create the graphworkDir
- the directory that all referenced files are relative to- Returns:
- details for the graph including an InputStream, any PRINTed lines, and graph dimensions.
- Throws:
java.io.IOException
- if an IOError occursRrdException
- if an RRD error occurs
-
promoteEnqueuedFiles
public void promoteEnqueuedFiles(java.util.Collection<java.lang.String> rrdFiles)
In the event that this is a queuing implementation of the RrdStrategy. This method causes all queued but not yet written data to be to the rrd files as soon as possible.- Specified by:
promoteEnqueuedFiles
in interfaceRrdStrategy<D,F>
- Parameters:
rrdFiles
- aCollection
object.
-
-