org.rrd4j.core

## Interface DataHolder

- All Known Implementing Classes:
    DataProcessor, RrdGraphDef

      public interface DataHolder

  Interface for holding data sources.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_POOL_USAGE_POLICY` Constant that defines the default `RrdDbPool` usage policy.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `datasource(String name, FetchData fetchData)` Creates a new 'fetched' datasource.
    `void` | `datasource(String name, IPlottable plottable)` Creates a new (plottable) datasource.
    `void` | `datasource(String name, String rpnExpression)` Create a new virtual datasource by evaluating a mathematical expression, specified in Reverse Polish Notation (RPN).
    `void` | `datasource(String name, String dsName, FetchData fetchData)` Creates a new 'fetched' datasource.
    `void` | `datasource(String name, String rrdPath, String dsName, ConsolFun consolFun)` Defines virtual datasource.
    `void` | `datasource(String name, String rrdPath, String dsName, ConsolFun consolFun, RrdBackendFactory backend)` Defines virtual datasource.
    `void` | `datasource(String name, String defName, Variable var)` Creates a datasource that performs a variable calculation on an another named datasource to yield a single combined timestamp/value.
    `void` | `datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun)` Defines virtual datasource.
    `void` | `datasource(String name, URI rrdUri, String dsName, ConsolFun consolFun, RrdBackendFactory backend)` Defines virtual datasource.
    `long` | `getEndTime()` Returns ending timestamp.
    `RrdDbPool` | `getPool()`
    `long` | `getStartTime()` Returns starting timestamp.
    `long` | `getStep()` Returns the time step used for timestamp interval.
    `TimeZone` | `getTimeZone()`
    `boolean` | `isPoolUsed()` Returns boolean value representing `RrdDbPool` usage policy.
    `void` | `setEndTime(long time)` Sets the time when the graph should end.
    `void` | `setPool(RrdDbPool pool)` Defines the `RrdDbPool` to use.
    `void` | `setPoolUsed(boolean poolUsed)` Sets the `RrdDbPool` usage policy.
    `void` | `setStartTime(long time)` Sets the time when the graph should start.
    `void` | `setStep(long step)` Set the step for timestamp interval.
    `void` | `setTimeSpan(long startTime, long endTime)` Sets starting and ending time for the for the graph.
    `void` | `setTimeZone(TimeZone tz)` Set the time zone used for the legend.

- - ### Field Detail

    - #### DEFAULT_POOL_USAGE_POLICY

          static final boolean DEFAULT_POOL_USAGE_POLICY

      Constant that defines the default `RrdDbPool` usage policy. Defaults to `false` (i.e. the pool will not be used to fetch data from RRD files)
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### datasource

          void datasource(String name,
                          FetchData fetchData)

      Creates a new 'fetched' datasource. Datasource values are obtained from the given `FetchData` object.
      Parameters:
        `name` - Source name.
        `fetchData` - FetchData object.

    - #### datasource

          void datasource(String name,
                          IPlottable plottable)

      Creates a new (plottable) datasource. Datasource values are obtained from the given plottable object.
      Parameters:
        `name` - Source name.
        `plottable` - IPlottable object.

    - #### datasource

          void datasource(String name,
                          String rpnExpression)

      Create a new virtual datasource by evaluating a mathematical expression, specified in Reverse Polish Notation (RPN).
      Parameters:
        `name` - Source name
        `rpnExpression` - RPN expression.

    - #### datasource

          void datasource(String name,
                          String dsName,
                          FetchData fetchData)

      Creates a new 'fetched' datasource. Datasource values are obtained from the given `FetchData` object. Values will be extracted from the datasource dsName in the fetchData
      Parameters:
        `name` - Source name.
        `dsName` - Source name in fetchData.
        `fetchData` - FetchData object.

    - #### datasource

          void datasource(String name,
                          String rrdPath,
                          String dsName,
                          ConsolFun consolFun)

      Defines virtual datasource. This datasource can then be used in other methods like `datasource(String, String)`.
      Parameters:
        `name` - Source name
        `rrdPath` - Path to RRD file
        `dsName` - Datasource name in the specified RRD file
        `consolFun` - Consolidation function (AVERAGE, MIN, MAX, LAST)

    - #### datasource

          void datasource(String name,
                          String rrdPath,
                          String dsName,
                          ConsolFun consolFun,
                          RrdBackendFactory backend)

      Defines virtual datasource. This datasource can then be used in other methods like `datasource(String, String)`.
      Parameters:
        `name` - Source name
        `rrdPath` - Path to RRD file
        `dsName` - Datasource name in the specified RRD file
        `consolFun` - Consolidation function (AVERAGE, MIN, MAX, LAST)
        `backend` - Backend to be used while fetching data from a RRD file.

    - #### datasource

          void datasource(String name,
                          String defName,
                          Variable var)

      Creates a datasource that performs a variable calculation on an another named datasource to yield a single combined timestamp/value.

      Requires that the other datasource has already been defined; otherwise, it'll end up with no data

      Parameters:
        `name` - - the new virtual datasource name
        `defName` - - the datasource from which to extract the percentile. Must be a previously defined virtual datasource
        `var` - - a new instance of a Variable used to do the calculation

    - #### datasource

          void datasource(String name,
                          URI rrdUri,
                          String dsName,
                          ConsolFun consolFun)

      Defines virtual datasource. This datasource can then be used in other methods like `datasource(String, String)`.
      Parameters:
        `name` - Source name
        `rrdUri` - rrdUri to RRD file
        `dsName` - Datasource name in the specified RRD file
        `consolFun` - Consolidation function (AVERAGE, MIN, MAX, LAST)

    - #### datasource

          void datasource(String name,
                          URI rrdUri,
                          String dsName,
                          ConsolFun consolFun,
                          RrdBackendFactory backend)

      Defines virtual datasource. This datasource can then be used in other methods like `datasource(String, String)`.
      Parameters:
        `name` - Source name
        `rrdUri` - URI to RRD file
        `dsName` - Datasource name in the specified RRD file
        `consolFun` - Consolidation function (AVERAGE, MIN, MAX, LAST)
        `backend` - Backend to be used while fetching data from a RRD file.

    - #### getEndTime

          long getEndTime()

      Returns ending timestamp.
      Returns:
        Ending timestamp in seconds

    - #### getPool

          RrdDbPool getPool()

    - #### getStartTime

          long getStartTime()

      Returns starting timestamp.
      Returns:
        Starting timestamp in seconds

    - #### getStep

          long getStep()

      Returns the time step used for timestamp interval.
      Returns:
        Step used for data processing.

    - #### getTimeZone

          TimeZone getTimeZone()

    - #### isPoolUsed

          boolean isPoolUsed()

      Returns boolean value representing `RrdDbPool` usage policy.
      Returns:
        true, if the pool will be used internally to fetch data from RRD files, false otherwise.

    - #### setEndTime

          void setEndTime(long time)

      Sets the time when the graph should end. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time.
      Parameters:
        `time` - Ending time for the graph in seconds since epoch

    - #### setPool

          void setPool(RrdDbPool pool)

      Defines the `RrdDbPool` to use. If not defined, but {`setPoolUsed(boolean)` set to true, the default `RrdDbPool.getInstance()` will be used.
      Parameters:
        `pool` - an optional pool to use.

    - #### setPoolUsed

          void setPoolUsed(boolean poolUsed)

      Sets the `RrdDbPool` usage policy.
      Parameters:
        `poolUsed` - true, if the pool will be used to fetch data from RRD files, false otherwise.

    - #### setStartTime

          void setStartTime(long time)

      Sets the time when the graph should start. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time.
      Parameters:
        `time` - Starting time for the graph in seconds since epoch

    - #### setStep

          void setStep(long step)

      Set the step for timestamp interval.
      Parameters:
        `step` - time step for data processing

    - #### setTimeSpan

          void setTimeSpan(long startTime,
                           long endTime)

      Sets starting and ending time for the for the graph. Timestamps in seconds since epoch are required. Negative numbers are relative to the current time.
      Parameters:
        `startTime` - Starting time in seconds since epoch
        `endTime` - Ending time in seconds since epoch

    - #### setTimeZone

          void setTimeZone(TimeZone tz)

      Set the time zone used for the legend.
      Parameters:
        `tz` - the time zone to set