01: package net.javacoding.jspider.core.storage;
02:
03: import net.javacoding.jspider.api.model.*;
04: import net.javacoding.jspider.core.event.impl.*;
05: import net.javacoding.jspider.core.storage.exception.InvalidStateTransitionException;
06:
07: import java.net.URL;
08:
09: /**
10: * $Id: ResourceDAO.java,v 1.10 2003/04/11 16:37:05 vanrogu Exp $
11: */
12: public interface ResourceDAO {
13:
14: public Resource registerURL(URL url);
15:
16: public void registerURLReference(URL url, URL referer);
17:
18: public Resource[] getAllResources();
19:
20: public Resource[] getRefereringResources(Resource resource);
21:
22: public Resource[] getReferencedResources(Resource resource);
23:
24: public ResourceReference[] getIncomingReferences(Resource resource);
25:
26: public ResourceReference[] getOutgoingReferences(Resource resource);
27:
28: public Resource[] getRootResources(Site site);
29:
30: public Resource[] getBySite(Site site);
31:
32: public Resource[] findByFolder(Folder folder);
33:
34: public Resource getResource(URL url);
35:
36: public void setSpidered(URL url, URLSpideredOkEvent event);
37:
38: public void setIgnoredForParsing(URL url)
39: throws InvalidStateTransitionException;
40:
41: public void setIgnoredForFetching(URL url, URLFoundEvent event)
42: throws InvalidStateTransitionException;
43:
44: public void setForbidden(URL url, URLFoundEvent event)
45: throws InvalidStateTransitionException;
46:
47: public void setError(URL url, ResourceParsedErrorEvent event)
48: throws InvalidStateTransitionException;
49:
50: public void setParsed(URL url, ResourceParsedOkEvent event)
51: throws InvalidStateTransitionException;
52:
53: public void setError(URL url, URLSpideredErrorEvent event)
54: throws InvalidStateTransitionException;
55:
56: }
|