01: package de.anomic.plasma.urlPattern;
02:
03: import java.io.File;
04: import java.util.Arrays;
05: import java.util.HashSet;
06:
07: import de.anomic.yacy.yacyURL;
08:
09: public interface plasmaURLPattern {
10:
11: public static final String BLACKLIST_DHT = "dht";
12: public static final String BLACKLIST_CRAWLER = "crawler";
13: public static final String BLACKLIST_PROXY = "proxy";
14: public static final String BLACKLIST_SEARCH = "search";
15: public static final String BLACKLIST_SURFTIPS = "surftips";
16: public static final String BLACKLIST_NEWS = "news";
17:
18: public static final class blacklistFile {
19:
20: private final String filename;
21: private final String type;
22:
23: public blacklistFile(String filename, String type) {
24: this .filename = filename;
25: this .type = type;
26: }
27:
28: public String getFileName() {
29: return this .filename;
30: }
31:
32: /**
33: * Construct a unified array of file names from comma seperated file name
34: * list.
35: *
36: * @return unified String array of file names
37: */
38: public String[] getFileNamesUnified() {
39: HashSet<String> hs = new HashSet<String>(Arrays
40: .asList(this .filename.split(",")));
41:
42: return (String[]) hs.toArray(new String[hs.size()]);
43: }
44:
45: public String getType() {
46: return this .type;
47: }
48: }
49:
50: public String getEngineInfo();
51:
52: public void setRootPath(File rootPath);
53:
54: public int blacklistCacheSize();
55:
56: public int size();
57:
58: public void clear();
59:
60: public void removeAll(String blacklistType, String host);
61:
62: public void remove(String blacklistType, String host, String path);
63:
64: public void add(String blacklistType, String host, String path);
65:
66: public void loadList(String blacklistType, String filenames,
67: String sep);
68:
69: public void loadList(blacklistFile[] blFiles, String sep);
70:
71: public boolean hashInBlacklistedCache(String blacklistType,
72: String urlHash);
73:
74: public boolean isListed(String blacklistType, yacyURL url);
75:
76: public boolean isListed(String blacklistType, String hostlow,
77: String path);
78:
79: }
|