Xindice API
version 1.1

org.apache.xindice.core.filer
Class FSFiler

java.lang.Object
  |
  +--org.apache.xindice.util.SimpleConfigurable
        |
        +--org.apache.xindice.core.filer.FSFiler
All Implemented Interfaces:
Configurable, DBObject, Filer, Named

public final class FSFiler
extends SimpleConfigurable
implements Filer

FSFiler allows you to use existing file systems withing Xindice.

Version:
$Revision: 511426 $, $Date: 2007-02-24 22:25:02 -0500 (Sat, 24 Feb 2007) $

Fields inherited from class org.apache.xindice.util.SimpleConfigurable
config
 
Constructor Summary
FSFiler()
           
 
Method Summary
 boolean close()
          close closes the DBObject
 boolean create()
          create creates a new DBObject and any associated resources for the new DBObject, such as disk files, etc.
 boolean deleteRecord(Key key)
          deleteRecord removes a Record from the Filer based on the specified Key.
 boolean drop()
          drop instructs the DBObjectimplementation to remove itself from existence.
 boolean exists()
          exists returns whether or not a physical representation of this DBObject actually exists.
 void flush()
          flush forcefully flushes any unwritten buffers to disk.
 String getName()
          getName retrieves the contextually important name of the object
 long getRecordCount()
          getRecordCount returns the number of Records in the Filer.
 RecordSet getRecordSet()
          getRecordSet returns a RecordSet object for the current Filer.
 boolean isOpened()
          isOpened returns whether or not the DBObject is opened for business.
 boolean open()
          open opens the DBObject
 Record readRecord(Key key)
          readRecord returns a Record from the Filer based on the specified Key.
 void setConfig(Configuration config)
          setConfig sets the configuration information for the Configurable object instance.
 void setLocation(File root, String location)
          setLocation tells the Filer where to store its data.
 boolean writeRecord(Key key, Value value)
          writeRecord writes a Value to the Filer based on the specified Key.
 
Methods inherited from class org.apache.xindice.util.SimpleConfigurable
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xindice.util.Configurable
getConfig
 

Constructor Detail

FSFiler

public FSFiler()
Method Detail

getName

public String getName()
Description copied from interface: Named
getName retrieves the contextually important name of the object
Specified by:
getName in interface Named
Following copied from interface: org.apache.xindice.util.Named
Returns:
The object's name

setLocation

public void setLocation(File root,
                        String location)
Description copied from interface: Filer
setLocation tells the Filer where to store its data.
Specified by:
setLocation in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Parameters:
root - The root under which to store data
location - The name to use for storing data

setConfig

public void setConfig(Configuration config)
               throws XindiceException
Description copied from interface: Configurable
setConfig sets the configuration information for the Configurable object instance.
Specified by:
setConfig in interface Configurable
Overrides:
setConfig in class SimpleConfigurable
Following copied from interface: org.apache.xindice.util.Configurable
Parameters:
config - The configuration Node

close

public boolean close()
Description copied from interface: DBObject
close closes the DBObject
Specified by:
close in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
Whether or not the DBObject was closed

open

public boolean open()
Description copied from interface: DBObject
open opens the DBObject
Specified by:
open in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
Whether or not the DBObject was opened

drop

public boolean drop()
Description copied from interface: DBObject
drop instructs the DBObjectimplementation to remove itself from existence. The DBObject's parent is responsible for removing any references to the DBObject in its own context.
Specified by:
drop in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
Whether or not the DBObject was dropped

isOpened

public boolean isOpened()
Description copied from interface: DBObject
isOpened returns whether or not the DBObject is opened for business.
Specified by:
isOpened in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
The open status of the DBObject

exists

public boolean exists()
Description copied from interface: DBObject
exists returns whether or not a physical representation of this DBObject actually exists. In the case of a HashFiler, this would check for the file, and in the case of an FTPFiler, it might perform a connection check.
Specified by:
exists in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
Whether or not the physical resource exists

create

public boolean create()
Description copied from interface: DBObject
create creates a new DBObject and any associated resources for the new DBObject, such as disk files, etc.
Specified by:
create in interface DBObject
Following copied from interface: org.apache.xindice.core.DBObject
Returns:
Whether or not the DBObject was created

flush

public void flush()
Description copied from interface: Filer
flush forcefully flushes any unwritten buffers to disk.
Specified by:
flush in interface Filer

readRecord

public Record readRecord(Key key)
                  throws DBException
Description copied from interface: Filer
readRecord returns a Record from the Filer based on the specified Key.
Specified by:
readRecord in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Parameters:
key - The Record's Key
Returns:
The returned Record

writeRecord

public boolean writeRecord(Key key,
                           Value value)
                    throws DBException
Description copied from interface: Filer
writeRecord writes a Value to the Filer based on the specified Key.
Specified by:
writeRecord in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Parameters:
key - The Record's Key
value - The Record's Value
Returns:
Whether or not the Record could be written

deleteRecord

public boolean deleteRecord(Key key)
                     throws DBException
Description copied from interface: Filer
deleteRecord removes a Record from the Filer based on the specified Key.
Specified by:
deleteRecord in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Parameters:
key - The Record's Key
Returns:
Whether or not the Record was deleted

getRecordCount

public long getRecordCount()
                    throws DBException
Description copied from interface: Filer
getRecordCount returns the number of Records in the Filer.
Specified by:
getRecordCount in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Returns:
The Record count

getRecordSet

public RecordSet getRecordSet()
                       throws DBException
Description copied from interface: Filer
getRecordSet returns a RecordSet object for the current Filer.
Specified by:
getRecordSet in interface Filer
Following copied from interface: org.apache.xindice.core.filer.Filer
Returns:
The Filer Enumerator

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.