## org.jrobin.core
Class Archive

    java.lang.Object
      org.jrobin.core.Archive

All Implemented Interfaces:
  org.jrobin.core.RrdUpdater

public class Archive
extends java.lang.Object
implements org.jrobin.core.RrdUpdater

Class to represent single RRD archive in a RRD with its internal state. Normally, you don't need methods to manipulate archive objects directly because JRobin framework does it automatically for you.

Each archive object consists of three parts: archive definition, archive state objects (one state object for each datasource) and round robin archives (one round robin for each datasource). API (read-only) is provided to access each of theese parts.

Method Summary
`void` `copyStateTo(org.jrobin.core.RrdUpdater other)` Copies object's internal state to another Archive object.
`ArcState` `getArcState(int dsIndex)` Returns the underlying archive state object.
`long` `getArcStep()` Returns archive time step in seconds.
`java.lang.String` `getConsolFun()` Returns archive consolidation function (AVERAGE, MIN, MAX or LAST).
`long` `getEndTime()` Returns current ending timestamp.
`Robin` `getRobin(int dsIndex)` Returns the underlying round robin archive.
`int` `getRows()` Returns the number of archive rows.
`org.jrobin.core.RrdAllocator` `getRrdAllocator()` Required to implement RrdUpdater interface.
`RrdBackend` `getRrdBackend()` Returns the underlying storage (backend) object which actually performs all I/O operations.
`long` `getStartTime()` Returns current starting timestamp.
`int` `getSteps()` Returns the number of archive steps.
`double` `getXff()` Returns archive X-files factor.
`void` `setXff(double xff)` Sets X-files factor to a new value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getArcStep

    public long getArcStep()
                    throws java.io.IOException

  Returns archive time step in seconds. Archive step is equal to RRD step multiplied with the number of archive steps.

  Returns:
    Archive time step in seconds
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getConsolFun

    public java.lang.String getConsolFun()
                                  throws java.io.IOException

  Returns archive consolidation function (AVERAGE, MIN, MAX or LAST).

  Returns:
    Archive consolidation function.
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getXff

    public double getXff()
                  throws java.io.IOException

  Returns archive X-files factor.

  Returns:
    Archive X-files factor (between 0 and 1).
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getSteps

    public int getSteps()
                 throws java.io.IOException

  Returns the number of archive steps.

  Returns:
    Number of archive steps.
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getRows

    public int getRows()
                throws java.io.IOException

  Returns the number of archive rows.

  Returns:
    Number of archive rows.
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getStartTime

    public long getStartTime()
                      throws java.io.IOException

  Returns current starting timestamp. This value is not constant.

  Returns:
    Timestamp corresponding to the first archive row
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getEndTime

    public long getEndTime()
                    throws java.io.IOException

  Returns current ending timestamp. This value is not constant.

  Returns:
    Timestamp corresponding to the last archive row
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### getArcState

    public ArcState getArcState(int dsIndex)

  Returns the underlying archive state object. Each datasource has its corresponding ArcState object (archive states are managed independently for each RRD datasource).

  Parameters:
    `dsIndex` - Datasource index
  Returns:
    Underlying archive state object

### getRobin

    public Robin getRobin(int dsIndex)

  Returns the underlying round robin archive. Robins are used to store actual archive values on a per-datasource basis.

  Parameters:
    `dsIndex` - Index of the datasource in the RRD.
  Returns:
    Underlying round robin archive for the given datasource.

### copyStateTo

    public void copyStateTo(org.jrobin.core.RrdUpdater other)
                     throws java.io.IOException,
                            RrdException

  Copies object's internal state to another Archive object.

  Specified by:
    `copyStateTo` in interface `org.jrobin.core.RrdUpdater`
  Parameters:
    `other` - New Archive object to copy state to
  Throws:
    `java.io.IOException` - Thrown in case of I/O error
    `RrdException` - Thrown if supplied argument is not an Archive object

### setXff

    public void setXff(double xff)
                throws RrdException,
                       java.io.IOException

  Sets X-files factor to a new value.

  Parameters:
    `xff` - New X-files factor value. Must be >= 0 and < 1.
  Throws:
    `RrdException` - Thrown if invalid value is supplied
    `java.io.IOException` - Thrown in case of I/O error

### getRrdBackend

    public RrdBackend getRrdBackend()

  Returns the underlying storage (backend) object which actually performs all I/O operations.

  Specified by:
    `getRrdBackend` in interface `org.jrobin.core.RrdUpdater`
  Returns:
    I/O backend object

### getRrdAllocator

    public org.jrobin.core.RrdAllocator getRrdAllocator()

  Required to implement RrdUpdater interface. You should never call this method directly.

  Specified by:
    `getRrdAllocator` in interface `org.jrobin.core.RrdUpdater`
  Returns:
    Allocator object