uk.ac.vamsas.client
Class VorbaIdFactory

java.lang.Object
  extended byuk.ac.vamsas.client.VorbaIdFactory
All Implemented Interfaces:
IVorbaIdFactory
Direct Known Subclasses:
IdFactory

public abstract class VorbaIdFactory
extends java.lang.Object
implements IVorbaIdFactory

A VorbaIdFactory is constructed by an IClient instance. It guarantees that any new VorbaId objects are unique within the VAMSAS session.

Author:
jimp

Field Summary
protected  java.util.Hashtable extanthashv
          hash of VorbaIds to persisted hash values
protected  java.util.Hashtable extantids
          hash of VorbaIds to Vobject.
protected  java.util.Vector newobj
          list of Vobjects added since last Document read.
 
Constructor Summary
VorbaIdFactory()
           
 
Method Summary
abstract  ClientHandle getClientHandle()
           
abstract  SessionHandle getSessionHandle()
           
abstract  UserHandle getUserHandle()
           
abstract  VorbaId makeVorbaId(Vobject vobject)
          construct a new id appropriate for this client in the vamsas session.
protected  VorbaId newId(java.lang.String id)
          internal method to access the protected VorbaId object constructor This shennanigan is to prevent casual generation of VorbaIds (which may destroy the integrity of a Vamsas Document!)
protected abstract  void setClient(ClientHandle appHandle)
           
protected  void setNewIdHash(java.util.Hashtable idtable)
          Called by VorbaXmlBinder so the record of newly unmarshalled Vobject Ids is accessible to the Document's VorbaIdFactory instance.
protected abstract  void setSession(SessionHandle sessionhandle)
          TODO: decide if these are needed.
protected abstract  void setUser(UserHandle userHandle)
           
 void updateHashValue(Vobject vobject)
          called when an object is touched by the vamsas library prior to writing to record last hash for the object's VorbaId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extantids

protected java.util.Hashtable extantids
hash of VorbaIds to Vobject.


extanthashv

protected java.util.Hashtable extanthashv
hash of VorbaIds to persisted hash values


newobj

protected java.util.Vector newobj
list of Vobjects added since last Document read.

Constructor Detail

VorbaIdFactory

public VorbaIdFactory()
Method Detail

makeVorbaId

public abstract VorbaId makeVorbaId(Vobject vobject)
construct a new id appropriate for this client in the vamsas session.

Specified by:
makeVorbaId in interface IVorbaIdFactory
Parameters:
vobject - TODO
Returns:
valid VorbaId for session, or null if VorbaIdFactory not configured correctly.

newId

protected VorbaId newId(java.lang.String id)
internal method to access the protected VorbaId object constructor This shennanigan is to prevent casual generation of VorbaIds (which may destroy the integrity of a Vamsas Document!)

Parameters:
id -
Returns:
new VorbaId object

setNewIdHash

protected void setNewIdHash(java.util.Hashtable idtable)
Called by VorbaXmlBinder so the record of newly unmarshalled Vobject Ids is accessible to the Document's VorbaIdFactory instance.

Parameters:
idtable -

updateHashValue

public void updateHashValue(Vobject vobject)
Description copied from interface: IVorbaIdFactory
called when an object is touched by the vamsas library prior to writing to record last hash for the object's VorbaId

Specified by:
updateHashValue in interface IVorbaIdFactory
Parameters:
vobject -

setSession

protected abstract void setSession(SessionHandle sessionhandle)
TODO: decide if these are needed.


getSessionHandle

public abstract SessionHandle getSessionHandle()
Specified by:
getSessionHandle in interface IVorbaIdFactory

setClient

protected abstract void setClient(ClientHandle appHandle)

getClientHandle

public abstract ClientHandle getClientHandle()
Specified by:
getClientHandle in interface IVorbaIdFactory

setUser

protected abstract void setUser(UserHandle userHandle)

getUserHandle

public abstract UserHandle getUserHandle()
Specified by:
getUserHandle in interface IVorbaIdFactory