|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jrobin.graph.RrdExportDef
public class RrdExportDef
Class used to collect information for a JRobin export.
JRobin export works the same way as Rrdtool XPORT does, to learn more about the XPORT functionality, see RRDTool's rrdxport man page.
Field Summary | |
---|---|
protected java.util.ArrayList |
cdefList
|
protected java.util.ArrayList |
edefList
|
protected java.util.ArrayList |
exportList
|
protected FetchSourceList |
fetchSources
|
protected java.util.ArrayList |
pdefList
|
static int |
STRICT_EXPLICIT_OFF
|
static int |
STRICT_EXPLICIT_ON
|
static int |
STRICT_IMPLICIT_OFF
|
static int |
STRICT_IMPLICIT_ON
|
Constructor Summary | |
---|---|
RrdExportDef()
|
|
RrdExportDef(java.util.Date start,
java.util.Date end)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
|
RrdExportDef(java.util.GregorianCalendar start,
java.util.GregorianCalendar end)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
|
RrdExportDef(long startTime,
long endTime)
Constructs a new JRobin graph object, with a specified time span to be presented on the graph. |
Method Summary | |
---|---|
void |
addExportData(ExportData edata)
Adds a set of ExportData to the datasource list. |
void |
datasource(java.lang.String name,
Plottable plottable)
Adds a custom graph source with the given name to the graph definition. |
void |
datasource(java.lang.String name,
Plottable plottable,
int index)
Adds a custom graph source with the given name to the graph definition. |
void |
datasource(java.lang.String name,
Plottable plottable,
java.lang.String sourceName)
Adds a custom graph source with the given name to the graph definition. |
void |
datasource(java.lang.String name,
java.lang.String rpn)
Adds complex graph source with the given name to the graph definition. |
void |
datasource(java.lang.String name,
java.lang.String defName,
java.lang.String consolFunc)
Adds static graph source with the given name to the graph definition. |
void |
datasource(java.lang.String name,
java.lang.String file,
java.lang.String dsName,
java.lang.String consolFunc)
Adds simple graph source to graph definition. |
void |
datasource(java.lang.String name,
java.lang.String file,
java.lang.String dsName,
java.lang.String consolFunc,
java.lang.String backend)
Adds simple graph source to graph definition. |
void |
export(java.lang.String name)
Sets a specific datasource to be exported (if export is strict). |
void |
export(java.lang.String name,
java.lang.String legend)
Sets a specific datasource to be exported (if export is strict). |
java.lang.String |
exportXmlTemplate()
Exports RrdExportDef (export definition) object in XML format to string. |
void |
exportXmlTemplate(java.io.OutputStream stream)
Exports RrdExportDef (export definition) object in XML format to output stream. |
void |
exportXmlTemplate(java.lang.String filePath)
Exports RrdExportDef (export definition) object in XML format to file. |
protected org.jrobin.graph.Cdef[] |
getCdefs()
|
protected long |
getEndTime()
|
protected ExportData[] |
getExportData()
|
protected java.lang.String[][] |
getExportDatasources()
|
protected FetchSourceList |
getFetchSources()
|
protected int |
getNumDefs()
|
protected int |
getNumSdefs()
|
protected org.jrobin.graph.Pdef[] |
getPdefs()
|
protected long |
getResolution()
|
protected long |
getStartTime()
|
java.lang.String |
getXmlTemplate()
Exports RrdExportDef (export definition) object in XML format to string. |
protected boolean |
isStrict()
|
void |
setDatasources(FetchSourceList datasourceList)
Clears the list of RRD datasources for this GraphDef and sets it to the FetchSourceList passed as aparameter. |
void |
setResolution(long resolution)
Sets the resolution with which data will be fetched from the RRD sources. |
void |
setStrictExport(boolean strict)
Sets the strict flag for the export functionality. |
void |
setTimePeriod(java.util.Date start,
java.util.Date end)
Sets time span to be presented on the graph using java.util.Date objects. |
void |
setTimePeriod(java.util.GregorianCalendar start,
java.util.GregorianCalendar end)
Sets time span to be presented on the graph using java.util.GregorianCalendar objects. |
void |
setTimePeriod(long startTime,
long endTime)
Sets time span to be presented on the graph using timestamps in number of seconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STRICT_IMPLICIT_OFF
public static final int STRICT_IMPLICIT_ON
public static final int STRICT_EXPLICIT_OFF
public static final int STRICT_EXPLICIT_ON
protected FetchSourceList fetchSources
protected java.util.ArrayList pdefList
protected java.util.ArrayList cdefList
protected java.util.ArrayList exportList
protected java.util.ArrayList edefList
Constructor Detail |
---|
public RrdExportDef()
public RrdExportDef(long startTime, long endTime) throws RrdException
startTime
- Starting timestamp in seconds.endTime
- Ending timestamp in seconds.
RrdException
- Thrown if invalid parameters are supplied.public RrdExportDef(java.util.Date start, java.util.Date end) throws RrdException
java.util.Date
objects.
start
- Starting time.end
- Ending time.
RrdException
- Thrown in case of invalid parameters.public RrdExportDef(java.util.GregorianCalendar start, java.util.GregorianCalendar end) throws RrdException
java.util.GregorianCalendar
objects.
start
- Starting time.end
- Ending time.
RrdException
- Thrown in case of invalid parameters.Method Detail |
---|
public void setTimePeriod(long startTime, long endTime) throws RrdException
startTime
- Starting timestamp in seconds.endTime
- Ending timestamp in secons.
RrdException
- Thrown if invalid parameters are supplied.public void setTimePeriod(java.util.Date start, java.util.Date end) throws RrdException
java.util.Date
objects.
start
- Starting time.end
- Ending time.
RrdException
- Thrown in case of invalid parameters.public void setTimePeriod(java.util.GregorianCalendar start, java.util.GregorianCalendar end) throws RrdException
java.util.GregorianCalendar
objects.
start
- Starting time.end
- Ending time
RrdException
- Thrown if invalid parameters are supplied.public void setResolution(long resolution)
resolution
- Resolution (data step) in seconds.public void datasource(java.lang.String name, java.lang.String file, java.lang.String dsName, java.lang.String consolFunc) throws RrdException
Adds simple graph source to graph definition. Graph source name
can be used:
complex graph
source definition
).
name
- Graph source name.file
- Path to RRD file.dsName
- Data source name defined in the RRD file.consolFunc
- Consolidation function that will be used to extract data from the RRD
file ("AVERAGE", "MIN", "MAX" or "LAST").
RrdException
public void datasource(java.lang.String name, java.lang.String file, java.lang.String dsName, java.lang.String consolFunc, java.lang.String backend) throws RrdException
Adds simple graph source to graph definition. Graph source name
can be used:
complex graph
source definition
).
name
- Graph source name.file
- Path to RRD file.dsName
- Data source name defined in the RRD file.consolFunc
- Consolidation function that will be used to extract data from the RRD
file ("AVERAGE", "MIN", "MAX" or "LAST").backend
- Name of the RrdBackendFactory that should be used for this RrdDb.
RrdException
public void setDatasources(FetchSourceList datasourceList)
Clears the list of RRD datasources for this GraphDef and sets it to the FetchSourceList
passed as aparameter. This does not alter any Cdef, Sdef or Pdef definitions. The datasources
should be passed on as a FetchSourceList FetchSourceList
.
datasourceList
- FetchSourceList of the datasources to use.public void datasource(java.lang.String name, java.lang.String rpn)
Adds complex graph source with the given name to the graph definition.
Complex graph sources are evaluated using the supplied rpn
expression.
Complex graph source name
can be used:
JRobin supports the following RPN functions, operators and constants: +, -, *, /, %, SIN, COS, LOG, EXP, FLOOR, CEIL, ROUND, POW, ABS, SQRT, RANDOM, LT, LE, GT, GE, EQ, IF, MIN, MAX, LIMIT, DUP, EXC, POP, UN, UNKN, NOW, TIME, PI and E. JRobin does not force you to specify at least one simple graph source name as RRDTool.
For more details on RPN see RRDTool's rrdgraph man page.
name
- Graph source name.rpn
- RPN expression containig comma delmited simple and complex graph
source names, RPN constants, functions and operators.public void datasource(java.lang.String name, java.lang.String defName, java.lang.String consolFunc) throws RrdException
Adds static graph source with the given name to the graph definition. Static graph sources are the result of a consolidation function applied to *any* other graph source that has been defined previously.
name
- Graph source name.defName
- Name of the datasource to calculate the value from.consolFunc
- Consolidation function to use for value calculation
RrdException
public void datasource(java.lang.String name, Plottable plottable)
Adds a custom graph source with the given name to the graph definition. The datapoints should be made available by a class extending Plottable.
name
- Graph source name.plottable
- Class that extends Plottable class and is suited for graphing.public void datasource(java.lang.String name, Plottable plottable, int index)
Adds a custom graph source with the given name to the graph definition. The datapoints should be made available by a class extending Plottable.
name
- Graph source name.plottable
- Class that extends Plottable class and is suited for graphing.index
- Integer referring to the datasource in the Plottable class.public void datasource(java.lang.String name, Plottable plottable, java.lang.String sourceName)
Adds a custom graph source with the given name to the graph definition. The datapoints should be made available by a class extending Plottable.
name
- Graph source name.plottable
- Class that extends Plottable class and is suited for graphing.sourceName
- String name referring to the datasource in the Plottable class.public void addExportData(ExportData edata)
edata
- ExportData to add.public void export(java.lang.String name)
name
- Name of the datasourcepublic void export(java.lang.String name, java.lang.String legend)
name
- Name of the datasourcelegend
- Legend textpublic void setStrictExport(boolean strict)
Sets the strict flag for the export functionality. By default, the export is in implicit not-strict, this means that by default, all datasources specified in the RrdExportDef will be exported into the ExportData.
If the strict flag is not specified explicitly by calling this method, the export will convert to implicitly strict as soon as a particular export() mapping is defined. Explicit settings will override implicit.
When explicit is off, the legend for datasources will by default be the same as the datasource name, the legend can be overridden by setting mappings using export() method.
Strict export is the same behaviour as RRDtool's XPORT.
strict
- True if strict export should on, false if not.public void exportXmlTemplate(java.io.OutputStream stream)
RrdExportDefTemplate
class.
stream
- Output stream to send XML code to.public java.lang.String getXmlTemplate()
RrdExportDefTemplate
class, see
exportXmlTemplate()
.
public java.lang.String exportXmlTemplate()
RrdExportDefTemplate
class.
public void exportXmlTemplate(java.lang.String filePath) throws java.io.IOException
RrdExportDefTemplate
class.
filePath
- destination file
java.io.IOException
protected long getStartTime()
protected long getEndTime()
protected long getResolution()
protected int getNumDefs()
protected org.jrobin.graph.Cdef[] getCdefs()
protected org.jrobin.graph.Pdef[] getPdefs()
protected ExportData[] getExportData()
protected int getNumSdefs()
protected FetchSourceList getFetchSources()
protected boolean isStrict()
protected java.lang.String[][] getExportDatasources()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |