begin
public void begin(Xid xid)
throws FosException
Begins a FOS transaction with a DTP context.
- begin in interface FosTransaction
xid
- The DTP identifier associated with this FOS transaction. It
is null if non XA runtime environment.
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.
- delete in interface FosAccess
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.
- deleteDir in interface FosAccess
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.
- exist in interface FosAccess
dirof
- The directory under dbDir where the file should be located.id
- The name of the file to test (corresponding to the object
identifier).
- 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.
- existDir in interface FosAccess
dirof
- The directory under dbDir to test the existence.
- true if the directory exists, else false.
isActive
public boolean isActive()
Specifies if this FOS transaction is active or not. true means that
it has begun but it has not been committed or rollbacked yet.
- isActive in interface FosTransaction
prepare
public boolean prepare()
throws FosException
Prepares a FOS transaction to commit.
- prepare in interface FosTransaction
- true if all objects used by this transaction was just read.
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.
- read in interface FosAccess
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.
- scan in interface FosAccess
dirof
- The sub-directory from which to scan the data
object file names.
- 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.
- write in interface FosAccess
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.