Harvest::Database::Generic - Parent class for Harvest-NG Databases | |
| |
DESCRIPTION | |
This database class provides a set of methods for accessing databases of objects which are fetched during the spidering process. Methods which require interaction with storage are not implemented. These should be overridden by the child inheriting from this class.
| |
METHODS | |
| |
| $data=new Harvest::Database::Generic($mode,$metaclass,$config); | |
Create a new database, with the following characteristics:
NB: Do not create new instances of this class - doing so will result in an error. Children _must_ override the constructor.
| |
| $data->store($obj) | |
Store a Harvest::Object object in the database. Objects whose management data contains MD5 hashes, and have the same MD5 hash as an object already in the database will not be stored. Only the management and metadata sections of the object are stored. NB: Children _must_ override this method.
| |
| $data->manage($url) | |
Return the management structure for the object representing
NB: Children _must_ override this method.
| |
| $data->fetch($url) | |
Return the Harvest::Object object for the given NB: Children _must_ override this method.
| |
| $data->delete($url) | |
Remove stored data for $url. Returns false if no data exists for the URL. NB: Children _must_ override this method.
| |
| $data->exists($url) | |
Return true if the object exists in the database, false otherwise NB: Children _must_ override this method.
| |
| $data->foreach($proc, @args) | |
Call the function referenced by
NB: Do not undertake any actions which add, or remove, items from the database in your function. Children _must_ override this method
| |
| $data->expire($proc, @args) | |
Remove any objects which have expired (as determined by calling the outofdate method of Harvest::Object::Manage) | |