edu.mssm.crover.scentral
Class PersistenceScheme_Serialization_Impl

java.lang.Object
  |
  +--edu.mssm.crover.scentral.PersistenceScheme_Serialization_Impl
All Implemented Interfaces:
PersistenceScheme

public abstract class PersistenceScheme_Serialization_Impl
extends java.lang.Object
implements PersistenceScheme

Serialization persistence scheme. This scheme relies on serialization to save the state of each object into files. It is expected to be less flexible than JDBC. This is the poor man solution. See the JDBC implementation for a better alternative. Not tested after the package reorganization


Field Summary
 
Fields inherited from interface edu.mssm.crover.scentral.PersistenceScheme
OWNER_REFERENCE_ID, USER_SESSION_KIND
 
Constructor Summary
PersistenceScheme_Serialization_Impl()
           
 
Method Summary
abstract  UserSession createServiceUserSession(UserRecord ur)
           
 void dropLibraryObjectReference(int object_id, int reference_object_id, UserRecord ur)
          Drops a reference in the database to this object identified by object_id.
protected  java.lang.Object getInstance(java.lang.String name)
          Get an instance from the storage directory.
 LibraryObjectInfo getLibraryObjectInfo(int kind, int library_object_id, UserRecord ur)
          Get a LibraryObjectInfo for a given object kind with the given object ID.
 java.util.Collection getLibraryObjectsInfo(int kind, UserRecord ur)
          Get an enumeration of instance iterators for browsing purposes.
abstract  java.lang.String getSessionTableName()
           
 UserSession getUserSession(UserRecord ur)
          Returns a previously serialized object or a new one if none exists.
 void initialize(Log log)
          Initialized a PersistenceScheme_Serialization_Impl.
protected  void saveInstance(java.lang.Object instance, java.lang.String name)
          Save an instance as a file in the storage directory.
 void saveUserSession(UserSession session)
          Serializes the object in a file and keep track of it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.mssm.crover.scentral.PersistenceScheme
userLogsIn
 

Constructor Detail

PersistenceScheme_Serialization_Impl

public PersistenceScheme_Serialization_Impl()
Method Detail

initialize

public void initialize(Log log)
Initialized a PersistenceScheme_Serialization_Impl.

Specified by:
initialize in interface PersistenceScheme
Parameters:
log - The log system where warnings and errors are reported.

createServiceUserSession

public abstract UserSession createServiceUserSession(UserRecord ur)

getSessionTableName

public abstract java.lang.String getSessionTableName()

getUserSession

public UserSession getUserSession(UserRecord ur)
Returns a previously serialized object or a new one if none exists. When userID is "guest" the user session returned is a newly constructed one.

Specified by:
getUserSession in interface PersistenceScheme

saveUserSession

public void saveUserSession(UserSession session)
Serializes the object in a file and keep track of it. When userID is "guest" the user session the user session is not saved.

Specified by:
saveUserSession in interface PersistenceScheme

getInstance

protected java.lang.Object getInstance(java.lang.String name)
Get an instance from the storage directory.


saveInstance

protected void saveInstance(java.lang.Object instance,
                            java.lang.String name)
                     throws BadPersistentID
Save an instance as a file in the storage directory.

BadPersistentID

dropLibraryObjectReference

public void dropLibraryObjectReference(int object_id,
                                       int reference_object_id,
                                       UserRecord ur)
Drops a reference in the database to this object identified by object_id. The object_id referencing the object is reference_object_id. When owner requests to drop an object, the owner is identified by reference_object_id = 0, which could never occur for regular objects. Regular objects have id-s > 0. An object is dropped when all references to it are dropped including the owner reference.

Specified by:
dropLibraryObjectReference in interface PersistenceScheme

getLibraryObjectInfo

public LibraryObjectInfo getLibraryObjectInfo(int kind,
                                              int library_object_id,
                                              UserRecord ur)
Get a LibraryObjectInfo for a given object kind with the given object ID.

Specified by:
getLibraryObjectInfo in interface PersistenceScheme
Returns:
LibraryObjectInfo.
See Also:
LibraryObjectInfo

getLibraryObjectsInfo

public java.util.Collection getLibraryObjectsInfo(int kind,
                                                  UserRecord ur)
Get an enumeration of instance iterators for browsing purposes.

Specified by:
getLibraryObjectsInfo in interface PersistenceScheme
Returns:
Enumeration of LibraryObjectInfo-s.
See Also:
LibraryObjectInfo


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.