.

Harvest::Controller::Filter::Generic - generic filter class

DESCRIPTION

Generic Generic filter class - acts as a base class for all other filter classes which need to keep state between runs.

$filter=new Filter::Generic $config

Create a new instance of the Generic filter. This filter has its data tied to a disk file, controlled by the TemporaryDir and Name tags in the configuration information passed to it in the Harvest::Config object $config. The directory given must already exist.

The DBM type to be used is taken from the DBType tag in this structure.

Filters which take arguments will need to override this constructor with their own one. The Generic constructor can then be accessed with $self=$self->SUPER::new($config) where $config is the configuration passed to your class. In this case the tied database will be given the name of the subclass.

Classes which override the new constructor must also have a DESTROY method that calls the destroy method of the super class.

$newobjs=$filter->check($object)

Check to see if a given object can be fetched. The method returns a list of objects (which may, or may not include the original object) which it will allow fetches of.

The Generic class provides a simple check rule which always allows the url passed to be fetched. This should be overridden by a derived class as appropriate for each filter.

$filter->update($object)

This method is called to tell the filter that the given object has been OK'd by all filters, and that it will be fetched. A filter can use this information to update any relevant internal counts.

This method should be overridden by subclasses as neccessary. It has a null action in the Generic class.

$filter->result($object)

This method is used to return the result of an object fetch requested by a filter (filters may perform object fetches by returning an object from the check method with a rootnode of ``FILTER'')

This method should be overridden by subclasses as neccessary. It has a null action in the Generic class.