3 import jalview.datamodel.AlignmentI;
\r
5 import java.util.Hashtable;
\r
7 import com.stevesoft.pat.Regex;
\r
9 * generic Reference Retrieval interface for a particular database source/version as cited in DBRefEntry.
\r
10 * TODO: add/define property to describe max number of queries that this source can cope with at once.
\r
11 * TODO: add/define mechanism for retrieval of Trees and distance matrices from a database (unify with io)
\r
15 public interface DbSourceProxy
\r
19 * @return source string constant used for this DB source
\r
21 public String getDbSource();
\r
24 * @return version string for this database.
\r
26 public String getDbVersion();
\r
28 * Separator between individual accession queries for a database that allows multiple IDs
\r
29 * to be fetched in a single query. Null implies that only a single ID can be fetched at a time.
\r
30 * @return string for separating concatenated queries (as individually validated by the accession validator)
\r
32 public String getAccessionSeparator();
\r
34 * Regular expression for checking form of query string understood by this source.
\r
35 * @return null or a validation regex
\r
37 public Regex getAccessionValidator();
\r
39 * DbSource properties hash - define the capabilities of this source
\r
40 * Property hash methods defined in DbSourceProxyImpl.
\r
41 * See constants in jalview.datamodel.DBRefSource for definition of properties.
\r
44 public Hashtable getDbSourceProperties();
\r
47 * @return a test/example query that can be used to validate retrieval and parsing mechanisms
\r
49 public String getTestQuery();
\r
51 * optionally implemented
\r
55 public boolean isValidReference(String accession);
\r
57 * make one or more queries to the database
\r
58 * and attempt to parse the response into an alignment
\r
60 * @return null if queries were successful but result was not parsable
\r
61 * @throws Exception TODO
\r
63 public AlignmentI getSequenceRecords(String queries) throws Exception;
\r
66 * @return true if a query is currently being made
\r
68 public boolean queryInProgress();
\r
70 * get the raw reponse from the last set of queries
\r
71 * @return one or more string buffers for each individual query
\r
73 public StringBuffer getRawRecords();
\r