From: jprocter Date: Thu, 1 Mar 2012 11:04:45 +0000 (+0000) Subject: revised version of Jdas with simpler connectionPropertyProviderI provider interface... X-Git-Tag: Jalview_2_9~532^2~31^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=daf7e11e56c1c5d99c2c1bc0113f33d2f0375f93;p=jalview.git revised version of Jdas with simpler connectionPropertyProviderI provider interface for multiple thread clients. --- diff --git a/lib/jdas-1.0.4.jar b/lib/jdas-1.0.4.jar index 84cec39..8316f65 100644 Binary files a/lib/jdas-1.0.4.jar and b/lib/jdas-1.0.4.jar differ diff --git a/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java b/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java index 187f436..b745519 100644 --- a/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java +++ b/src/jalview/ws/dbsources/das/api/DasSourceRegistryI.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import org.biodas.jdas.client.ConnectionPropertyProviderI; +import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI; import org.biodas.jdas.schema.sources.SOURCE; /** @@ -31,5 +32,5 @@ public interface DasSourceRegistryI List resolveSourceNicknames(List sources); // TODO: refactor to jDAS specific interface - Map getSessionHandler(); + MultipleConnectionPropertyProviderI getSessionHandler(); } diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java index b17f7f2..cf78202 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java @@ -22,6 +22,7 @@ import javax.swing.JOptionPane; import org.apache.http.auth.InvalidCredentialsException; import org.biodas.jdas.client.ConnectionPropertyProviderI; import org.biodas.jdas.client.SourcesClient; +import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI; import org.biodas.jdas.dassources.Capabilities; import org.biodas.jdas.schema.sources.CAPABILITY; import org.biodas.jdas.schema.sources.SOURCE; @@ -35,7 +36,8 @@ import jalview.ws.dbsources.das.api.jalviewSourceI; /** * */ -public class DasSourceRegistry implements DasSourceRegistryI +public class DasSourceRegistry implements DasSourceRegistryI, + MultipleConnectionPropertyProviderI { // private org.biodas.jdas.schema.sources.SOURCE[] dasSources = null; private List dasSources = null; @@ -326,8 +328,16 @@ public class DasSourceRegistry implements DasSourceRegistryI } @Override - public Map getSessionHandler() + public MultipleConnectionPropertyProviderI getSessionHandler() { + return this; + } + + @Override + public ConnectionPropertyProviderI getConnectionPropertyProviderFor( + String arg0) + { + final ConnectionPropertyProviderI conprov = new ConnectionPropertyProviderI() { boolean authed = false; @@ -380,8 +390,8 @@ public class DasSourceRegistry implements DasSourceRegistryI if (asuc != null && asuc.trim().length() > 0) { // authentication was successful - Cache.log.debug("Authenticated successfully as " + asuc - + " with " + connection.getURL().toString()); + Cache.log.debug("Authenticated successfully to " + + connection.getURL().toString()); return false; } // it wasn't - so we should tell the user it failed and ask if they @@ -397,95 +407,7 @@ public class DasSourceRegistry implements DasSourceRegistryI } } }; - return new Map() - { - - @Override - public void clear() - { - // TODO Auto-generated method stub - - } - - @Override - public boolean containsKey(Object key) - { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean containsValue(Object value) - { - // TODO Auto-generated method stub - return false; - } - - @Override - public Set> entrySet() - { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConnectionPropertyProviderI get(Object key) - { - return conprov; - } - - @Override - public boolean isEmpty() - { - // TODO Auto-generated method stub - return false; - } - - @Override - public Set keySet() - { - // TODO Auto-generated method stub - return null; - } - - @Override - public ConnectionPropertyProviderI put(String key, - ConnectionPropertyProviderI value) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public void putAll( - Map m) - { - // TODO Auto-generated method stub - - } - - @Override - public ConnectionPropertyProviderI remove(Object key) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public int size() - { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Collection values() - { - // TODO Auto-generated method stub - return null; - } - - }; + return conprov; } }