dbXML API

com.dbxml.db.core.filer
Interface Filer

All Superinterfaces:
Configurable
All Known Implementing Classes:
BTreeFiler, DBFiler, FSFiler, MemFiler

public interface Filer
extends Configurable

Filer is the low-level file management interface for dbXML. A Filer object is implemented in order to provide a data source to the dbXML 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 close()
          close closes the Filer
 boolean create()
          create creates a new Filer and any associated resources for the new Filer, such as disk files, etc.
 boolean deleteRecord(Transaction tx, Key key)
          deleteRecord removes a Record from the Filer based on the specified Key.
 boolean drop()
          drop instructs the Filerimplementation to remove itself from existence.
 boolean exists()
          exists returns whether or not a physical representation of this Filer actually exists.
 void flush(Transaction tx)
          flush forcefully flushes any unwritten buffers to disk.
 java.lang.String getName()
          getName returns the name of this Filer.
 long getRecordCount(Transaction tx)
          getRecordCount returns the number of Records in the Filer.
 RecordMetaData getRecordMetaData(Transaction tx, Key key)
          getRecordMetaData returns metadata about the Record identified by the provided Key.
 RecordSet getRecordSet(Transaction tx)
          getRecordSet returns a RecordSet object for the current Filer.
 TransactionLog getTransactionLog()
          getTransactionLog returns the Transaction Log for this Filer.
 boolean isOpened()
          isOpened returns whether or not the Filer is opened for business.
 boolean open()
          open opens the Filer
 Record readRecord(Transaction tx, Key key)
          readRecord returns a Record from the Filer based on the specified Key.
 void setCollection(Collection collection)
          setCollection tells the Filer who its parent is.
 boolean writeRecord(Transaction tx, Key key, Value value)
          writeRecord writes a Value to the Filer based on the specified Key.
 
Methods inherited from interface com.dbxml.util.Configurable
getConfig, setConfig
 

Method Detail

getName

public java.lang.String getName()
getName returns the name of this Filer.

Returns:
the Filer name

create

public boolean create()
               throws DBException
create creates a new Filer and any associated resources for the new Filer, such as disk files, etc.

Returns:
Whether or not the Filer was created
Throws:
DBException

open

public boolean open()
             throws DBException
open opens the Filer

Returns:
Whether or not the Filer was opened
Throws:
DBException

isOpened

public boolean isOpened()
                 throws DBException
isOpened returns whether or not the Filer is opened for business.

Returns:
The open status of the Filer
Throws:
DBException

exists

public boolean exists()
               throws DBException
exists returns whether or not a physical representation of this Filer actually exists. In the case of a BTreeFiler, this would check for the file, and in the case of an FTPFiler, it might perform a connection check.

Returns:
Whether or not the physical resource exists
Throws:
DBException

drop

public boolean drop()
             throws DBException
drop instructs the Filerimplementation to remove itself from existence. The Filer's parent is responsible for removing any references to the Filer in its own context.

Returns:
Whether or not the Filer was dropped
Throws:
DBException

close

public boolean close()
              throws DBException
close closes the Filer

Returns:
Whether or not the Filer was closed
Throws:
DBException

setCollection

public void setCollection(Collection collection)
setCollection tells the Filer who its parent is.

Parameters:
collection - The owner Collection

getRecordMetaData

public RecordMetaData getRecordMetaData(Transaction tx,
                                        Key key)
                                 throws DBException
getRecordMetaData returns metadata about the Record identified by the provided Key. This method should make every attempt to not read the actual record from its original location.

Parameters:
tx - The controlling Transaction
key - The Record's Key
Returns:
The Record's metadata
Throws:
DBException

readRecord

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

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

writeRecord

public boolean writeRecord(Transaction tx,
                           Key key,
                           Value value)
                    throws DBException
writeRecord writes a Value to the Filer based on the specified Key.

Parameters:
tx - The controlling Transaction
key - The Record's Key
value - The Record's Value
Returns:
Whether or not the Record could be written
Throws:
DBException

deleteRecord

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

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

getRecordCount

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

Parameters:
tx - The controlling Transaction
Returns:
The Record count
Throws:
DBException

getRecordSet

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

Parameters:
tx - The controlling Transaction
Returns:
The Filer Enumerator
Throws:
DBException

flush

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

Parameters:
tx - The controlling Transaction
Throws:
DBException

getTransactionLog

public TransactionLog getTransactionLog()
                                 throws DBException
getTransactionLog returns the Transaction Log for this Filer. This result may be null if the Filer doesn't support transactional operations.

Returns:
The Filer's TransactionLog
Throws:
DBException

dbXML API

Copyright (c) 2004 The dbXML Group