|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sourceforge.jemm.database.components.DefaultDBObjectHandler
public class DefaultDBObjectHandler
Default implementation of DBObjectHandler used by BaseDatabase based implementations.
Constructor Summary | |
---|---|
DefaultDBObjectHandler(StorageEngine storageEngine,
DBClassHandler classHandler,
DBClientRefHandler clientRefHandler)
Creates a DefaultDBObjectHandler instance with the given parameters. |
Method Summary | |
---|---|
boolean |
checkExists(ID objectId)
|
ID |
createObject(ClientId clientId,
ClassId classId)
Creates a new user object with the given class type. |
StoredListObject |
getListObject(ID objectId)
Returns the stored jemm list object referred to by 'id' |
StoredMapObject |
getMapObject(ID objectId)
Returns the stored jemm map object referred to by 'id' |
int |
getNoLocksHeld()
Debug method to return the number of locks currently held |
StoredObject |
getObject(ID objectId)
|
java.util.Set<ID> |
getObjectChildren(ID id)
|
int |
getObjectCount()
|
StoredSetObject |
getSetObject(ID objectId)
Returns the stored jemm set object referred to by 'id' |
StoredUserObject |
getUserObject(ID objectId)
Returns the stored user object referred to by 'id' |
java.util.Iterator<ID> |
idIterator()
Returns an iterator over the currently active ID set |
void |
registerType(ClassId classId,
TypeHandler handler)
Register a type handler for the given type class. |
void |
release(StoredObject object)
|
void |
removeObject(ID id)
Remote the object with the given id. |
protected void |
saveObject(StoredObject object)
|
void |
setObjectStatusListener(ObjectStatusListener objectStatusListener)
Sets the object status listener. |
ObjectSyncResp |
synchroniseObject(ID objectId,
ObjectSyncData syncData)
|
void |
update(StoredObject object)
Update the given stored object, persisting its state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDBObjectHandler(StorageEngine storageEngine, DBClassHandler classHandler, DBClientRefHandler clientRefHandler)
storageEngine
- The underlying storage engine.classHandler
- The class handler to use.clientRefHandler
- The client reference handler to use.Method Detail |
---|
public void setObjectStatusListener(ObjectStatusListener objectStatusListener)
DBObjectHandler
setObjectStatusListener
in interface DBObjectHandler
objectStatusListener
- The new object status listener to use.public StoredObject getObject(ID objectId)
getObject
in interface DBObjectHandler
getObject
in interface ObjectAccessor
public void update(StoredObject object)
DBObjectHandler
update
in interface DBObjectHandler
object
- The object to updatepublic StoredUserObject getUserObject(ID objectId)
getUserObject
in interface DBObjectHandler
getUserObject
in interface ObjectAccessor
objectId
- The id of the object to retrieve.
java.lang.IllegalArgumentException
- If 'id' is null or is not UOBJECT type id.
java.lang.IllegalStateException
- If the object is not in the database (an internal error), or the type
of the retrieved object is not a user object.public StoredListObject getListObject(ID objectId)
ObjectAccessor
getListObject
in interface DBObjectHandler
getListObject
in interface ObjectAccessor
public StoredSetObject getSetObject(ID objectId)
ObjectAccessor
getSetObject
in interface DBObjectHandler
getSetObject
in interface ObjectAccessor
objectId
- The id of the set to retrieve.public StoredMapObject getMapObject(ID objectId)
ObjectAccessor
getMapObject
in interface DBObjectHandler
getMapObject
in interface ObjectAccessor
objectId
- The id of the map to retrieve.public ID createObject(ClientId clientId, ClassId classId)
N.b. Once initialisation is complete - caller should call objectAccessor.initialisationFinished on the returned id.
createObject
in interface DBObjectHandler
createObject
in interface ObjectAccessor
classId
- The classId of the new object.
public ObjectSyncResp synchroniseObject(ID objectId, ObjectSyncData syncData)
synchroniseObject
in interface DBObjectHandler
objectId
- The id of the object being synchronizedsyncData
- The synchronisation data, containing updated fields and current client version.
public void removeObject(ID id)
DBObjectHandler
removeObject
in interface DBObjectHandler
removeObject
in interface ObjectAccessor
id
- The id of the object to remove.public int getObjectCount()
getObjectCount
in interface DBObjectHandler
public boolean checkExists(ID objectId)
checkExists
in interface DBObjectHandler
checkExists
in interface ObjectAccessor
public void release(StoredObject object)
release
in interface DBObjectHandler
release
in interface ObjectAccessor
protected void saveObject(StoredObject object)
public int getNoLocksHeld()
DBObjectHandler
getNoLocksHeld
in interface DBObjectHandler
public java.util.Iterator<ID> idIterator()
ObjectAccessor
idIterator
in interface ObjectAccessor
public java.util.Set<ID> getObjectChildren(ID id)
getObjectChildren
in interface ObjectAccessor
public void registerType(ClassId classId, TypeHandler handler)
DBObjectHandler
registerType
in interface DBObjectHandler
classId
- The class id of the type class being handled.handler
- The registered handler.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |