org.objectweb.perseus.fos.api

Interface FosAccess

Known Subinterfaces:
FosTransaction
Known Implementing Classes:
FosTxContext

public interface FosAccess

Defines the means to manipulate transactional files for storing data objects. These data objects are stored into files (one file per data object). There are all stored into a root directory "dbdir". They can be stored directly under it or into a sub-directory "dirof" of it (at any depth).

Author:
S. Chassande-Barrioz, P. D?chamboux

Method Summary

void
delete(String dirof, String id)
Deletes the file associated with a persistent object.
void
deleteDir(String dirof)
Deletes a directory that stores persistent objects along with all object files stored under it.
boolean
exist(String dirof, String id)
Tests if the file associated to a persistent object exists.
boolean
existDir(String dirof)
Tests if a directory that stores persistent objects exists.
void
read(String dirof, String id, FosStructure fs, Object ctxt)
Reads the content of a persistent object from a file.
Iterator
scan(String dirof)
Gets an iterator in order to iterate over the names of the data object files stored into that sub-directory.
void
write(String dirof, String id, FosStructure fs, Object ctxt)
Writes the content of a persistent object to a file.

Method Details

delete

public void delete(String dirof,
                   String id)
            throws FosException
Deletes the file associated with a persistent object. This file is specified by the directory under which it is stored under dbDir, and its name (or id) within this directory.

Parameters:
dirof - The directory under dbDir where the deleted file is located.
id - The name of the file to delete (corresponding to the object identifier).


deleteDir

public void deleteDir(String dirof)
            throws FosException
Deletes a directory that stores persistent objects along with all object files stored under it.

Parameters:
dirof - The directory under dbDir to be deleted.


exist

public boolean exist(String dirof,
                     String id)
            throws FosException
Tests if the file associated to a persistent object exists. This file is specified by the directory under which it is stored under dbDir, and its name (or id) within this directory.

Parameters:
dirof - The directory under dbDir where the file should be located.
id - The name of the file to test (corresponding to the object identifier).

Returns:
true if the object file exists, else false.


existDir

public boolean existDir(String dirof)
            throws FosException
Tests if a directory that stores persistent objects exists.

Parameters:
dirof - The directory under dbDir to test the existence.

Returns:
true if the directory exists, else false.


read

public void read(String dirof,
                 String id,
                 FosStructure fs,
                 Object ctxt)
            throws FosException
Reads the content of a persistent object from a file. This file is specified by the directory under which it is stored under dbDir, and its name (or id) within this directory. The object that actually reads the file is also given by the user.

Parameters:
dirof - The directory under dbDir where the read file is located.
id - The name of the file to read (corresponding to the object identifier).
fs - The user object for actually reading the file.


scan

public Iterator scan(String dirof)
            throws FosException
Gets an iterator in order to iterate over the names of the data object files stored into that sub-directory.

Parameters:
dirof - The sub-directory from which to scan the data object file names.

Returns:
The iterator in order to iterate over these names.


write

public void write(String dirof,
                  String id,
                  FosStructure fs,
                  Object ctxt)
            throws FosException
Writes the content of a persistent object to a file. This file is specified by the directory under which it is stored under dbDir, and its name (or id) within this directory. The object that actually writes the file is also given by the user.

Parameters:
dirof - The directory under dbDir where the written file is located.
id - The name of the file to write (corresponding to the object identifier).
fs - The user object for actually writing the file.


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.