.

Harvest::Database::DBM - Database of all gathered objects

DESCRIPTION

This is an Harvest::Database class, which stores its information in DBM files.

This class inherits some functionality from Harvest::Database::Generic, see that page for more details of available methods.

METHODS =cut

# require Exporter; # @ISA=qw (Exporter);

require Harvest::Database::Generic; @ISA = qw(Harvest::Database::Generic);

use Fcntl; use Harvest::Object;

$db=new Harvest::Database::DBM ($mode,$metaclass,$config);

This method opens a new DBM based database, with the following configuration

$mode
mode controls whether the database is opened for reading, or for update. A mode of 'ro', makes the database read-only, 'rw' makes it read-write
$metaclass
This indicates the class used to store the metadata section of the database. At present this should be Metadata::SOIF
$config
A Harvest::Config structure containing configuration information for the database. At present the keys 'File' and 'Type' should be set

$db->store($object)

Store the given object in the database. $object should be a Harvest::Object object, with a populated metadata section (Objects without metadata will not be stored).

$manage=$db->manage($url)

Return the Harvest::Object::Manage information for the object with the given $url. Returns undef if that object does not exist in the database.

$object=$db->fetch($url)

Return the Harvest::Object object for the object with the given $url. Returns undef if that object does not exist in the database.

$db->delete($url)

Delete the object with the given $url from the database. Returns '1' on success, undef on failure.

$ok=$db->exists($url);

Returns true if the given $url exists in the database

$db->foreach($proc,@args)

Iterate through the database, applying $proc with the arguments @args to each item in the database. See the description in Harvest::Database::Generic for more details.