|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jrobin.graph.ExportData
public class ExportData
ExportData represents a reduced dataset that is the result of a JRobin rrd export.
Constructor Summary | |
---|---|
ExportData(java.io.File xmlFile)
Create an ExportData object based on export XML file. |
|
ExportData(java.io.File xmlFile,
boolean useLegendNames)
Create an ExportData object based on export XML file. |
|
ExportData(java.io.File xmlFile,
java.lang.String dsNamePrefix)
Create an ExportData object based on export XML file. |
|
ExportData(java.lang.String xportXml)
Create an ExportData object based on export XML string.. |
|
ExportData(java.lang.String xportXml,
boolean useLegendNames)
Create an ExportData object based on export XML string.. |
|
ExportData(java.lang.String xportXml,
java.lang.String dsNamePrefix)
Create an ExportData object based on export XML string.. |
Method Summary | |
---|---|
java.lang.String |
exportXml()
Dumps the dataset to XML. |
void |
exportXml(java.io.OutputStream outputStream)
Dumps fetch data to output stream in XML format. |
void |
exportXml(java.lang.String filepath)
Dumps dataset to file in XML format. |
double |
getAggregate(java.lang.String dsName,
java.lang.String consolFun)
Returns aggregated value from the dataset for a single datasource. |
int |
getColumnCount()
Returns the number of columns in this dataset. |
int |
getDsIndex(java.lang.String dsName)
Retrieve the table index number of a datasource by name. |
java.lang.String[] |
getDsNames()
Returns array of the names of all datasources in the set. |
long |
getFirstTimestamp()
Returns the first timestamp in the dataset. |
long |
getLastTimestamp()
Returns the last timestamp in the dataset. |
int |
getRowCount()
Returns the number of rows in this dataset. |
protected org.jrobin.graph.Source[] |
getSources()
|
long |
getStep()
Returns the step with which this data was fetched. |
long[] |
getTimestamps()
Returns an array of timestamps covering the whole range specified in the dataset object. |
double[][] |
getValues()
Returns all values for all datasources, the returned values correspond to the timestamps returned with the getTimestamps() method. |
double[] |
getValues(int dsIndex)
Returns all values for a single datasource, the returned values correspond to the timestamps returned with the getTimestamps() method. |
double[] |
getValues(java.lang.String dsName)
Returns all values for a single datasource. |
void |
importXml(java.io.File xmlFile)
Imports a export XML string and maps it back to this ExportData object. |
void |
importXml(java.io.File xmlFile,
boolean useLegendNames)
Imports a export XML string and maps it back to this ExportData object. |
void |
importXml(java.io.File xmlFile,
java.lang.String dsNamePrefix)
Imports a export XML string and maps it back to this ExportData object. |
void |
importXml(java.lang.String xportXml)
Imports a export XML string and maps it back to this ExportData object. |
void |
importXml(java.lang.String xportXml,
boolean useLegendNames)
Imports a export XML string and maps it back to this ExportData object. |
void |
importXml(java.lang.String xportXml,
java.lang.String dsNamePrefix)
Imports a export XML string and maps it back to this ExportData object. |
java.lang.String |
print(java.lang.String sourceName,
java.lang.String consolFun,
java.lang.String format)
Calculate the chosen consolidation function consolFun over
the sourceName and returns the result as a string using the
specified format . |
java.lang.String |
print(java.lang.String sourceName,
java.lang.String consolFun,
java.lang.String format,
double base)
Calculate the chosen consolidation function consolFun over
the sourceName and returns the result as a string using the
specified format . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExportData(java.lang.String xportXml) throws RrdException, java.io.IOException
xportXml
- File containing export xml.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.public ExportData(java.lang.String xportXml, boolean useLegendNames) throws RrdException, java.io.IOException
xportXml
- File containing export xml.useLegendNames
- Map datasources to legend items in the export xml.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.public ExportData(java.lang.String xportXml, java.lang.String dsNamePrefix) throws RrdException, java.io.IOException
xportXml
- File containing export xml.dsNamePrefix
- Prefix of the datasource names.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.public ExportData(java.io.File xmlFile) throws RrdException, java.io.IOException
xmlFile
- File containing export xml.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.public ExportData(java.io.File xmlFile, boolean useLegendNames) throws RrdException, java.io.IOException
xmlFile
- File containing export xml.useLegendNames
- Map datasources to legend items in the export xml.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.public ExportData(java.io.File xmlFile, java.lang.String dsNamePrefix) throws RrdException, java.io.IOException
xmlFile
- File containing export xml.dsNamePrefix
- Prefix of the datasource names.
RrdException
- Thrown in case of JRobin specific exception.
java.io.IOException
- Thrown in case of I/O related exception.Method Detail |
---|
public int getRowCount()
getRowCount
in interface RrdDataSet
public int getColumnCount()
getColumnCount
in interface RrdDataSet
public long[] getTimestamps()
getTimestamps
in interface RrdDataSet
public long getStep()
getStep
in interface RrdDataSet
public double[] getValues(int dsIndex)
getTimestamps()
method.
getValues
in interface RrdDataSet
dsIndex
- Datasource index.
public double[][] getValues()
getTimestamps()
method.
getValues
in interface RrdDataSet
public double[] getValues(java.lang.String dsName) throws RrdException
getTimestamps()
method.
getValues
in interface RrdDataSet
dsName
- Datasource name.
RrdException
- Thrown if no matching datasource name is found.public long getFirstTimestamp()
getFirstTimestamp
in interface RrdDataSet
public long getLastTimestamp()
getLastTimestamp
in interface RrdDataSet
public java.lang.String[] getDsNames()
getDsNames
in interface RrdDataSet
public int getDsIndex(java.lang.String dsName) throws RrdException
getDsIndex
in interface RrdDataSet
dsName
- Name of the datasource for which to find the index.
RrdException
- Thrown if the given datasource name cannot be found in the dataset.public double getAggregate(java.lang.String dsName, java.lang.String consolFun) throws RrdException
getAggregate
in interface RrdDataSet
dsName
- Datasource nameconsolFun
- Consolidation function to be applied to set datasource values datasource.
Valid consolidation functions are MIN, MAX, LAST, FIRST, AVERAGE and TOTAL
RrdException
- Thrown if the given datasource name cannot be found in the dataset.public java.lang.String print(java.lang.String sourceName, java.lang.String consolFun, java.lang.String format) throws RrdException
Calculate the chosen consolidation function consolFun
over
the sourceName
and returns the result as a string using the
specified format
.
In the format string there should be a
@n.d
marker (replace n
with the total number of spaces the
value should at minimum take up, and replace d
with the desired number of decimals)
in the place where the number should be printed. If an additional @s
is
found in the format, the value will be scaled and an appropriate SI magnitude
unit will be printed in place of the @s
marker. If you specify
@S
instead of @s
, the value will be scaled with the scale
factor used in the last gprint directive (uniform value scaling).
sourceName
- Source nameconsolFun
- Consolidation function to be used for calculation ("AVERAGE",
"MIN", "MAX", "LAST" or "TOTAL" (since 1.3.1)format
- Format string. For example: "speed is @5.2 @sbits/sec@c",
"temperature = @0 degrees"
RrdException
- Thrown in case of JRobin specific errorpublic java.lang.String print(java.lang.String sourceName, java.lang.String consolFun, java.lang.String format, double base) throws RrdException
Calculate the chosen consolidation function consolFun
over
the sourceName
and returns the result as a string using the
specified format
.
In the format string there should be a
@n.d
marker (replace n
with the total number of spaces the
value should at minimum take up, and replace d
with the desired number of decimals)
in the place where the number should be printed. If an additional @s
is
found in the format, the value will be scaled and an appropriate SI magnitude
unit will be printed in place of the @s
marker. If you specify
@S
instead of @s
, the value will be scaled with the scale
factor used in the last gprint directive (uniform value scaling).
sourceName
- Source nameconsolFun
- Consolidation function to be used for calculation ("AVERAGE",
"MIN", "MAX", "LAST" or "TOTAL" (since 1.3.1)format
- Format string. For example: "speed is @5.2 @sbits/sec@c",
"temperature = @0 degrees"base
- Base value used to calculate the appriopriate scaling SI magnitude.
RrdException
- Thrown in case of JRobin specific errorpublic void importXml(java.lang.String xportXml) throws RrdException, java.io.IOException
xportXml
- String containing the XML result of an export.
RrdException
java.io.IOException
public void importXml(java.io.File xmlFile) throws RrdException, java.io.IOException
xmlFile
- File containing export XML dump.
RrdException
java.io.IOException
public void importXml(java.io.File xmlFile, boolean useLegendNames) throws RrdException, java.io.IOException
xmlFile
- File containing export XML dump.useLegendNames
- True if the names for the datasources should be set to
the legend values, false if they should be d1, d2, ...
RrdException
java.io.IOException
public void importXml(java.lang.String xportXml, java.lang.String dsNamePrefix) throws RrdException, java.io.IOException
xportXml
- String containing the XML result of an export.dsNamePrefix
- Prefix of the datasource names.
RrdException
java.io.IOException
public void importXml(java.io.File xmlFile, java.lang.String dsNamePrefix) throws RrdException, java.io.IOException
xmlFile
- File containing export XML dump.dsNamePrefix
- Prefix of the datasource names.
RrdException
java.io.IOException
public void importXml(java.lang.String xportXml, boolean useLegendNames) throws RrdException, java.io.IOException
xportXml
- String containing the XML result of an export.useLegendNames
- True if the names for the datasources should be set to
the legend values, false if they should be d1, d2, ...
RrdException
java.io.IOException
public void exportXml(java.io.OutputStream outputStream) throws RrdException, java.io.IOException
exportXml
in interface RrdDataSet
outputStream
- Output stream to dump dataset to
RrdException
- Thrown in case of JRobin specific error.
java.io.IOException
- Thrown in case of I/O errorpublic void exportXml(java.lang.String filepath) throws RrdException, java.io.IOException
exportXml
in interface RrdDataSet
filepath
- Path to destination file
RrdException
- Thrown in case of JRobin specific error.
java.io.IOException
- Thrown in case of I/O errorpublic java.lang.String exportXml() throws RrdException, java.io.IOException
exportXml
in interface RrdDataSet
RrdException
- Thrown in case of JRobin specific error.
java.io.IOException
- Thrown in case of an I/O related error.protected org.jrobin.graph.Source[] getSources()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |