01: package net.javacoding.jspider.core;
02:
03: import net.javacoding.jspider.api.model.Cookie;
04: import net.javacoding.jspider.api.model.Site;
05: import net.javacoding.jspider.core.dispatch.EventDispatcher;
06: import net.javacoding.jspider.spi.Rule;
07: import net.javacoding.jspider.core.rule.Ruleset;
08: import net.javacoding.jspider.core.storage.Storage;
09:
10: import java.io.InputStream;
11: import java.net.URL;
12: import java.net.URLConnection;
13:
14: /**
15: *
16: * $Id: SpiderContext.java,v 1.17 2003/04/29 17:53:47 vanrogu Exp $
17: *
18: * @author Günther Van Roey
19: */
20: public interface SpiderContext {
21:
22: public void setCookies(Site site, Cookie[] cookies);
23:
24: public void preHandle(URLConnection connection, Site site);
25:
26: public void postHandle(URLConnection connection, Site site);
27:
28: public Storage getStorage();
29:
30: public Agent getAgent();
31:
32: public void setAgent(Agent agent);
33:
34: public URL getBaseURL();
35:
36: public EventDispatcher getEventDispatcher();
37:
38: public Ruleset getGeneralSpiderRules();
39:
40: public Ruleset getGeneralParserRules();
41:
42: public Ruleset getSiteSpiderRules(Site site);
43:
44: public Rule getSiteRobotsTXTRule(Site site);
45:
46: public Ruleset getSiteParserRules(Site site);
47:
48: public void throttle(Site site);
49:
50: public void registerRobotsTXT(Site site, InputStream inputStream);
51:
52: public void registerRobotsTXTError(Site site);
53:
54: public void registerRobotsTXTSkipped(Site site);
55:
56: public void registerNewSite(Site site);
57:
58: public boolean getUseProxy();
59:
60: public String getUserAgent();
61:
62: }
|