|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.impl.core.layers.layer3.oid.DefaultIdManager
public class DefaultIdManager
Class to manage the ids of all the objects of the database.
Field Summary | |
---|---|
protected long[] |
lastIdPositions
|
protected OID[] |
lastIds
Contains the last ids: id value,id position, id value, id position=> the array is created with twice the size |
OID |
maxId
|
OID |
nextId
|
protected IObjectReader |
objectReader
|
protected IObjectWriter |
objectWriter
|
protected ISession |
session
|
Constructor Summary | |
---|---|
DefaultIdManager(IObjectWriter objectWriter,
IObjectReader objectReader,
long currentBlockIdPosition,
int currentBlockIdNumber,
OID currentMaxId)
|
Method Summary | |
---|---|
void |
clear()
|
OID |
consultNextOid()
|
OID |
getNextClassId(long objectPosition)
Gets an id for a class |
(package private) OID |
getNextId(long objectPosition,
byte idType,
byte idStatus,
java.lang.String label)
Gets an id for an object (instance) |
OID |
getNextObjectId(long objectPosition)
Gets an id for an object (instance) |
long |
getObjectPositionWithOid(OID oid,
boolean useCache)
|
protected ISession |
getSession()
|
boolean |
mustShift()
To check if the id block must shift: that a new id block must be created |
void |
reserveIds(long nbIds)
|
void |
updateClassPositionForId(OID classId,
long objectPosition,
boolean writeInTransaction)
|
void |
updateIdStatus(OID id,
byte newStatus)
|
void |
updateObjectPositionForOid(OID oid,
long objectPosition,
boolean writeInTransaction)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public OID nextId
public OID maxId
protected IObjectWriter objectWriter
protected IObjectReader objectReader
protected ISession session
protected OID[] lastIds
protected long[] lastIdPositions
Constructor Detail |
---|
public DefaultIdManager(IObjectWriter objectWriter, IObjectReader objectReader, long currentBlockIdPosition, int currentBlockIdNumber, OID currentMaxId)
objectWriter
- The object writerobjectReader
- The object readercurrentBlockIdPosition
- The position of the current blockcurrentBlockIdNumber
- The number of the current blockcurrentMaxId
- Maximum Database idMethod Detail |
---|
public boolean mustShift()
mustShift
in interface IIdManager
OID getNextId(long objectPosition, byte idType, byte idStatus, java.lang.String label)
objectPosition
- the object position (instance)idType
- The type id : object,class, unknownlabel
- A label for debug
public OID getNextObjectId(long objectPosition)
IIdManager
getNextObjectId
in interface IIdManager
objectPosition
- the object position (instance)
public OID getNextClassId(long objectPosition)
IIdManager
getNextClassId
in interface IIdManager
objectPosition
- the object position (class)
public void updateObjectPositionForOid(OID oid, long objectPosition, boolean writeInTransaction)
updateObjectPositionForOid
in interface IIdManager
public void updateClassPositionForId(OID classId, long objectPosition, boolean writeInTransaction)
updateClassPositionForId
in interface IIdManager
public void updateIdStatus(OID id, byte newStatus)
updateIdStatus
in interface IIdManager
public OID consultNextOid()
consultNextOid
in interface IIdManager
public void reserveIds(long nbIds)
reserveIds
in interface IIdManager
public long getObjectPositionWithOid(OID oid, boolean useCache)
getObjectPositionWithOid
in interface IIdManager
public void clear()
clear
in interface IIdManager
protected ISession getSession()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |