From daf7e11e56c1c5d99c2c1bc0113f33d2f0375f93 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 1 Mar 2012 11:04:45 +0000 Subject: [PATCH] revised version of Jdas with simpler connectionPropertyProviderI provider interface for multiple thread clients. --- lib/jdas-1.0.4.jar | Bin 244075 -> 245523 bytes .../ws/dbsources/das/api/DasSourceRegistryI.java | 3 +- .../dbsources/das/datamodel/DasSourceRegistry.java | 108 +++----------------- 3 files changed, 17 insertions(+), 94 deletions(-) diff --git a/lib/jdas-1.0.4.jar b/lib/jdas-1.0.4.jar index 84cec392a5c92ec4c35ed25e4af1df4fc7690379..8316f650619e55b3536de407ed25bf1b57b36f5f 100644 GIT binary patch delta 6420 zcma)>c|6t2|Ht_Z*>x;+Ey+^$gzQ;LiVi7D2-!j+`@Y1Zd=cOUy(H?%YT=S zYr|L1TN-6Yre){vGF;zx>r7tCV)zpMa>C7T_vK;~FTio(iAPztUfPDe4`2AT(3!Fa zOt$GUSI~uei1TMFyic^fATw{b+lB8kzu$y_&J%9Z37;RTBV)%E@)S%OCyJAzqWB_9 z=))~jLMpQo47)e6x>)8t}TyX!!0iGaEt zf#s+PusJpoVV8BGj4C$(Q+)9iFuE_RjS z%PPppwN)g~S~iaTGCkSXYx6|7^V#w%pZrr<&&ckxIWCqvf|n&9ho60ART8G3zq?;a z+K8)3L6O~+4lq%xBm-*rFg71?Yo`gLejeiQSwL{QMs_ED~Z5%XDh zPE#586TxDOa*V#leEOz>4aC_RlN!@Xo!AecTOh`I0gJk_}F#HFot*zd+k&l=%P>QD3Sj|nXvk@cYS$vHWp zAQkAKGIwx9PNX$V`#`vlO2NLn?DVEs=khZN=D&BCFq0lL&0as4#4sGvYkZgWF^fcb z+V|(9-uiF%j{T_fJi>YC9cC~uA}^cXaxr}DWwyBe%N>7wycqwGC*P9nvTG(@IykO> zs!gBZ*jab-OZz)rHIj=;winR<1k z%mSTAn?<%a{v;Pxm;1$$hHO$jyl)OiRT_K=;k6|4hb-hj8RP7}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na8^=!zuY_4qmj15W;f{Ac2e(l&K?=nrQ~1XFEaI_5@rE1u%a!yFWkz zKgoj7A%)Q6$Mqyt!4{=R5H}Y>R3m#XGMWd=`sJ1>IjU~rGB{cUT}Qfb5vB*hkH?E3 zDYiQohJ`MN1BxM}gBKT$|40+U<7AQK{HH{*_u;aVD}i~X2XGP5-7s{&Oz>j_Px12# z1#xAwZZOD$Jr$Q7RiN2 zVu{~Ht~fj;?u&yssvJr>aG3ag6nT|{^N~0byAWIB@zZkTO527b%VEx)Qi$ItZuCj8 z;!h^6FLMFuLW28{QM@V6MoDzCP)E=f|;YtX8C7;48E8)Om6j4I49AZ^gLi9srlZ205 z1sBfU3JP4ShD|b&$*wBs=ErHWOmf)mDJ<0CS_m=G=6iNZmPH&ctDLj2kCaYBkcI{> zyz?~dwU`TBB&_*Qxn7)xP)GmaYSXNSL-%zH7m2DyMugrKF7mhKM3Fp>>m+f>)EEYn) z@6TY7DPGn5l)>5tI4yjIDd98|31G!C*uq|tQ>;(WDTDC_$Ujt^6ykX8S!7T2%2L8r z25ytR9I_@x)o|lEiZBM+Vb-7a*RX0B_bhJ}JyOkLIHF1_*1K!nWbN0KJYHLa&RE zBJS~rOtxM?a!A1#;g4oeKnw=L*(MYIdb@W92YKL{^GFJRT{0!oyv6KBWK3vVVbexr zB;aO^cy@aQ?ez-6cK%2b*RPyn{mBMbH6lZ_XeGk*wb1^f5$3*o4c2Z#CJI6u5YL{_ zK(F0%Lw0-Gt)dYUX!5U_A0^W`I=07lt|1}{YW%zMt@#pi3 xe5y_gI?u0PiziIg@$!ElBy&P&;bZ@xImCNMvJ(>#ei}cm!I_6A&k2F&{{Sxj5m5jD 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; } } -- 1.7.10.2