|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IObjectWriter
Method Summary | |
---|---|
ClassInfo |
addClass(ClassInfo newClassInfo,
boolean addDependentClasses)
|
ClassInfoList |
addClasses(ClassInfoList classInfoList)
|
void |
afterInit()
|
long |
associateIdToObject(byte idType,
byte idStatus,
long currentBlockIdPosition,
OID oid,
long objectPosition,
boolean writeInTransaction)
Associate an object OID to its position |
void |
close()
|
void |
createEmptyDatabaseHeader(long creationDate,
java.lang.String user,
java.lang.String password)
Creates the header of the file |
OID |
delete(ObjectInfoHeader header)
|
void |
flush()
|
IFileSystemInterface |
getFsi()
|
IIdManager |
getIdManager()
|
ISession |
getSession()
|
OID |
insertNonNativeObject(OID oid,
NonNativeObjectInfo nnoi,
boolean isNewObject)
|
int |
manageIndexesForDelete(OID oid,
NonNativeObjectInfo nnoi)
Insert the object in the index |
int |
manageIndexesForInsert(OID oid,
NonNativeObjectInfo nnoi)
Insert the object in the index |
int |
manageIndexesForUpdate(OID oid,
NonNativeObjectInfo nnoi,
NonNativeObjectInfo oldMetaRepresentation)
|
int |
markAsDeleted(long currentPosition,
OID oid,
boolean writeInTransaction)
Mark a block as deleted |
long |
markIdBlockAsFull(long blockPosition,
long nextBlockPosition,
boolean writeInTransaction)
Marks a block of type id as full, changes the status and the next block position |
ClassInfo |
persistClass(ClassInfo newClassInfo,
int lastClassInfoIndex,
boolean addClass,
boolean addDependentClasses)
Persist a single class info - This method is used by the XML Importer. |
void |
setTriggerManager(ITriggerManager triggerManager)
|
void |
updateClassInfo(ClassInfo classInfo,
boolean writeInTransaction)
|
void |
updateClassPositionForClassOIDWithPosition(long idPosition,
long objectPosition,
boolean writeInTransaction)
Udates the real class positon of the class OID |
void |
updateInstanceFieldsOfClassInfo(ClassInfo classInfo,
boolean writeInTransaction)
Updates the instance related field of the class info into the database file Updates the number of objects, the first object oid and the next class oid |
void |
updateNextObjectFieldOfObjectInfo(OID objectOID,
OID nextObjectOID,
boolean writeInTransaction)
Update next object oid field of the object at the specific position |
OID |
updateNonNativeObjectInfo(NonNativeObjectInfo nnoi,
boolean forceUpdate)
Updates an object. |
void |
updateObjectPositionForObjectOIDWithPosition(long idPosition,
long objectPosition,
boolean writeInTransaction)
Updates the real object position of the object OID |
void |
updatePreviousObjectFieldOfObjectInfo(OID objectOID,
OID previousObjectOID,
boolean writeInTransaction)
Updates the previous object position field of the object at objectPosition |
void |
updateStatusForIdWithPosition(long idPosition,
byte newStatus,
boolean writeInTransaction)
|
long |
writeAtomicNativeObject(AtomicNativeObjectInfo anoi,
boolean writeInTransaction,
int totalSpaceIfString)
|
void |
writeClassInfoHeader(ClassInfo classInfo,
long position,
boolean writeInTransaction)
Write the class info header to the database file |
long |
writeIdBlock(long position,
int idBlockSize,
byte blockStatus,
int blockNumber,
long previousBlockPosition,
boolean writeInTransaction)
Writes the header of a block of type ID - a block that contains ids of objects and classes |
void |
writeLastODBCloseStatus(boolean ok,
boolean writeInTransaction)
Write the status of the last odb close |
void |
writeLastTransactionId(TransactionId transactionId)
|
OID |
writeNonNativeObjectInfo(OID existingOid,
NonNativeObjectInfo objectInfo,
long position,
boolean writeDataInTransaction,
boolean isNewObject)
Write an object representation to database file |
Methods inherited from interface org.neodatis.odb.core.ITwoPhaseInit |
---|
init2 |
Method Detail |
---|
ClassInfoList addClasses(ClassInfoList classInfoList)
void writeClassInfoHeader(ClassInfo classInfo, long position, boolean writeInTransaction)
classInfo
- The class info to be writtenposition
- The position at which it must be writtenwriteInTransaction
- true if the write must be done in transaction, false to write
directlyvoid updateClassInfo(ClassInfo classInfo, boolean writeInTransaction)
OID updateNonNativeObjectInfo(NonNativeObjectInfo nnoi, boolean forceUpdate)
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.
nnoi
- The meta representation of the object to be updatedforceUpdate
- when true, no verification is done to check if update must be done.
OID writeNonNativeObjectInfo(OID existingOid, NonNativeObjectInfo objectInfo, long position, boolean writeDataInTransaction, boolean isNewObject)
existingOid
- The oid of the object, can be nullobjectInfo
- The Object meta representationposition
- The position where the object must be written, can be -1writeDataInTransaction
- To indicate if the write must be done in or out of transaction
java.lang.Exception
long writeAtomicNativeObject(AtomicNativeObjectInfo anoi, boolean writeInTransaction, int totalSpaceIfString)
IIdManager getIdManager()
ISession getSession()
void close()
IFileSystemInterface getFsi()
void createEmptyDatabaseHeader(long creationDate, java.lang.String user, java.lang.String password)
creationDate
- The creation dateuser
- The userpassword
- The passwordint markAsDeleted(long currentPosition, OID oid, boolean writeInTransaction)
currentPosition
-
int manageIndexesForInsert(OID oid, NonNativeObjectInfo nnoi)
oid
- The object idnnoi
- The object meta represenation
int manageIndexesForDelete(OID oid, NonNativeObjectInfo nnoi)
oid
- The object idnnoi
- The object meta represenation
java.lang.Exception
int manageIndexesForUpdate(OID oid, NonNativeObjectInfo nnoi, NonNativeObjectInfo oldMetaRepresentation)
void writeLastODBCloseStatus(boolean ok, boolean writeInTransaction)
void flush()
OID delete(ObjectInfoHeader header)
void updateStatusForIdWithPosition(long idPosition, byte newStatus, boolean writeInTransaction)
void updateObjectPositionForObjectOIDWithPosition(long idPosition, long objectPosition, boolean writeInTransaction)
idPosition
- The OID positionobjectPosition
- The real object positionwriteInTransaction
- To indicate if write must be done in transactionvoid updateClassPositionForClassOIDWithPosition(long idPosition, long objectPosition, boolean writeInTransaction)
idPosition
- objectPosition
- writeInTransaction
- long associateIdToObject(byte idType, byte idStatus, long currentBlockIdPosition, OID oid, long objectPosition, boolean writeInTransaction)
idType
- The type : can be object or classidStatus
- The status of the OIDcurrentBlockIdPosition
- The current OID block positionoid
- The OIDobjectPosition
- The positionwriteInTransaction
- To indicate if write must be executed in transaction
long markIdBlockAsFull(long blockPosition, long nextBlockPosition, boolean writeInTransaction)
blockPosition
- nextBlockPosition
- writeInTransaction
-
long writeIdBlock(long position, int idBlockSize, byte blockStatus, int blockNumber, long previousBlockPosition, boolean writeInTransaction)
position
- Position at which the block must be written, if -1, take the
next available positionidBlockSize
- The block size in byteblockStatus
- The block statusblockNumber
- The number of the blockpreviousBlockPosition
- The position of the previous block of the same typewriteInTransaction
- To indicate if write must be done in transaction
void updatePreviousObjectFieldOfObjectInfo(OID objectOID, OID previousObjectOID, boolean writeInTransaction)
objectOID
- previousObjectOID
- writeInTransaction
- void updateNextObjectFieldOfObjectInfo(OID objectOID, OID nextObjectOID, boolean writeInTransaction)
objectOID
- nextObjectOID
- writeInTransaction
- void updateInstanceFieldsOfClassInfo(ClassInfo classInfo, boolean writeInTransaction)
classInfo
- The class info to be updatedwriteInTransaction
- To specify if it must be part of a transactionvoid afterInit()
ClassInfo addClass(ClassInfo newClassInfo, boolean addDependentClasses)
ClassInfo persistClass(ClassInfo newClassInfo, int lastClassInfoIndex, boolean addClass, boolean addDependentClasses)
void writeLastTransactionId(TransactionId transactionId)
void setTriggerManager(ITriggerManager triggerManager)
OID insertNonNativeObject(OID oid, NonNativeObjectInfo nnoi, boolean isNewObject)
oid
- The Oid of the object to be insertednnoi
- The object meta representation The object to be inserted in
the databaseisNewObject
- To indicate if object is new
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |