org.rrd4j.core
Class RrdBerkeleyDbBackendFactory

java.lang.Object
  extended by org.rrd4j.core.RrdBackendFactory
      extended by org.rrd4j.core.RrdBerkeleyDbBackendFactory

public class RrdBerkeleyDbBackendFactory
extends RrdBackendFactory

RrdBackendFactory that uses Oracle Berkeley DB Java Edition to read data. Construct a BerkeleyDB {#link Database} object and pass it via the constructor.


Constructor Summary
RrdBerkeleyDbBackendFactory(com.sleepycat.je.Database rrdDatabase)
           
 
Method Summary
 void delete(String path)
           
protected  boolean exists(String path)
          Checks if the RRD with the given id (path) already exists in the database.
 String getName()
          Returns the name (primary ID) for the factory.
protected  RrdBackend open(String path, boolean readOnly)
          Creates new RrdBerkeleyDbBackend object for the given id (path).
protected  boolean shouldValidateHeader(String path)
          Determines if the header should be validated.
 
Methods inherited from class org.rrd4j.core.RrdBackendFactory
getDefaultFactory, getFactory, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RrdBerkeleyDbBackendFactory

public RrdBerkeleyDbBackendFactory(com.sleepycat.je.Database rrdDatabase)
Method Detail

open

protected RrdBackend open(String path,
                          boolean readOnly)
                   throws IOException
Creates new RrdBerkeleyDbBackend object for the given id (path).

Specified by:
open in class RrdBackendFactory
Parameters:
path - Storage path
readOnly - True, if the storage should be accessed in read/only mode. False otherwise.
Returns:
Backend object which handles all I/O operations for the given storage path
Throws:
IOException - Thrown in case of I/O error.

delete

public void delete(String path)

exists

protected boolean exists(String path)
                  throws IOException
Checks if the RRD with the given id (path) already exists in the database.

Specified by:
exists in class RrdBackendFactory
Parameters:
path - Storage path
Returns:
True, if such storage exists, false otherwise.
Throws:
IOException

shouldValidateHeader

protected boolean shouldValidateHeader(String path)
Description copied from class: RrdBackendFactory
Determines if the header should be validated.

Specified by:
shouldValidateHeader in class RrdBackendFactory
Parameters:
path - Storage path
Returns:
True, if the header should be validated for this factory

getName

public String getName()
Description copied from class: RrdBackendFactory
Returns the name (primary ID) for the factory.

Specified by:
getName in class RrdBackendFactory
Returns:
Name of the factory.