Package org.biojava.bio.seq.db.biofetch
Class BioFetchSequenceDB
java.lang.Object
org.biojava.utils.Unchangeable
org.biojava.bio.seq.db.biofetch.BioFetchSequenceDB
- All Implemented Interfaces:
SequenceDBLite
,Changeable
Simple SequenceDB implementation backed by a BioFetch (HTTP)
server.
- Since:
- 1.3
- Author:
- Thomas Down, Matthew Pocock, Greg Cox, Keith James
-
Field Summary
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
Constructor Summary
ConstructorsConstructorDescriptionBioFetchSequenceDB
(String location, String dbName) Construct a BioFetchSequenceDB which connects to the specified BioFetch server. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSequence
(Sequence seq) Adds a sequence to the database.getName()
Get the name of this sequence database.getSequence
(String id) Retrieve a single sequence by its id.void
removeSequence
(String id) Remove the sequence associated with an ID from the database.Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
BioFetchSequenceDB
Construct a BioFetchSequenceDB which connects to the specified BioFetch server.- Parameters:
location
- The base URL of the server.dbName
- The database name to use.
-
-
Method Details
-
getName
Description copied from interface:SequenceDBLite
Get the name of this sequence database.- Specified by:
getName
in interfaceSequenceDBLite
- Returns:
- the name of the sequence database, which may be null.
-
addSequence
Description copied from interface:SequenceDBLite
Adds a sequence to the database.- Specified by:
addSequence
in interfaceSequenceDBLite
- Parameters:
seq
- the Sequence to add- Throws:
ChangeVetoException
- if either the database does not allow sequences to be added or the modification was vetoed
-
removeSequence
Description copied from interface:SequenceDBLite
Remove the sequence associated with an ID from the database.- Specified by:
removeSequence
in interfaceSequenceDBLite
- Parameters:
id
- the ID of the sequence to remove- Throws:
ChangeVetoException
- if either the database does not allow sequences to be removed or the modification was vetoed
-
getSequence
Description copied from interface:SequenceDBLite
Retrieve a single sequence by its id.- Specified by:
getSequence
in interfaceSequenceDBLite
- Parameters:
id
- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
BioException
- if there was a failure in retrieving the sequenceIllegalIDException
- if the database doesn't know about the id
-