|
||||||||||
| 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 DBObjectHandlerobjectStatusListener - The new object status listener to use.public StoredObject getObject(ID objectId)
getObject in interface DBObjectHandlergetObject in interface ObjectAccessorpublic void update(StoredObject object)
DBObjectHandler
update in interface DBObjectHandlerobject - The object to updatepublic StoredUserObject getUserObject(ID objectId)
getUserObject in interface DBObjectHandlergetUserObject in interface ObjectAccessorobjectId - 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 DBObjectHandlergetListObject in interface ObjectAccessorpublic StoredSetObject getSetObject(ID objectId)
ObjectAccessor
getSetObject in interface DBObjectHandlergetSetObject in interface ObjectAccessorobjectId - The id of the set to retrieve.public StoredMapObject getMapObject(ID objectId)
ObjectAccessor
getMapObject in interface DBObjectHandlergetMapObject in interface ObjectAccessorobjectId - 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 DBObjectHandlercreateObject in interface ObjectAccessorclassId - The classId of the new object.
public ObjectSyncResp synchroniseObject(ID objectId,
ObjectSyncData syncData)
synchroniseObject in interface DBObjectHandlerobjectId - 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 DBObjectHandlerremoveObject in interface ObjectAccessorid - The id of the object to remove.public int getObjectCount()
getObjectCount in interface DBObjectHandlerpublic boolean checkExists(ID objectId)
checkExists in interface DBObjectHandlercheckExists in interface ObjectAccessorpublic void release(StoredObject object)
release in interface DBObjectHandlerrelease in interface ObjectAccessorprotected void saveObject(StoredObject object)
public int getNoLocksHeld()
DBObjectHandler
getNoLocksHeld in interface DBObjectHandlerpublic java.util.Iterator<ID> idIterator()
ObjectAccessor
idIterator in interface ObjectAccessorpublic java.util.Set<ID> getObjectChildren(ID id)
getObjectChildren in interface ObjectAccessor
public void registerType(ClassId classId,
TypeHandler handler)
DBObjectHandler
registerType in interface DBObjectHandlerclassId - 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 | |||||||||