|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This defines the objects that IndexedSequenceDB uses to store all of the database state, such as name, format, sequence builder and the actual file offsets.
In general, these objects should be transactional. Calls to store should add the index to temporary storage. When commit is invoked, these indices should all be added to the permanent storage. When rollback is invoked, these indexes should be discarded. If commit fails for any reason, it should leave the permanent storage in the pre-commit status.
Method Summary | |
void |
commit()
Commit the stored indices to permanent storage. |
Index |
fetch(java.lang.String id)
Fetch an Index based upon an ID. |
java.util.Set |
getFiles()
Retrieve the Set of files that are currently indexed. |
SequenceFormat |
getFormat()
Retrieve the format of the index file. |
java.util.Set |
getIDs()
Retrieve the set of all current IDs. |
java.lang.String |
getName()
Retrieve the name of this store. |
SequenceBuilderFactory |
getSBFactory()
Retrieve the SequenceBuilderFactory used to build Sequence instances. |
SymbolTokenization |
getSymbolParser()
Retrieve the symbol parser used to turn the sequence characters into Symobl objects. |
void |
rollback()
Discard all uncommited changes. |
void |
store(Index indx)
Add the Index to the store. |
Method Detail |
public void store(Index indx) throws IllegalIDException, BioException
This method should be transactional. If the store fails, the IndexStore should be left in its original state.
If the file of the Index is not known yet, it is the responsibility of the IndexStore to add it to the set returned by getFiles.
indx
- the Index to add
IllegalIDException
- if the index has an invalid ID field
BioException
- if the store failedpublic void commit() throws BioException
BioException
- if for any reason the commit failspublic void rollback()
public Index fetch(java.lang.String id) throws IllegalIDException, BioException
id
- The ID of the sequence Index to retrieve
IllegalIDException
- if the ID couldn't be found
BioException
- if the fetch fails in the underlying storage mechanismpublic java.lang.String getName()
public java.util.Set getIDs()
This set should either be immutable, or modifiable totally separately from the IndexStore.
public java.util.Set getFiles()
public SequenceFormat getFormat()
This set should either be immutable, or modifiable totally separately from the IndexStore.
public SequenceBuilderFactory getSBFactory()
public SymbolTokenization getSymbolParser()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |