org.neodatis.odb.impl.core.server.layers.layer3.engine
Class ServerObjectWriter

java.lang.Object
  extended by org.neodatis.odb.impl.core.layers.layer3.engine.AbstractObjectWriter
      extended by org.neodatis.odb.impl.core.server.layers.layer3.engine.ServerObjectWriter
All Implemented Interfaces:
ITwoPhaseInit, IObjectWriter

public class ServerObjectWriter
extends AbstractObjectWriter


Field Summary
 
Fields inherited from class org.neodatis.odb.impl.core.layers.layer3.engine.AbstractObjectWriter
byteArrayConverter, classIntrospector, comparator, fsi, idManager, LOG_ID, LOG_ID_DEBUG, nbInPlaceUpdates, nbNormalUpdates, objectReader, storageEngine, triggerManager
 
Constructor Summary
ServerObjectWriter(IStorageEngine engine)
           
 
Method Summary
 IFileSystemInterface buildFSI()
           
protected  ITriggerManager buildTriggerManager()
           
(package private)  IServerStorageEngine getEngine()
           
 ISession getSession()
          FIXME check using a class variable to keep the base identification
 void initIdManager()
           
 OID updateNonNativeObjectInfo(NonNativeObjectInfo nnoi, boolean forceUpdate)
          Updates an object.
 OID writeNonNativeObjectInfo(OID existingOid, NonNativeObjectInfo objectInfo, long position, boolean writeDataInTransaction, boolean isNewObject)
          Write an object representation to database file
 
Methods inherited from class org.neodatis.odb.impl.core.layers.layer3.engine.AbstractObjectWriter
addClass, addClasses, afterInit, associateIdToObject, close, createEmptyDatabaseHeader, delete, depthToSpaces, encodeOid, flush, getFsi, getIdManager, getNbInPlaceUpdates, getNbNormalUpdates, getObjectInfoHeader, init2, insertNonNativeObject, manageIndexesForDelete, manageIndexesForInsert, manageIndexesForUpdate, markAsAPointerTo, markAsDeleted, markIdBlockAsFull, persistClass, resetNbUpdates, safeOverWriteAtomicNativeObject, setNbInPlaceUpdates, setNbNormalUpdates, setTriggerManager, storeFreeSpace, storeObject, updateClassInfo, updateClassPositionForClassOIDWithPosition, updateFirstInstanceFieldOfClassInfoWithId, updateInstanceFieldsOfClassInfo, updateLastInstanceFieldOfClassInfoWithId, updateNbObjectsFieldOfClassInfo, updateNextObjectFieldOfObjectInfo, updateNextObjectPreviousPointersInCache, updateObject, updateObjectPositionForObjectOIDWithPosition, updateObjectReference, updatePreviousObjectFieldOfObjectInfo, updatePreviousObjectNextPointersInCache, updateStatusForIdWithPosition, writeAtomicNativeObject, writeAtomicNativeObject, writeClassInfoBody, writeClassInfoHeader, writeClassInfoIndexes, writeDatabaseCharacterEncoding, writeDatabaseId, writeEncrytionFlag, writeEnumNativeObject, writeFirstClassInfoOID, writeIdBlock, writeLastODBCloseStatus, writeLastTransactionId, writeNativeObjectHeader, writeNonNativeNullObjectHeader, writeNonNativeObjectInfoOld, writeNullNativeObjectHeader, writeNumberOfClasses, writeOid, writeReplicationFlag, writeUserAndPassword, writeVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerObjectWriter

public ServerObjectWriter(IStorageEngine engine)
Method Detail

getEngine

IServerStorageEngine getEngine()

initIdManager

public void initIdManager()

writeNonNativeObjectInfo

public OID writeNonNativeObjectInfo(OID existingOid,
                                    NonNativeObjectInfo objectInfo,
                                    long position,
                                    boolean writeDataInTransaction,
                                    boolean isNewObject)
Description copied from interface: IObjectWriter
Write an object representation to database file

Specified by:
writeNonNativeObjectInfo in interface IObjectWriter
Overrides:
writeNonNativeObjectInfo in class AbstractObjectWriter
Parameters:
existingOid - The oid of the object, can be null
objectInfo - The Object meta representation
position - The position where the object must be written, can be -1
writeDataInTransaction - To indicate if the write must be done in or out of transaction
Returns:
The oid of the object

updateNonNativeObjectInfo

public OID updateNonNativeObjectInfo(NonNativeObjectInfo nnoi,
                                     boolean forceUpdate)
Description copied from class: AbstractObjectWriter
Updates an object.
 Try to update in place. Only change what has changed. This is restricted to particular types (fixed size types). If in place update is 
 not possible, then deletes the current object and creates a new at the end of the database file and updates
 OID object position.
 
 @param object The object to be updated
 @param forceUpdate when true, no verification is done to check if update must be done.
 @return The oid of the object, as a negative number
 @

Specified by:
updateNonNativeObjectInfo in interface IObjectWriter
Overrides:
updateNonNativeObjectInfo in class AbstractObjectWriter
Parameters:
nnoi - The meta representation of the object to be updated
forceUpdate - when true, no verification is done to check if update must be done.
Returns:
The oid of the object, as a negative number

getSession

public ISession getSession()
FIXME check using a class variable to keep the base identification

Specified by:
getSession in interface IObjectWriter
Specified by:
getSession in class AbstractObjectWriter

buildFSI

public IFileSystemInterface buildFSI()
Specified by:
buildFSI in class AbstractObjectWriter

buildTriggerManager

protected ITriggerManager buildTriggerManager()