org.jrobin.core

Class Header

public class Header extends Object implements RrdUpdater

Class to represent RRD header. Header information is mainly static (once set, it cannot be changed), with the exception of last update time (this value is changed whenever RRD gets updated).

Normally, you don't need to manipulate the Header object directly - JRobin framework does it for you.

Method Summary
voidcopyStateTo(RrdUpdater other)
Copies object's internal state to another Header object.
intgetArcCount()
Returns the number of archives defined in the RRD.
intgetDsCount()
Returns the number of datasources defined in the RRD.
StringgetInfo()
longgetLastUpdateTime()
Returns the last update time of the RRD.
RrdAllocatorgetRrdAllocator()
Required to implement RrdUpdater interface.
RrdBackendgetRrdBackend()
Returns the underlying storage (backend) object which actually performs all I/O operations.
StringgetSignature()
Returns RRD signature.
longgetStep()
Returns primary RRD time step.
voidsetInfo(String info)

Method Detail

copyStateTo

public void copyStateTo(RrdUpdater other)
Copies object's internal state to another Header object.

Parameters: other New Header object to copy state to

Throws: IOException Thrown in case of I/O error RrdException Thrown if supplied argument is not a Header object

getArcCount

public int getArcCount()
Returns the number of archives defined in the RRD.

Returns: Number of archives defined

Throws: IOException Thrown in case of I/O error

getDsCount

public int getDsCount()
Returns the number of datasources defined in the RRD.

Returns: Number of datasources defined

Throws: IOException Thrown in case of I/O error

getInfo

public String getInfo()

getLastUpdateTime

public long getLastUpdateTime()
Returns the last update time of the RRD.

Returns: Timestamp (Unix epoch, no milliseconds) corresponding to the last update time.

Throws: IOException Thrown in case of I/O error

getRrdAllocator

public RrdAllocator getRrdAllocator()
Required to implement RrdUpdater interface. You should never call this method directly.

Returns: Allocator object

getRrdBackend

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

Returns: I/O backend object

getSignature

public String getSignature()
Returns RRD signature. Initially, the returned string will be of the form JRobin, version x.x. Note: RRD format did not change since Jrobin 1.0.0 release (and probably never will).

Returns: RRD signature

Throws: IOException Thrown in case of I/O error

getStep

public long getStep()
Returns primary RRD time step.

Returns: Primary time step in seconds

Throws: IOException Thrown in case of I/O error

setInfo

public void setInfo(String info)