1 package jalview.ws.seqfetcher;
\r
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
23 * Short meaningful name for this data source for
\r
24 * display in menus or selection boxes.
\r
27 public String getDbName();
\r
30 * @return version string for this database.
\r
32 public String getDbVersion();
\r
34 * Separator between individual accession queries for a database that allows multiple IDs
\r
35 * to be fetched in a single query. Null implies that only a single ID can be fetched at a time.
\r
36 * @return string for separating concatenated queries (as individually validated by the accession validator)
\r
38 public String getAccessionSeparator();
\r
40 * Regular expression for checking form of query string understood by this source.
\r
41 * @return null or a validation regex
\r
43 public Regex getAccessionValidator();
\r
45 * DbSource properties hash - define the capabilities of this source
\r
46 * Property hash methods defined in DbSourceProxyImpl.
\r
47 * See constants in jalview.datamodel.DBRefSource for definition of properties.
\r
50 public Hashtable getDbSourceProperties();
\r
53 * @return a test/example query that can be used to validate retrieval and parsing mechanisms
\r
55 public String getTestQuery();
\r
57 * optionally implemented
\r
61 public boolean isValidReference(String accession);
\r
63 * make one or more queries to the database
\r
64 * and attempt to parse the response into an alignment
\r
66 * @return null if queries were successful but result was not parsable
\r
67 * @throws Exception TODO
\r
69 public AlignmentI getSequenceRecords(String queries) throws Exception;
\r
72 * @return true if a query is currently being made
\r
74 public boolean queryInProgress();
\r
76 * get the raw reponse from the last set of queries
\r
77 * @return one or more string buffers for each individual query
\r
79 public StringBuffer getRawRecords();
\r