Project JXTA

net.jxta.impl.xindice.core.filer
Interface Filer

All Superinterfaces:
DBObject, Named
All Known Implementing Classes:
BTreeFiler, MemFiler

public interface Filer
extends Named, DBObject

Filer is the low-level file management interface for Xindice. A Filer object is implemented in order to provide a data source to the Xindice Collection class. Filers are developed to perform transparent storage and retrieval to and from heterogenous data sources (such as FTP, HTTP, RDBMS, etc...)


Method Summary
 boolean deleteRecord(Key key)
          deleteRecord removes a Record from the Filer based on the specified Key.
 void flush()
          flush forcefully flushes any unwritten buffers to disk.
 long getRecordCount()
          getRecordCount returns the number of Records in the Filer.
 RecordSet getRecordSet()
          getRecordSet returns a RecordSet object for the current Filer.
 Record readRecord(Key key)
          readRecord returns a Record from the Filer based on the specified Key.
 Record readRecord(long pos)
          readRecord returns a Record from the Filer at the specified position.
 long writeRecord(Key key, Value value)
          writeRecord writes a Value to the Filer based on the specified Key.
 
Methods inherited from interface net.jxta.impl.xindice.util.Named
getName
 
Methods inherited from interface net.jxta.impl.xindice.core.DBObject
close, create, drop, exists, isOpened, open
 

Method Detail

readRecord

Record readRecord(Key key)
                  throws DBException
readRecord returns a Record from the Filer based on the specified Key.

Parameters:
key - The Record's Key
Returns:
The returned Record
Throws:
DBException

readRecord

Record readRecord(long pos)
                  throws DBException
readRecord returns a Record from the Filer at the specified position. The Record's Key will be set to null.

Parameters:
pos - The Record's position
Returns:
The returned Record
Throws:
DBException

writeRecord

long writeRecord(Key key,
                 Value value)
                 throws DBException
writeRecord writes a Value to the Filer based on the specified Key.

Parameters:
key - The Record's Key
value - The Record's Value
Returns:
0 if the Record could not be written, the starting offset of the Record otherwise (used for indexing)
Throws:
DBException

deleteRecord

boolean deleteRecord(Key key)
                     throws DBException
deleteRecord removes a Record from the Filer based on the specified Key.

Parameters:
key - The Record's Key
Returns:
Whether or not the Record was deleted
Throws:
DBException

getRecordCount

long getRecordCount()
                    throws DBException
getRecordCount returns the number of Records in the Filer.

Returns:
The Record count
Throws:
DBException

getRecordSet

RecordSet getRecordSet()
                       throws DBException
getRecordSet returns a RecordSet object for the current Filer.

Returns:
The Filer Enumerator
Throws:
DBException

flush

void flush()
           throws DBException
flush forcefully flushes any unwritten buffers to disk.

Throws:
DBException

JXTA J2SE