org.openorb.pss.connector.file

Class FileSession

public class FileSession extends FileCatalog implements Session

This class is an implementation of file based persistent session. Each persistent file contains several data wich are divided into 4 parts : - the VALID FLAG ( a boolean ) - the SHORT PID length ( a long value ) - the SHORT PID ( a buffer of bytes ) - the DATA length ( a long value ) - the DATA ( a buffer of bytes )

Author: Jerome Daniel

Constructor Summary
FileSession()
FileSession(ORBInitInfo info)
Constructor
Method Summary
voidclean(StorageHomeBase home)
voidclose()
PIDcreateHomePID(String storage_home_name)
Generate a Home PID
PIDcreatePID(PID home_pid, long index)
Generate a storage type PID
StorageObjectcreate_embedded_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new embedded storage type
StorageObjectcreate_empty_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new storage type
OutputStreamcreate_new_entry(PID home_pid, PID type_pid)
Create a new entry
StorageObjectcreate_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new storage type
voiddelete(PID home_pid, PID type_pid)
Delete a storage object
voiddestroy(StorageHomeBase home)
InputStreamentry(PID home_pid, PID type_pid)
Return the entry data as an input stream
voidentry(PID home_pid, PID type_pid, OutputStream output)
Write a new entry into the file.
StorageHomeBasefind_home_base(PID pid)
Returns an storage object home from its PID ( high part is only used )
voidflush()
voidfree_all()
DataManagergetDataManager(String storage_home_name)
This operation return the DataManager
EnumerationgetSequentialAccess(PID home_pid)
Returns a sequential access for all storage home's storage type
StorageObjectincarnate(StorageHomeBase home_base, byte[] storage_type_pid, String storage_type_id)
This operation returns a storage type incarnation
voidrefresh()
voidsetBaseInfo(FileConnector connector, short access, Parameter[] parameters)
Set the base information require by a catalog
booleanstored(PID home_pid, PID type_pid)
Look for a stored object
voidwrite_entry(DataManager manager, DataEntry entry)
Write the entry to the data store ( this operation could be overloaded if required - no access to private data - )

Constructor Detail

FileSession

public FileSession()

FileSession

public FileSession(ORBInitInfo info)
Constructor

Method Detail

clean

public void clean(StorageHomeBase home)

close

public void close()

createHomePID

public PID createHomePID(String storage_home_name)
Generate a Home PID

createPID

public PID createPID(PID home_pid, long index)
Generate a storage type PID

create_embedded_object

public StorageObject create_embedded_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new embedded storage type

create_empty_object

public StorageObject create_empty_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new storage type

create_new_entry

public OutputStream create_new_entry(PID home_pid, PID type_pid)
Create a new entry

create_object

public StorageObject create_object(StorageHomeBase home_base, String storage_type_id)
This operation creates a new storage type

delete

public void delete(PID home_pid, PID type_pid)
Delete a storage object

destroy

public void destroy(StorageHomeBase home)

entry

public InputStream entry(PID home_pid, PID type_pid)
Return the entry data as an input stream

entry

public void entry(PID home_pid, PID type_pid, OutputStream output)
Write a new entry into the file.

find_home_base

public StorageHomeBase find_home_base(PID pid)
Returns an storage object home from its PID ( high part is only used )

flush

public void flush()

free_all

public void free_all()

getDataManager

public DataManager getDataManager(String storage_home_name)
This operation return the DataManager

getSequentialAccess

public Enumeration getSequentialAccess(PID home_pid)
Returns a sequential access for all storage home's storage type

incarnate

public StorageObject incarnate(StorageHomeBase home_base, byte[] storage_type_pid, String storage_type_id)
This operation returns a storage type incarnation

refresh

public void refresh()

setBaseInfo

public void setBaseInfo(FileConnector connector, short access, Parameter[] parameters)
Set the base information require by a catalog

stored

public boolean stored(PID home_pid, PID type_pid)
Look for a stored object

write_entry

public void write_entry(DataManager manager, DataEntry entry)
Write the entry to the data store ( this operation could be overloaded if required - no access to private data - )