From 0587077d066efe32ea92133bb5b64bf9f2d5dbea Mon Sep 17 00:00:00 2001 From: reger Date: Wed, 14 May 2014 23:13:49 +0200 Subject: [PATCH] cleanup obsolete and not used serverswitch Authentify code as auth is mostly delegated to Jetty container. --- source/net/yacy/server/serverSwitch.java | 64 +----------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/source/net/yacy/server/serverSwitch.java b/source/net/yacy/server/serverSwitch.java index 56b95d362..8c71614ae 100644 --- a/source/net/yacy/server/serverSwitch.java +++ b/source/net/yacy/server/serverSwitch.java @@ -65,7 +65,6 @@ public class serverSwitch protected int serverJobs; private ConcurrentMap configProps; private final ConcurrentMap configRemoved; - private final ConcurrentMap authorization; private final NavigableMap workerThreads; private YaCyHttpServer httpserver; // implemented HttpServer @@ -125,14 +124,11 @@ public class serverSwitch saveConfig(); } - // other settings - this.authorization = new ConcurrentHashMap(); - // init thread control this.workerThreads = new TreeMap(); // init busy state control - this.serverJobs = 0; + //this.serverJobs = 0; // init server tracking serverAccessTracker.init( @@ -458,64 +454,6 @@ public class serverSwitch return this.workerThreads.keySet().iterator(); } - // authentication routines: - - public void setAuthentify(final InetAddress host, final String user, final String rights) { - // sets access attributes according to host addresses - this.authorization.put(host, user + "@" + rights); - } - - public void removeAuthentify(final InetAddress host) { - // remove access attributes according to host addresses - this.authorization.remove(host); - } - - public String getAuthentifyUser(final InetAddress host) { - // read user name according to host addresses - final String a = this.authorization.get(host); - if ( a == null ) { - return null; - } - final int p = a.indexOf('@'); - if ( p < 0 ) { - return null; - } - return a.substring(0, p); - } - - public String getAuthentifyRights(final InetAddress host) { - // read access rigths according to host addresses - final String a = this.authorization.get(host); - if ( a == null ) { - return null; - } - final int p = a.indexOf('@'); - if ( p < 0 ) { - return null; - } - return a.substring(p + 1); - } - - public void addAuthentifyRight(final InetAddress host, final String right) { - final String rights = getAuthentifyRights(host); - if ( rights == null ) { - // create new authentication - setAuthentify(host, "unknown", right); - } else { - // add more authentication - final String user = getAuthentifyUser(host); - setAuthentify(host, user, rights + right); - } - } - - public boolean hasAuthentifyRight(final InetAddress host, final String right) { - final String rights = getAuthentifyRights(host); - if ( rights == null ) { - return false; - } - return rights.indexOf(right) >= 0; - } - public File getDataPath() { return this.dataPath; }