| jdbm.RecordManager
All known Subclasses: jdbm.recman.BaseRecordManager, jdbm.recman.CacheRecordManager,
RecordManager | public interface RecordManager (Code) | | An interface to manages records, which are uninterpreted blobs of data.
The set of record operations is simple: fetch, insert, update and delete.
Each record is identified using a "rowid" and contains a byte[] data block.
Rowids are returned on inserts and you can store them someplace safe
to be able to get back to them. Data blocks can be as long as you wish,
and may have lengths different from the original when updating.
author: Alex Boisvert author: Cees de Groot version: $Id: RecordManager.java,v 1.3 2005/06/25 23:12:31 doomdark Exp $ |
Method Summary | |
abstract public void | close() Closes the record manager. | abstract public void | commit() Commit (make persistent) all changes since beginning of transaction. | abstract public void | delete(long recid) Deletes a record. | abstract public Object | fetch(long recid) Fetches a record using standard java object serialization.
Parameters: recid - the recid for the record that must be fetched. | abstract public Object | fetch(long recid, Serializer serializer) Fetches a record using a custom serializer. | abstract public long | getNamedObject(String name) Obtain the record id of a named object. | abstract public long | getRoot(int id) Returns the indicated root rowid. | abstract public int | getRootCount() Returns the number of slots available for "root" rowids. | abstract public long | insert(Object obj) Inserts a new record using standard java object serialization.
Parameters: obj - the object for the new record. | abstract public long | insert(Object obj, Serializer serializer) Inserts a new record using a custom serializer. | abstract public void | rollback() Rollback (cancel) all changes since beginning of transaction. | abstract public void | setNamedObject(String name, long recid) Set the record id of a named object. | abstract public void | setRoot(int id, long rowid) Sets the indicated root rowid. | abstract public void | update(long recid, Object obj) Updates a record using standard java object serialization. | abstract public void | update(long recid, Object obj, Serializer serializer) Updates a record using a custom serializer. |
NAME_DIRECTORY_ROOT | final public static int NAME_DIRECTORY_ROOT(Code) | | Reserved slot for name directory.
|
close | abstract public void close() throws IOException(Code) | | Closes the record manager.
throws: IOException - when one of the underlying I/O operations fails. |
commit | abstract public void commit() throws IOException(Code) | | Commit (make persistent) all changes since beginning of transaction.
|
delete | abstract public void delete(long recid) throws IOException(Code) | | Deletes a record.
Parameters: recid - the rowid for the record that should be deleted. throws: IOException - when one of the underlying I/O operations fails. |
fetch | abstract public Object fetch(long recid) throws IOException(Code) | | Fetches a record using standard java object serialization.
Parameters: recid - the recid for the record that must be fetched. the object contained in the record. throws: IOException - when one of the underlying I/O operations fails. |
fetch | abstract public Object fetch(long recid, Serializer serializer) throws IOException(Code) | | Fetches a record using a custom serializer.
Parameters: recid - the recid for the record that must be fetched. Parameters: serializer - a custom serializer the object contained in the record. throws: IOException - when one of the underlying I/O operations fails. |
getNamedObject | abstract public long getNamedObject(String name) throws IOException(Code) | | Obtain the record id of a named object. Returns 0 if named object
doesn't exist.
|
getRootCount | abstract public int getRootCount()(Code) | | Returns the number of slots available for "root" rowids. These slots
can be used to store special rowids, like rowids that point to
other rowids. Root rowids are useful for bootstrapping access to
a set of data.
|
insert | abstract public long insert(Object obj) throws IOException(Code) | | Inserts a new record using standard java object serialization.
Parameters: obj - the object for the new record. the rowid for the new record. throws: IOException - when one of the underlying I/O operations fails. |
insert | abstract public long insert(Object obj, Serializer serializer) throws IOException(Code) | | Inserts a new record using a custom serializer.
Parameters: obj - the object for the new record. Parameters: serializer - a custom serializer the rowid for the new record. throws: IOException - when one of the underlying I/O operations fails. |
rollback | abstract public void rollback() throws IOException(Code) | | Rollback (cancel) all changes since beginning of transaction.
|
setNamedObject | abstract public void setNamedObject(String name, long recid) throws IOException(Code) | | Set the record id of a named object.
|
update | abstract public void update(long recid, Object obj) throws IOException(Code) | | Updates a record using standard java object serialization.
Parameters: recid - the recid for the record that is to be updated. Parameters: obj - the new object for the record. throws: IOException - when one of the underlying I/O operations fails. |
update | abstract public void update(long recid, Object obj, Serializer serializer) throws IOException(Code) | | Updates a record using a custom serializer.
Parameters: recid - the recid for the record that is to be updated. Parameters: obj - the new object for the record. Parameters: serializer - a custom serializer throws: IOException - when one of the underlying I/O operations fails. |
|
|