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 TypeMethodDescriptionvoidaddSequence(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.voidremoveSequence(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, removeForwarderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SequenceDBLiteGet the name of this sequence database.- Specified by:
getNamein interfaceSequenceDBLite- Returns:
- the name of the sequence database, which may be null.
-
addSequence
Description copied from interface:SequenceDBLiteAdds a sequence to the database.- Specified by:
addSequencein 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:SequenceDBLiteRemove the sequence associated with an ID from the database.- Specified by:
removeSequencein 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:SequenceDBLiteRetrieve a single sequence by its id.- Specified by:
getSequencein interfaceSequenceDBLite- Parameters:
id- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException- if there was a failure in retrieving the sequence
-