01: package net.javacoding.jspider.spi;
02:
03: import net.javacoding.jspider.api.model.Decision;
04: import net.javacoding.jspider.api.model.Site;
05: import net.javacoding.jspider.core.SpiderContext;
06:
07: import java.net.URL;
08:
09: /**
10: * Interface to be implemented upon each class that will act as a Decision-
11: * taking class.
12: * A group of Rule objects will together decide whether a certain URL is
13: * eligible for spidering and/or parsing in a given context.
14: *
15: * $Id: Rule.java,v 1.1 2003/04/03 16:25:22 vanrogu Exp $
16: *
17: * @author Günther Van Roey
18: */
19: public interface Rule {
20:
21: /**
22: * Returns the name of the rule.
23: * @return the name of the rule
24: */
25: public String getName();
26:
27: /**
28: * Applies the rule to the given URL.
29: * @param context the context we're spidering in
30: * @param currentSite the site we're currently spidering
31: * @param url the URL to be evaluated
32: * @return Decision object telling whether the URL is accepted for a
33: * specific purpose.
34: */
35: public Decision apply(SpiderContext context, Site currentSite,
36: URL url);
37:
38: }
|