qdbm
Interface ADBM

All Known Implementing Classes:
Curia, Depot, Villa

public interface ADBM

Abstraction for database managers compatible with DBM.


Method Summary
 void close()
          Close the database connection.
 void delete(byte[] key)
          Delete a record.
 boolean error()
          Check whether a fatal error occured or not.
 byte[] fetch(byte[] key)
          Fetch a record.
 byte[] firstkey()
          Get the first key.
 byte[] nextkey()
          Get the next key.
 void store(byte[] key, byte[] val, boolean replace)
          Store a record.
 

Method Detail

close

void close()
           throws DBMException
Close the database connection.

Throws:
DBMException - if an error occurs.

delete

void delete(byte[] key)
            throws DBMException
Delete a record.

Parameters:
key - a byte array of a key.
Throws:
DBMException - if an error occurs or no record corresponds.

error

boolean error()
              throws DBMException
Check whether a fatal error occured or not.

Returns:
true if the database has a fatal error, false if not.
Throws:
DBMException - if an error occurs.

fetch

byte[] fetch(byte[] key)
             throws DBMException
Fetch a record.

Parameters:
key - a byte array of a key.
Returns:
a byte array of the value of the corresponding record.
Throws:
DBMException - if an error occurs or no record corresponds.

firstkey

byte[] firstkey()
                throws DBMException
Get the first key.

Returns:
a byte array of the key of the first record.
Throws:
DBMException - if an error occurs or no record corresponds.

nextkey

byte[] nextkey()
               throws DBMException
Get the next key.

Returns:
a byte array of the key of the next record.
Throws:
DBMException - if an error occurs or no record corresponds.

store

void store(byte[] key,
           byte[] val,
           boolean replace)
           throws DBMException
Store a record.

Parameters:
key - a byte array of a key.
val - a byte array of a value.
replace - whether the existing value is to be overwritten or not.
Throws:
DBMException - if an error occurs or replace is cancelled.