import java.util.StringTokenizer;\r
import java.util.Vector;\r
\r
+import org.biodas.jdas.client.ConnectionPropertyProviderI;\r
import org.biodas.jdas.client.SequenceClient;\r
import org.biodas.jdas.client.adapters.sequence.DasSequenceAdapter;\r
+import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;\r
import org.biodas.jdas.client.threads.SequenceClientMultipleSources;\r
import org.biodas.jdas.schema.sequence.SEQUENCE;\r
import org.biodas.jdas.schema.sources.COORDINATES;\r
protected String dbname = "DASCS";\r
\r
protected String dbrefname = "das:source";\r
-\r
+ protected MultipleConnectionPropertyProviderI connprops=null;\r
/**\r
* create a new DbSource proxy for a DAS 1 source\r
* \r
* if source is not capable of the 'sequence' command\r
*/\r
public DasSequenceSource(String dbname, String dbrefname, SOURCE source,\r
- VERSION version, COORDINATES coordsys) throws Exception\r
+ VERSION version, COORDINATES coordsys, MultipleConnectionPropertyProviderI connprops) throws Exception\r
{\r
- if (!(jsrc = new JalviewSource(source, false)).isSequenceSource())\r
+ if (!(jsrc = new JalviewSource(source, connprops, false)).isSequenceSource())\r
{\r
throw new Exception("Source " + source.getTitle()\r
+ " does not support the sequence command.");\r
this.dbname = dbname;\r
this.dbrefname = dbrefname;\r
this.coordsys = coordsys;\r
+ this.connprops=connprops;\r
}\r
\r
public String getAccessionSeparator()\r
System.err\r
.println("Retrieving IDs individually from das source: "\r
+ sr);\r
- // todo : get conn property provider\r
- org.biodas.jdas.client.SequenceClient sq = new SequenceClient();\r
+ org.biodas.jdas.client.SequenceClient sq = new SequenceClient(connprops.getConnectionPropertyProviderFor(sr));\r
for (String q : toks)\r
{\r
List<String> qset = Arrays.asList(new String[]\r
private List<jalviewSourceI> getDASSources()
{
- return getDASSources(getDasRegistryURL());
+ return getDASSources(getDasRegistryURL(), this);
}
/**
* @param registryURL
* return sources from registryURL
*/
- private static List<jalviewSourceI> getDASSources(String registryURL)
+ private static List<jalviewSourceI> getDASSources(String registryURL, MultipleConnectionPropertyProviderI registry)
{
try
{
Integer latest;
for (SOURCE src : dassources)
{
- JalviewSource jsrc=new JalviewSource(src, false);
+ JalviewSource jsrc=new JalviewSource(src, registry, false);
latest=latests.get(jsrc.getSourceURL());
if (latest!=null)
{
{
localSources = new Hashtable<String, jalviewSourceI>();
}
- jalviewSourceI src = new JalviewSource(local, true);
+ jalviewSourceI src = new JalviewSource(local, this, true);
localSources.put(local.getTitle(), src);
return src;
}
import java.util.List;
import java.util.Map;
+import org.biodas.jdas.client.threads.MultipleConnectionPropertyProviderI;
import org.biodas.jdas.dassources.Capabilities;
import org.biodas.jdas.dassources.utils.DasTimeFormat;
import org.biodas.jdas.dassources.utils.RegistrySourceAdapter;
public class JalviewSource implements jalviewSourceI
{
SOURCE source;
-
- public JalviewSource(SOURCE local2, boolean local)
+ MultipleConnectionPropertyProviderI connprov;
+ public JalviewSource(SOURCE local2, MultipleConnectionPropertyProviderI connprov, boolean local)
{
+ this.connprov=connprov;
this.local = local;
source = local2;
}
seqsources.add(ds = new DasSequenceSource(getTitle() + " ("
+ cs.getAuthority() + " " + cs.getSource()
+ (cs.getVersion() != null ? " " + cs.getVersion() : "")
- + ")", cs.getAuthority(), source, v, cs));
+ + ")", cs.getAuthority(), source, v, cs, connprov));
if (seqsources.size() > 1)
{
System.err.println("Added another sequence DB source for "
try
{
seqsources.add(new DasSequenceSource(getTitle(), getTitle(),
- source, getVersion(), null));
+ source, getVersion(), null, connprov));
} catch (Exception e)
{
// TODO Auto-generated catch block