Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- cleaned up yacy news - removed unused methods - avoid news generation in case that the peer runs in robinson mode
orbiterc93f4dda7299
diff --git a/htroot/Blog.java b/htroot/Blog.javaindex 9fa8c0391..43c2a5c15 100644--- a/htroot/Blog.java+++ b/htroot/Blog.java@@ -170,11 +170,13 @@ public class Blog {sb.blogDB.writeBlogEntry(sb.blogDB.newEntry(pagename, subject, author, ip, date, content, comments, commentMode));// create a news message- final Map<String, String> map = new HashMap<String, String>();- map.put("page", pagename);- map.put("subject", StrSubject.replace(',', ' '));- map.put("author", StrAuthor.replace(',', ' '));- sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_BLOG_ADD, map);+ if (!sb.isRobinsonMode()) {+ final Map<String, String> map = new HashMap<String, String>();+ map.put("page", pagename);+ map.put("subject", StrSubject.replace(',', ' '));+ map.put("author", StrAuthor.replace(',', ' '));+ sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_BLOG_ADD, map);+ }}page = sb.blogDB.readBlogEntry(pagename); //maybe "if(page == null)"diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.javaindex b195d9937..9eafe9126 100644--- a/htroot/Bookmarks.java+++ b/htroot/Bookmarks.java@@ -447,6 +447,7 @@ public class Bookmarks {private static void publishNews(final String url, final String title, final String description, final String tagsString) {// create a news message+ if (sb.isRobinsonMode()) return;final Map<String, String> map = new HashMap<String, String>();map.put("url", url.replace(',', '|'));map.put("title", title.replace(',', ' '));diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.javaindex daa18ea13..f44388e47 100644--- a/htroot/Crawler_p.java+++ b/htroot/Crawler_p.java@@ -339,7 +339,7 @@ public class Crawler_p {prop.putHTML("info_crawlingURL", (post.get("crawlingURL")));// generate a YaCyNews if the global flag was set- if (crawlOrder) {+ if (!sb.isRobinsonMode() && crawlOrder) {final Map<String, String> m = new HashMap<String, String>(pe); // must be clonedm.remove("specificDepth");m.remove("indexText");diff --git a/htroot/Network.html b/htroot/Network.htmlindex 8a7495225..b8e19ff98 100644--- a/htroot/Network.html+++ b/htroot/Network.html@@ -140,7 +140,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de#(isCrawling)#::<a href="#[page]#"><img src="/env/grafics/crawl.gif" width="54" height="11" alt="Crawl" /></a>#(/isCrawling)#</td><td><a href="http://www.#[fullname]#.yacy">#[shortname]#</a></td>- <td>#(type)##(direct)#<img src="/env/grafics/JuniorPassive.gif" width="11" height="11" title="Type: Junior | Contact: passive" alt="Junior passive" />::<img src="/env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior | Contact: direct" alt="Junior direct" />::<img src="/env/grafics/JuniorOffline.gif" width="11" height="11" title="Type: Junior | Contact: offline" alt="Junior offline" />#(/direct)#::#(direct)#<img src="/env/grafics/SeniorPassive.gif" width="11" height="11" title="Type: Senior | Contact: passive" alt="senior passive" />::<img src="/env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior | Contact: direct" alt="Senior direct" />::<img src="/env/grafics/SeniorOffline.gif" width="11" height="11" title="Type: Senior | Contact: offline" alt="Senior offline" />#(/direct)#::<a href="#[url]#">#(direct)#<img src="/env/grafics/PrincipalPassive.gif" width="11" height="11" title="Type: Principal | Contact: passive | Seed download: possible" alt="Principal passive" />::<img src="/env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal | Contact: direct | Seed download: possible" alt="Principal active" />::<img src="/env/grafics/PrincipalOffline.gif" width="11" height="11" title="Type: Principal | Contact: offline | Seed download: ?" alt="Principal offline" />#(/direct)#</a>#(/type)##(acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />::<img src="/env/grafics/CrawlYesOffline.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />#(/acceptcrawl)##(dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no; #[peertags]#" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />::<img src="/env/grafics/DHTReceiveYesOffline.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />#(/dhtreceive)##(rankingreceive)#<img src="/env/grafics/RankingReceiveNo.gif" width="11" height="11" title="Ranking Receive: no" alt="no ranking receive" />::<img src="/env/grafics/RankingReceiveYes.gif" width="11" height="11" title="Ranking Receive: yes" alt="Ranking receive enabled" />::<img src="/env/grafics/RankingCollects.gif" width="11" height="11" title="Ranking Receive: collection" alt="ranking collects" />#(/rankingreceive)#</td>+ <td>#(type)##(direct)#<img src="/env/grafics/JuniorPassive.gif" width="11" height="11" title="Type: Junior | Contact: passive" alt="Junior passive" />::<img src="/env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior | Contact: direct" alt="Junior direct" />::<img src="/env/grafics/JuniorOffline.gif" width="11" height="11" title="Type: Junior | Contact: offline" alt="Junior offline" />#(/direct)#::#(direct)#<img src="/env/grafics/SeniorPassive.gif" width="11" height="11" title="Type: Senior | Contact: passive" alt="senior passive" />::<img src="/env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior | Contact: direct" alt="Senior direct" />::<img src="/env/grafics/SeniorOffline.gif" width="11" height="11" title="Type: Senior | Contact: offline" alt="Senior offline" />#(/direct)#::<a href="#[url]#">#(direct)#<img src="/env/grafics/PrincipalPassive.gif" width="11" height="11" title="Type: Principal | Contact: passive | Seed download: possible" alt="Principal passive" />::<img src="/env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal | Contact: direct | Seed download: possible" alt="Principal active" />::<img src="/env/grafics/PrincipalOffline.gif" width="11" height="11" title="Type: Principal | Contact: offline | Seed download: ?" alt="Principal offline" />#(/direct)#</a>#(/type)##(acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />::<img src="/env/grafics/CrawlYesOffline.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />#(/acceptcrawl)##(dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no; #[peertags]#" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />::<img src="/env/grafics/DHTReceiveYesOffline.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />#(/dhtreceive)#</td><td align="right">#[version]#</td><td align="right">#[ppm]#</td><td align="right">#[qph]#</td>@@ -301,7 +301,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de</tr><tr class="TableCellDark"><td>#[my-name]#</td>- <td>#(my-info)#<img src="/env/grafics/Virgin.gif" width="11" height="11" title="Type: Virgin" alt="Virgin" />::<img src="/env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior" alt="Junior" />::<img src="/env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior" alt="Senior" />::<img src="/env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal" alt="Principal" />#(/my-info)##(my-acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="Crawl enabled" />#(/my-acceptcrawl)##(my-dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT Receive enabled" />#(/my-dhtreceive)##(my-rankingreceive)#<img src="/env/grafics/RankingReceiveNo.gif" width="11" height="11" title="Ranking Receive: no" alt="no ranking receive" />::<img src="/env/grafics/RankingReceiveYes.gif" width="11" height="11" title="Ranking Receive: yes" alt="Ranking receive enabled" />#(/my-rankingreceive)#</td>+ <td>#(my-info)#<img src="/env/grafics/Virgin.gif" width="11" height="11" title="Type: Virgin" alt="Virgin" />::<img src="/env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior" alt="Junior" />::<img src="/env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior" alt="Senior" />::<img src="/env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal" alt="Principal" />#(/my-info)##(my-acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="Crawl enabled" />#(/my-acceptcrawl)##(my-dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT Receive enabled" />#(/my-dhtreceive)#</td><td align="right">#[my-version]#</td><td align="right">#[my-utc]#</td><td align="right">#[my-uptime]#</td>diff --git a/htroot/Network.java b/htroot/Network.javaindex 03caf3ca5..26d5d17f9 100644--- a/htroot/Network.java+++ b/htroot/Network.java@@ -124,7 +124,6 @@ public class Network {}prop.put("table_my-acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0);prop.put("table_my-dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0);- prop.put("table_my-rankingreceive", seed.getFlagAcceptCitationReference() ? 1 : 0);myppm = sb.currentPPM();@@ -408,7 +407,6 @@ public class Network {if (page == 1) {prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", seed.getFlagAcceptRemoteCrawl() ? 1 : 0); // green=on or red=offprop.put(STR_TABLE_LIST + conCount + "_dhtreceive", seed.getFlagAcceptRemoteIndex() ? 1 : 0); // green=on or red=off- prop.put(STR_TABLE_LIST + conCount + "_rankingreceive", (seed.getVersion() >= yacyVersion.YACY_ACCEPTS_RANKING_TRANSMISSION) ? 1 : 0);} else { // Passive, Potential Peersif (seed.getFlagAcceptRemoteCrawl()) {prop.put(STR_TABLE_LIST + conCount + "_acceptcrawl", 2); // red/green: offline, was on@@ -420,13 +418,6 @@ public class Network {} else {prop.put(STR_TABLE_LIST + conCount + "_dhtreceive", 0); // red/red; offline was off}-- if (seed.getVersion() >= yacyVersion.YACY_ACCEPTS_RANKING_TRANSMISSION &&- seed.getFlagAcceptCitationReference()) {- prop.put(STR_TABLE_LIST + conCount + "_rankingreceive", 1);- } else {- prop.put(STR_TABLE_LIST + conCount + "_rankingreceive", 0);- }}if (seed.getFlagAcceptRemoteIndex()) {prop.put(STR_TABLE_LIST + conCount + "_dhtreceive_peertags", "");diff --git a/htroot/Network.xml b/htroot/Network.xmlindex 2426df5ed..35da906b8 100644--- a/htroot/Network.xml+++ b/htroot/Network.xml@@ -20,8 +20,7 @@<type>#(type)#junior::senior::principal#(/type)#</type><direct>#(type_direct)#direct::passive#(/type_direct)#</direct><acceptcrawl>#[acceptcrawl]#</acceptcrawl>- <dhtreceive>#[dhtreceive]#</dhtreceive>- <rankingreceive>#[rankingreceive]#</rankingreceive>+ <dhtreceive>#[dhtreceive]#</dhtreceive><location>#[location]#</location><seedurl>#[type_url]#</seedurl>#(complete)#@@ -74,7 +73,6 @@<rurls>#[my-RCount]#</rurls><acceptcrawl>#[my-acceptcrawl]#</acceptcrawl><acceptindex>#[my-dhtreceive]#</acceptindex>- <acceptranking>#[my-rankingreceive]#</acceptranking><sentwords>#[my-sI]#</sentwords><senturls>#[my-sU]#</senturls><receivedwords>#[my-rI]#</receivedwords>diff --git a/htroot/Supporter.java b/htroot/Supporter.javaindex b6ae9ce26..5d3cebb45 100644--- a/htroot/Supporter.java+++ b/htroot/Supporter.java@@ -76,11 +76,13 @@ public class Supporter {return prop;}// make new news message with voting- final HashMap<String, String> map = new HashMap<String, String>();- map.put("urlhash", hash);- map.put("vote", "negative");- map.put("refid", post.get("refid", ""));- sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ if (!sb.isRobinsonMode()) {+ final HashMap<String, String> map = new HashMap<String, String>();+ map.put("urlhash", hash);+ map.put("vote", "negative");+ map.put("refid", post.get("refid", ""));+ sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ }}if ((post != null) && ((hash = post.get("votePositive", null)) != null)) {if (!sb.verifyAuthentication(header, false)) {diff --git a/htroot/Surftips.java b/htroot/Surftips.javaindex 63b32ec81..04ddc5693 100644--- a/htroot/Surftips.java+++ b/htroot/Surftips.java@@ -84,11 +84,13 @@ public class Surftips {return prop;}// make new news message with voting- final HashMap<String, String> map = new HashMap<String, String>();- map.put("urlhash", hash);- map.put("vote", "negative");- map.put("refid", post.get("refid", ""));- sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ if (sb.isRobinsonMode()) {+ final HashMap<String, String> map = new HashMap<String, String>();+ map.put("urlhash", hash);+ map.put("vote", "negative");+ map.put("refid", post.get("refid", ""));+ sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ }}if ((post != null) && ((hash = post.get("votePositive", null)) != null)) {if (!sb.verifyAuthentication(header, false)) {diff --git a/htroot/Wiki.java b/htroot/Wiki.javaindex 420f06de1..c0d070dd1 100644--- a/htroot/Wiki.java+++ b/htroot/Wiki.java@@ -124,7 +124,7 @@ public class Wiki {final Map<String, String> map = new HashMap<String, String>();map.put("page", pagename);map.put("author", author.replace(',', ' '));- if (post.get("content", "").trim().length() > 0 && !new String(page.page()).equals(new String(content))) {+ if (!sb.isRobinsonMode() && post.get("content", "").trim().length() > 0 && !new String(page.page()).equals(new String(content))) {sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_WIKI_UPDATE, map);}page = newEntry;diff --git a/htroot/api/bookmarks/posts/add_p.java b/htroot/api/bookmarks/posts/add_p.javaindex 642137b45..96853a857 100755--- a/htroot/api/bookmarks/posts/add_p.java+++ b/htroot/api/bookmarks/posts/add_p.java@@ -79,6 +79,7 @@ public class add_p {}private static void publishNews(final String url, final String title, final String description, final String tagsString) {// create a news message+ if (sb.isRobinsonMode()) return;final Map<String, String> map = new HashMap<String, String>(8);map.put("url", url.replace(',', '|'));map.put("title", title.replace(',', ' '));diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 1ce8b8cff..e351bdf5d 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -425,11 +425,13 @@ public class yacysearch {indexSegment.termIndex().remove(Word.words2hashesHandles(query[0]), delHash.getBytes());// make new news message with negative voting- final HashMap<String, String> map = new HashMap<String, String>();- map.put("urlhash", delHash);- map.put("vote", "negative");- map.put("refid", "");- sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ if (!sb.isRobinsonMode()) {+ final HashMap<String, String> map = new HashMap<String, String>();+ map.put("urlhash", delHash);+ map.put("vote", "negative");+ map.put("refid", "");+ sb.peers.newsPool.publishMyNews(sb.peers.mySeed(), yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map);+ }} catch (IOException e) {Log.logException(e);}diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex 9d4721e66..48f723823 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -1017,7 +1017,7 @@ public final class Switchboard extends serverSwitch {// we are in robinson mode, if we do not exchange index by dht distribution// we need to take care that search requests and remote indexing requests go only// to the peers in the same cluster, if we run a robinson cluster.- return !getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, false) && !getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false);+ return (this.peers != null && this.peers.sizeConnected() == 0) || (!getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, false) && !getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false));}public boolean isPublicRobinson() {@@ -1649,7 +1649,7 @@ public final class Switchboard extends serverSwitch {}// initiate broadcast about peer startup to spread supporter url- if (this.peers.newsPool.size(yacyNewsPool.OUTGOING_DB) == 0) {+ if (!this.isRobinsonMode() && this.peers.newsPool.size(yacyNewsPool.OUTGOING_DB) == 0) {// read profilefinal Properties profile = new Properties();FileInputStream fileIn = null;diff --git a/source/de/anomic/yacy/yacyNewsDB.java b/source/de/anomic/yacy/yacyNewsDB.javaindex 1b197b917..631fae78e 100644--- a/source/de/anomic/yacy/yacyNewsDB.java+++ b/source/de/anomic/yacy/yacyNewsDB.java@@ -10,16 +10,16 @@// $LastChangedBy$//// This program is free software; you can redistribute it and/or modify-// it under the terms of the GNU General Public License as published by+// it under the terms of the GNU General private License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.+// GNU General private License for more details.//-// You should have received a copy of the GNU General Public License+// You should have received a copy of the GNU General private License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//@@ -72,11 +72,11 @@ public class yacyNewsDB {private final File path;private final Row rowdef;- protected final int attributesMaxLength;- protected Index news;+ private final int attributesMaxLength;+ private Index news;private static final int categoryStringLength = 8;- public static final int idLength = GenericFormatter.PATTERN_SHORT_SECOND.length() + Word.commonHashLength;+ public static final int idLength = GenericFormatter.PATTERN_SHORT_SECOND.length() + Word.commonHashLength;public yacyNewsDB(final File path,@@ -148,33 +148,6 @@ public class yacyNewsDB {}}- public synchronized Iterator<Record> news() throws IOException {- // the iteration iterates yacyNewsRecord - type objects- return new recordIterator();- }-- public class recordIterator implements Iterator<Record> {-- Iterator<Row.Entry> rowIterator;-- public recordIterator() throws IOException {- rowIterator = news.rows();- }-- public boolean hasNext() {- return rowIterator.hasNext();- }-- public Record next() {- return b2r(rowIterator.next());- }-- public void remove() {- rowIterator.remove();- }-- }-public synchronized Record get(final String id) throws IOException {try {return b2r(news.get(id.getBytes()));@@ -184,7 +157,7 @@ public class yacyNewsDB {}}- protected Record b2r(final Row.Entry b) {+ private Record b2r(final Row.Entry b) {if (b == null) return null;return new yacyNewsDB.Record(b.getColString(0, null),@@ -195,7 +168,7 @@ public class yacyNewsDB {);}- protected final Row.Entry r2b(final Record r) {+ private final Row.Entry r2b(final Record r) {if (r == null) return null;try {String attributes = r.attributes().toString();@@ -260,7 +233,7 @@ public class yacyNewsDB {private final Map<String, String> attributes; // elements of the news for a special category- protected Record(final String newsString) {+ private Record(final String newsString) {this.attributes = MapTools.string2map(newsString, ",");if (attributes.toString().length() > attributesMaxLength) throw new IllegalArgumentException("attributes length (" + attributes.toString().length() + ") exceeds maximum (" + attributesMaxLength + ")");this.category = (attributes.containsKey("cat")) ? attributes.get("cat") : "";@@ -272,7 +245,7 @@ public class yacyNewsDB {removeStandards();}- protected Record(final yacySeed mySeed, final String category, final Map<String, String> attributes) {+ private Record(final yacySeed mySeed, final String category, final Map<String, String> attributes) {if (category.length() > yacyNewsDB.categoryStringLength) throw new IllegalArgumentException("category length (" + category.length() + ") exceeds maximum (" + yacyNewsDB.categoryStringLength + ")");if (attributes.toString().length() > attributesMaxLength) throw new IllegalArgumentException("attributes length (" + attributes.toString().length() + ") exceeds maximum (" + attributesMaxLength + ")");this.attributes = attributes;@@ -284,7 +257,7 @@ public class yacyNewsDB {removeStandards();}- protected Record(final String id, final String category, final Date received, final int distributed, final Map<String, String> attributes) {+ private Record(final String id, final String category, final Date received, final int distributed, final Map<String, String> attributes) {if (category.length() > yacyNewsDB.categoryStringLength) throw new IllegalArgumentException("category length (" + category.length() + ") exceeds maximum (" + yacyNewsDB.categoryStringLength + ")");if (attributes.toString().length() > attributesMaxLength) throw new IllegalArgumentException("attributes length (" + attributes.toString().length() + ") exceeds maximum (" + attributesMaxLength + ")");this.attributes = attributes;diff --git a/source/de/anomic/yacy/yacyNewsPool.java b/source/de/anomic/yacy/yacyNewsPool.javaindex 56c0a0e55..dffd38ee2 100644--- a/source/de/anomic/yacy/yacyNewsPool.java+++ b/source/de/anomic/yacy/yacyNewsPool.java@@ -10,16 +10,16 @@// $LastChangedBy$//// This program is free software; you can redistribute it and/or modify-// it under the terms of the GNU General Public License as published by+// it under the terms of the GNU General private License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.+// GNU General private License for more details.//-// You should have received a copy of the GNU General Public License+// You should have received a copy of the GNU General private License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//@@ -71,7 +71,6 @@ public class yacyNewsPool {/* ------------------------------------------------------------------------* PROFILE related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_PROFILE = "prfl";/*** a profile entry was updated (implemented)*/@@ -84,71 +83,67 @@ public class yacyNewsPool {* a peer has done something good (i.e. served good search results)* and gets a positive vote so it can rise on the supporter page*/- public static final String CATEGORY_PROFILE_VOTE_GOOD = "prflegvt";+ private static final String CATEGORY_PROFILE_VOTE_GOOD = "prflegvt";/*** a peer has done something bad (i.e. spammed) and gets a negative vote*/- public static final String CATEGORY_PROFILE_VOTE_BAD = "prflebvt";+ private static final String CATEGORY_PROFILE_VOTE_BAD = "prflebvt";/* ------------------------------------------------------------------------* CRAWLING related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_CRAWL = "crwl";/**- * a crawl with remote indexing was startet+ * a crawl with remote indexing was started*/public static final String CATEGORY_CRAWL_START = "crwlstrt";/*** a crawl with remote indexing was stopped*/- public static final String CATEGORY_CRAWL_STOP = "crwlstop";+ private static final String CATEGORY_CRAWL_STOP = "crwlstop";/*** a comment on a crawl with remote indexing*/- public static final String CATEGORY_CRAWL_COMMENT = "crwlcomm";+ private static final String CATEGORY_CRAWL_COMMENT = "crwlcomm";/* ------------------------------------------------------------------------* BLACKLIST related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_BLACKLIST = "blckl";/**- * a public blacklist entry was added+ * a private blacklist entry was added*/- public static final String CATEGORY_BLACKLIST_ADD = "blckladd";+ private static final String CATEGORY_BLACKLIST_ADD = "blckladd";/**- * a vote and comment on a public blacklist add+ * a vote and comment on a private blacklist add*/- public static final String CATEGORY_BLACKLIST_VOTE_ADD = "blcklavt";+ private static final String CATEGORY_BLACKLIST_VOTE_ADD = "blcklavt";/**- * a public blacklist entry was deleted+ * a private blacklist entry was deleted*/- public static final String CATEGORY_BLACKLIST_DELETE = "blckldel";+ private static final String CATEGORY_BLACKLIST_DELETE = "blckldel";/**- * a vote and comment on a public blacklist delete+ * a vote and comment on a private blacklist delete*/- public static final String CATEGORY_BLACKLIST_VOTE_DEL = "blckldvt";+ private static final String CATEGORY_BLACKLIST_VOTE_DEL = "blckldvt";/* ------------------------------------------------------------------------* FLIE-SHARE related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_FILESHARE = "flshr";/*** a file was added to the file share*/- public static final String CATEGORY_FILESHARE_ADD = "flshradd";+ private static final String CATEGORY_FILESHARE_ADD = "flshradd";/*** a file was added to the file share*/- public static final String CATEGORY_FILESHARE_DEL = "flshrdel";+ private static final String CATEGORY_FILESHARE_DEL = "flshrdel";/*** a comment to a file share entry*/- public static final String CATEGORY_FILESHARE_COMMENT = "flshrcom";+ private static final String CATEGORY_FILESHARE_COMMENT = "flshrcom";/* ------------------------------------------------------------------------* BOOKMARK related CATEGORIES- * ------------------------------------------------------------------------ */- public static final String CATEGORY_BOOKMARK = "bkmrk";+ * ------------------------------------------------------------------------ *//*** a bookmark was added/created*/@@ -156,41 +151,39 @@ public class yacyNewsPool {/*** a vote and comment on a bookmark add*/- public static final String CATEGORY_BOOKMARK_VOTE_ADD = "bkmrkavt";+ private static final String CATEGORY_BOOKMARK_VOTE_ADD = "bkmrkavt";/*** a bookmark was moved*/- public static final String CATEGORY_BOOKMARK_MOVE = "bkmrkmov";+ private static final String CATEGORY_BOOKMARK_MOVE = "bkmrkmov";/*** a vote and comment on a bookmark move*/- public static final String CATEGORY_BOOKMARK_VOTE_MOVE = "bkmrkmvt";+ private static final String CATEGORY_BOOKMARK_VOTE_MOVE = "bkmrkmvt";/*** a bookmark was deleted*/- public static final String CATEGORY_BOOKMARK_DEL = "bkmrkdel";+ private static final String CATEGORY_BOOKMARK_DEL = "bkmrkdel";/*** a vote and comment on a bookmark delete*/- public static final String CATEGORY_BOOKMARK_VOTE_DEL = "bkmrkdvt";+ private static final String CATEGORY_BOOKMARK_VOTE_DEL = "bkmrkdvt";/* ------------------------------------------------------------------------* SURFTIPP related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_SURFTIPP = "stipp";/*** a surf tipp was added*/- public static final String CATEGORY_SURFTIPP_ADD = "stippadd";+ public static final String CATEGORY_SURFTIPP_ADD = "stippadd";/*** a vote and comment on a surf tipp*/- public static final String CATEGORY_SURFTIPP_VOTE_ADD = "stippavt";+ public static final String CATEGORY_SURFTIPP_VOTE_ADD = "stippavt";/* ------------------------------------------------------------------------* WIKI related CATEGORIES* ------------------------------------------------------------------------ */- public static final String CATEGORY_WIKI = "wiki";/*** a wiki page was updated*/@@ -198,12 +191,11 @@ public class yacyNewsPool {/*** a wiki page das deleted*/- public static final String CATEGORY_WIKI_DEL = "wiki_del";+ private static final String CATEGORY_WIKI_DEL = "wiki_del";/* ------------------------------------------------------------------------* BLOG related CATEGORIES- * ------------------------------------------------------------------------ */- public static final String CATEGORY_BLOG = "blog";+ * ------------------------------------------------------------------------ *//*** a blog entry was added*/@@ -211,12 +203,12 @@ public class yacyNewsPool {/*** a blog page das deleted*/- public static final String CATEGORY_BLOG_DEL = "blog_del";+ private static final String CATEGORY_BLOG_DEL = "blog_del";/* ========================================================================* ARRAY of valid CATEGORIES* ======================================================================== */- public static final String[] category = {+ private static final String[] category = {// PROFILE related CATEGORIESCATEGORY_PROFILE_UPDATE,CATEGORY_PROFILE_BROADCAST,@@ -259,7 +251,7 @@ public class yacyNewsPool {CATEGORY_BLOG_ADD,CATEGORY_BLOG_DEL};- public static final HashSet<String> categories = new HashSet<String>();+ private static final HashSet<String> categories = new HashSet<String>();static {for (int i = 0; i < category.length; i++) categories.add(category[i]);}@@ -288,10 +280,6 @@ public class yacyNewsPool {processedNews.close();}- public int dbSize() {- return newsDB.size();- }-public Iterator<yacyNewsDB.Record> recordIterator(final int dbKey, final boolean up) {// returns an iterator of yacyNewsRecord-type objectsfinal yacyNewsQueue queue = switchQueue(dbKey);@@ -310,7 +298,7 @@ public class yacyNewsPool {publishMyNews(newsDB.newRecord(mySeed, category, attributes));}- public void publishMyNews(final yacyNewsDB.Record record) {+ private void publishMyNews(final yacyNewsDB.Record record) {// this shall be called if our peer generated a new news record and wants to publish itif (record == null) return;try {@@ -447,18 +435,6 @@ public class yacyNewsPool {}return null;}-/*- * java.io.FileNotFoundException: /home/administrator/yacy/DATA/INDEX/webportal/NETWORK/newsOut.table (Too many open files)- at java.io.FileInputStream.open(Native Method)- at java.io.FileInputStream.<init>(FileInputStream.java:137)- at net.yacy.kelondro.table.ChunkIterator.<init>(ChunkIterator.java:63)- at net.yacy.kelondro.table.Table$rowIteratorNoOrder.<init>(Table.java:832)- at net.yacy.kelondro.table.Table.rows(Table.java:825)- at de.anomic.yacy.yacyNewsQueue$newsIterator.<init>(yacyNewsQueue.java:193)- at de.anomic.yacy.yacyNewsQueue.records(yacyNewsQueue.java:183)- at de.anomic.yacy.yacyNewsPool.getSpecific(yacyNewsPool.java:440)- at yacysearchitem.respond(yacysearchitem.java:119)- */public synchronized yacyNewsDB.Record getByOriginator(final int dbKey, final String category, final String originatorHash) {final yacyNewsQueue queue = switchQueue(dbKey);diff --git a/source/de/anomic/yacy/yacyNewsQueue.java b/source/de/anomic/yacy/yacyNewsQueue.javaindex ca2c43058..c5cce975a 100644--- a/source/de/anomic/yacy/yacyNewsQueue.java+++ b/source/de/anomic/yacy/yacyNewsQueue.java@@ -10,16 +10,16 @@// $LastChangedBy$//// This program is free software; you can redistribute it and/or modify-// it under the terms of the GNU General Public License as published by+// it under the terms of the GNU General private License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.+// GNU General private License for more details.//-// You should have received a copy of the GNU General Public License+// You should have received a copy of the GNU General private License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//@@ -63,10 +63,10 @@ import net.yacy.kelondro.util.FileUtils;public class yacyNewsQueue {private final File path;- Table queueStack;+ private Table queueStack;private final yacyNewsDB newsDB;- public static final Row rowdef = new Row(new Column[]{+ private static final Row rowdef = new Row(new Column[]{new Column("newsid", Column.celltype_string, Column.encoder_bytes, yacyNewsDB.idLength, "id = created + originator"),new Column("last touched", Column.celltype_string, Column.encoder_bytes, GenericFormatter.PATTERN_SHORT_SECOND.length(), "")},@@ -121,7 +121,7 @@ public class yacyNewsQueue {Log.logSevere("yacyNewsQueue", "reset of table " + this.path);queueStack.clear();}- queueStack.addUnique(r2b(entry, true));+ queueStack.addUnique(r2b(entry));}public synchronized yacyNewsDB.Record pop() throws IOException {@@ -163,14 +163,9 @@ public class yacyNewsQueue {return newsDB.get(id);}- private Row.Entry r2b(final yacyNewsDB.Record r, final boolean updateDB) throws IOException, RowSpaceExceededException {+ private Row.Entry r2b(final yacyNewsDB.Record r) throws IOException, RowSpaceExceededException {if (r == null) return null;- if (updateDB) {- newsDB.put(r);- } else {- final yacyNewsDB.Record r1 = newsDB.get(r.id());- if (r1 == null) newsDB.put(r);- }+ newsDB.put(r);final Row.Entry b = queueStack.row().newEntry(new byte[][]{r.id().getBytes(),GenericFormatter.SHORT_SECOND_FORMATTER.format(new Date()).getBytes()});@@ -183,12 +178,12 @@ public class yacyNewsQueue {return new newsIterator(up);}- public class newsIterator implements Iterator<yacyNewsDB.Record> {+ private class newsIterator implements Iterator<yacyNewsDB.Record> {// iterates yacyNewsRecord-type objectsIterator<Row.Entry> stackNodeIterator;- public newsIterator(final boolean up) {+ private newsIterator(final boolean up) {try {stackNodeIterator = queueStack.rows();} catch (IOException e) {diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.javaindex 10d763674..0e3f0f238 100644--- a/source/de/anomic/yacy/yacySeed.java+++ b/source/de/anomic/yacy/yacySeed.java@@ -157,7 +157,6 @@ public class yacySeed implements Cloneable {private static final int FLAG_DIRECT_CONNECT = 0;private static final int FLAG_ACCEPT_REMOTE_CRAWL = 1;private static final int FLAG_ACCEPT_REMOTE_INDEX = 2;- private static final int FLAG_ACCEPT_CITATION_REFERENCE = 3;public static final String DFLT_NETWORK_UNIT = "freeworld";public static final String DFLT_NETWORK_GROUP = "";@@ -218,7 +217,6 @@ public class yacySeed implements Cloneable {setFlagDirectConnect(false);setFlagAcceptRemoteCrawl(true);setFlagAcceptRemoteIndex(true);- setFlagAcceptCitationReference(true);setUnusedFlags();// index transfer@@ -473,22 +471,6 @@ public class yacySeed implements Cloneable {return Integer.parseInt(port);}- /**- * To synchronize peer pings the local time differential must be included in calculations.- * @return the difference to UTC (universal time coordinated) in milliseconds of this yacySeed,- * the difference to <code>+0130</code> if not present or <code>0</code> if an error occured during conversion- */- /*- public final long getUTCDiff() {- String utc = this.dna.get(yacySeed.UTC);- if (utc == null) { utc = "+0130"; }- try {- return DateFormatter.UTCDiff(utc);- } catch (final IllegalArgumentException e) {- return 0;- }- }- *//** puts the current time into the lastseen field and cares about the time differential to UTC */public final void setLastSeenUTC() {// because java thinks it must apply the UTC offset to the current time,@@ -607,7 +589,6 @@ public class yacySeed implements Cloneable {public final void setFlagDirectConnect(final boolean value) { setFlag(FLAG_DIRECT_CONNECT, value); }public final void setFlagAcceptRemoteCrawl(final boolean value) { setFlag(FLAG_ACCEPT_REMOTE_CRAWL, value); }public final void setFlagAcceptRemoteIndex(final boolean value) { setFlag(FLAG_ACCEPT_REMOTE_INDEX, value); }- public final void setFlagAcceptCitationReference(final boolean value) { setFlag(FLAG_ACCEPT_CITATION_REFERENCE, value); }public final boolean getFlagDirectConnect() { return getFlag(0); }public final boolean getFlagAcceptRemoteCrawl() {//if (getVersion() < 0.300) return false;@@ -618,9 +599,6 @@ public class yacySeed implements Cloneable {//if (getVersion() < 0.335) return false;return getFlag(2);}- public final boolean getFlagAcceptCitationReference() {- return getFlag(3);- }public final void setUnusedFlags() {for (int i = 4; i < 24; i++) { setFlag(i, true); }}diff --git a/source/de/anomic/yacy/yacyVersion.java b/source/de/anomic/yacy/yacyVersion.javaindex 5a775bb1c..c3cf2ff36 100644--- a/source/de/anomic/yacy/yacyVersion.java+++ b/source/de/anomic/yacy/yacyVersion.java@@ -12,7 +12,6 @@ public class yacyVersion implements Comparator<yacyVersion>, Comparable<yacyVerspublic static final float YACY_SUPPORTS_PORT_FORWARDING = (float) 0.383;public static final float YACY_SUPPORTS_GZIP_POST_REQUESTS_CHUNKED = (float) 0.58204761;- public static final float YACY_ACCEPTS_RANKING_TRANSMISSION = (float) 0.414;public static final float YACY_HANDLES_COLLECTION_INDEX = (float) 0.486;public static final float YACY_POVIDES_REMOTECRAWL_LISTS = (float) 0.550;public static final float YACY_STANDARDREL_IS_PRO = (float) 0.557;