removed yacy peer types from serverSwitch

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@758 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2005-09-20 23:15:33 +00:00
parent b990dc1ad1
commit 96a5b6e8fb
5 changed files with 18 additions and 24 deletions

View File

@ -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"));

View File

@ -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 addendum
final 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 status
if (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 seed
yacyCore.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 cache
if ((remoteSeed.hash != null) && (remoteSeed.isProper() == null)) {

View File

@ -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 application
public String getRootPath();

View File

@ -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 variables

View File

@ -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.db
ramCacheLURL = 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.db
ramCacheMessage = 8192