Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
removed yacy peer types from serverSwitch
orbiter96a5b6e8fb6c
diff --git a/htroot/htdocsdefault/welcome.java b/htroot/htdocsdefault/welcome.javaindex 0453968b4..e81967b65 100644--- a/htroot/htdocsdefault/welcome.java+++ b/htroot/htdocsdefault/welcome.java@@ -53,6 +53,7 @@ import de.anomic.server.serverCore;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;import de.anomic.yacy.yacyCore;+import de.anomic.yacy.yacySeed;public class welcome {@@ -75,8 +76,8 @@ public class welcome {prop.put("port", env.getConfig("port", "8080"));prop.put("clientip", header.get("CLIENTIP", ""));- final String peertype = (yacyCore.seedDB.mySeed == null) ? serverSwitch.PEERTYPE_JUNIOR : yacyCore.seedDB.mySeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_VIRGIN);- final boolean senior = (peertype.equals(serverSwitch.PEERTYPE_SENIOR)) || (peertype.equals(serverSwitch.PEERTYPE_PRINCIPAL));+ final String peertype = (yacyCore.seedDB.mySeed == null) ? yacySeed.PEERTYPE_JUNIOR : yacyCore.seedDB.mySeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN);+ final boolean senior = (peertype.equals(yacySeed.PEERTYPE_SENIOR)) || (peertype.equals(yacySeed.PEERTYPE_PRINCIPAL));if (senior) { prop.put("couldcan", "can"); } else { prop.put("couldcan", "could"); }if (senior) { prop.put("seniorinfo", "This peer runs in senior mode which means that your peer can be accessed using the addresses shown above."); } else { prop.put("seniorinfo", "<b>Nobody can access your peer from the outside of your intranet. You must open your firewall and/or set a 'virtual server' in the settings of your router to enable access to the addresses as shown below.</b>"); }prop.put("wwwpath", "<application_root_path>/" + env.getConfig("htDocsPath", "DATA/HTDOCS"));diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.javaindex 557ac88be..04dc1806a 100644--- a/htroot/yacy/hello.java+++ b/htroot/yacy/hello.java@@ -92,7 +92,7 @@ public class hello {// we easily know the caller's IP:final String clientip = (String) header.get("CLIENTIP", "<unknown>"); // read an artificial header addendumfinal String reportedip = remoteSeed.get(STR_IP, "");- final String reportedPeerType = remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_JUNIOR);+ final String reportedPeerType = remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_JUNIOR);final float clientversion = remoteSeed.getVersion();int urls = -1;@@ -139,22 +139,22 @@ public class hello {// assign statusif (urls >= 0) {- if (remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR) == null) {- prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_SENIOR);- remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR);- } else if (remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_PRINCIPAL).equals(serverSwitch.PEERTYPE_PRINCIPAL)) {- prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_PRINCIPAL);+ if (remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) == null) {+ prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_SENIOR);+ remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR);+ } else if (remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_PRINCIPAL).equals(yacySeed.PEERTYPE_PRINCIPAL)) {+ prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_PRINCIPAL);} else {- prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_SENIOR);- remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR);+ prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_SENIOR);+ remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR);}// connect the seedyacyCore.peerActions.peerArrival(remoteSeed, true);} else {- prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_JUNIOR);+ prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_JUNIOR);remoteSeed.put(STR_LASTSEEN, yacyCore.universalDateShortString());yacyCore.peerActions.juniorConnects++; // update statistics- remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_JUNIOR);+ remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_JUNIOR);yacyCore.log.logInfo("hello: responded remote junior peer '" + remoteSeed.getName() + "' from " + reportedip);// no connection here, instead store junior in connection cacheif ((remoteSeed.hash != null) && (remoteSeed.isProper() == null)) {diff --git a/source/de/anomic/server/serverSwitch.java b/source/de/anomic/server/serverSwitch.javaindex 1fb3f9708..0275a92fe 100644--- a/source/de/anomic/server/serverSwitch.java+++ b/source/de/anomic/server/serverSwitch.java@@ -55,12 +55,6 @@ import de.anomic.server.logging.serverLog;public interface serverSwitch {- public static final String PEERTYPE = "PeerType";- public static final String PEERTYPE_VIRGIN = "virgin";- public static final String PEERTYPE_JUNIOR = "junior";- public static final String PEERTYPE_SENIOR = "senior";- public static final String PEERTYPE_PRINCIPAL = "principal";-// the root path for the applicationpublic String getRootPath();diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.javaindex 8469dbdd1..1d93ccb66 100644--- a/source/de/anomic/yacy/yacySeed.java+++ b/source/de/anomic/yacy/yacySeed.java@@ -82,7 +82,6 @@ public class yacySeed {public static final String PEERTYPE_JUNIOR = "junior";public static final String PEERTYPE_SENIOR = "senior";public static final String PEERTYPE_PRINCIPAL = "principal";-public static final String PEERTYPE = "PeerType";// class variablesdiff --git a/yacy.init b/yacy.initindex 1c9832a38..544d75238 100644--- a/yacy.init+++ b/yacy.init@@ -437,23 +437,23 @@ xpstopw=true# ram cache for database files-# ram cache for assortment cache cluster (for all 50 files)+# ram cache for assortment cache cluster (for all 64 files)ramCacheRWI = 8388608# ram cache for responseHeader.db-ramCacheHTTP = 1048576+ramCacheHTTP = 4194304# ram cache for urlHash.dbramCacheLURL = 4194304# ram cache for urlNotice.db-ramCacheNURL = 524288+ramCacheNURL = 4194304# ram cache for urlErr.db-ramCacheEURL = 131072+ramCacheEURL = 8192# ram cache for seedDBs-ramCacheDHT = 131072+ramCacheDHT = 8192# ram cache for message.dbramCacheMessage = 8192