NAME

Labrador::Dispatcher::URLFilter

SYPNOPSIS

	use Labrador::Dispatcher::URLFilter::Regexp;
	my $filter = Labrador::Dispatcher::URLFilter::new(
		'Labrador::Dispatcher::URLFilter::Regexp', $config, @param);
	my $url = 'http://....';
	print $filter->filter($url) ? "Good" : "Bad";

DESCRIPTION

This is an abstract base class for URLFilters. Note it is hoped that URLFilters should be proper (repeatable) functions - ie they should return the same result given the same parameters. Hence, a filter() implementation shouldn't have side-effects. Labrador::Dispatcher::Processing loads Memoize, and uses it to cache the result of a URL being filtered. Hence after a URL has been seen once, it may not be seen again.

METHODS

new($CLASSNAME, $config, @params)
Constructor. It should be passed the name of the class it should instantiate. A reference to an instance of Labrador::Common::Config is also recommended. This allows children modules to pull additional configuration parameters from the configuration file.
init()
Is called by new() to initialise a filter.
filter($url)
Abstract method, must be implemented by a filter. Returns true for a good URL, or 0 for a bad one.
name()
Returns the name of this filter, so can be used for debugging purposes.

REVISION

	$Revision: 1.5 $