org.jrobin.graph
Class RrdExportDefTemplate

java.lang.Object
  extended by org.jrobin.core.XmlTemplate
      extended by org.jrobin.graph.RrdExportDefTemplate

public class RrdExportDefTemplate
extends XmlTemplate

Class used to create a RrdExportDef (export) object from a single XML template. XML template can be supplied as an XML InputSource, XML file or XML formatted string.

Below is an exmple XML template, not all options are required:

<rrd_export_def> <span> <start>${start}</start> <end>${end}</end> </span> <options> <resolution>300</resolution> <strict_export>true</strict_export> </options> <datasources> <def> <name>bytesIn</name> <rrd>${rrd}</rrd> <source>ifInOctets</source> <cf>AVERAGE</cf> </def> <def> <name>bytesOut</name> <rrd>${rrd}</rrd> <source>ifOutOctets</source> <cf>AVERAGE</cf> </def> <def> <name>bitsIn</name> <rpn>bytesIn,8,*</rpn> </def> <def> <name>bitsOut</name> <rpn>bytesOut,8,*</rpn> </def> </datasources> <exports> <export> <datasource>bitsIn</datasource> <legend>Incoming traffic</legend> </export> <export> <datasource>bitsOut</datasource> <legend>Outgoing traffic</legend> </export> </exports> </rrd_export_def>

Note: for more information on JRobin XML templates in general, refer to the RrdGraphDefTemplate

Note: the RrdExportDefTemplate datasources section can contain all the same options as the corresponding section in RrdGraphDefTemplate


Field Summary
 
Fields inherited from class org.jrobin.core.XmlTemplate
root
 
Constructor Summary
RrdExportDefTemplate(File xmlFile)
          Creates template object from the file containing XML template code
RrdExportDefTemplate(InputSource inputSource)
          Creates template object from any parsable XML source
RrdExportDefTemplate(String xmlString)
          Creates template object from the string containing XML template code
 
Method Summary
 RrdExportDef getRrdExportDef()
          Creates RrdExportDef object which can be used to create RrdExport object (actual JRobin export).
 
Methods inherited from class org.jrobin.core.XmlTemplate
clearValues, getChildNodes, getChildNodes, getChildValue, getChildValue, getChildValueAsBoolean, getChildValueAsDouble, getChildValueAsInt, getChildValueAsLong, getFirstChildNode, getValue, getValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, getVariables, hasChildNode, hasVariables, isEmptyNode, setVariable, setVariable, setVariable, setVariable, setVariable, setVariable, setVariable, setVariable, validateTagsOnlyOnce
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RrdExportDefTemplate

public RrdExportDefTemplate(InputSource inputSource)
                     throws IOException,
                            RrdException
Creates template object from any parsable XML source

Parameters:
inputSource - XML source
Throws:
IOException - thrown in case of I/O error
RrdException - usually thrown in case of XML related error

RrdExportDefTemplate

public RrdExportDefTemplate(File xmlFile)
                     throws IOException,
                            RrdException
Creates template object from the file containing XML template code

Parameters:
xmlFile - file containing XML template
Throws:
IOException - thrown in case of I/O error
RrdException - usually thrown in case of XML related error

RrdExportDefTemplate

public RrdExportDefTemplate(String xmlString)
                     throws IOException,
                            RrdException
Creates template object from the string containing XML template code

Parameters:
xmlString - string containing XML template
Throws:
IOException - thrown in case of I/O error
RrdException - usually thrown in case of XML related error
Method Detail

getRrdExportDef

public RrdExportDef getRrdExportDef()
                             throws RrdException
Creates RrdExportDef object which can be used to create RrdExport object (actual JRobin export). Before this method is called, all template variables (if any) must be resolved (replaced with real values). See setVariable() method information to understand how to supply values for template variables.

Returns:
Export definition which can be used to create RrdExport object (actual JRobin export)
Throws:
RrdException - Thrown if parsed XML template contains invalid (unrecognized) tags