uk.ac.vamsas.client.simpleclient
Class IdFactory

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

public class IdFactory
extends VorbaIdFactory

Simplest VorbaId constructor

Author:
jimp

Field Summary
 
Fields inherited from class uk.ac.vamsas.client.VorbaIdFactory
extanthashv, extantids, newobj
 
Constructor Summary
  IdFactory()
           
protected IdFactory(SessionHandle session, ClientHandle client, UserHandle user)
           
protected IdFactory(SessionHandle session, ClientHandle client, UserHandle user, java.util.Hashtable extanthashv)
          Create IdFactory with existing object hashes and id set
 
Method Summary
 ClientHandle getClientHandle()
           
protected static IdFactory getDummyFactory(java.lang.String clientname)
          Convenience method used for default behaviour in testing and any anonymous internal vamsasDocument unmarshalling
 SessionHandle getSessionHandle()
           
 UserHandle getUserHandle()
           
protected  java.util.Hashtable getVobjhashVals()
          values for keys in this hash are Vobjhash objects created for each Vobj with a VorbaId after this factory has been used to write a vamsas archive.
protected  java.util.Hashtable getVorbaIdHash()
          values for keys in this hash can be used to reference the uk.ac.vamsas.client.Vobject instance for the VorbaId string.
 VorbaId makeVorbaId(Vobject vobject)
          construct a new id appropriate for this client in the vamsas session.
protected  void setClient(ClientHandle appHandle)
           
protected  void setSession(SessionHandle sessionhandle)
          TODO: decide if these are needed.
protected  void setUser(UserHandle userHandle)
           
 
Methods inherited from class uk.ac.vamsas.client.VorbaIdFactory
newId, setNewIdHash, updateHashValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdFactory

public IdFactory()

IdFactory

protected IdFactory(SessionHandle session,
                    ClientHandle client,
                    UserHandle user)
Parameters:
session -
client -
user -

IdFactory

protected IdFactory(SessionHandle session,
                    ClientHandle client,
                    UserHandle user,
                    java.util.Hashtable extanthashv)
Create IdFactory with existing object hashes and id set

Parameters:
session -
client -
user -
extanthashv - hash of existing VorbaIds from a previous read of same document
Method Detail

getVorbaIdHash

protected java.util.Hashtable getVorbaIdHash()
values for keys in this hash can be used to reference the uk.ac.vamsas.client.Vobject instance for the VorbaId string.

Returns:
the hash of all VorbaIds

getVobjhashVals

protected java.util.Hashtable getVobjhashVals()
values for keys in this hash are Vobjhash objects created for each Vobj with a VorbaId after this factory has been used to write a vamsas archive.

Returns:
the hash of all VorbaIds and their hash values.

makeVorbaId

public VorbaId makeVorbaId(Vobject vobject)
Description copied from class: VorbaIdFactory
construct a new id appropriate for this client in the vamsas session.

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

setSession

protected void setSession(SessionHandle sessionhandle)
Description copied from class: VorbaIdFactory
TODO: decide if these are needed.

Specified by:
setSession in class VorbaIdFactory

getSessionHandle

public SessionHandle getSessionHandle()
Specified by:
getSessionHandle in interface IVorbaIdFactory
Specified by:
getSessionHandle in class VorbaIdFactory

setClient

protected void setClient(ClientHandle appHandle)
Specified by:
setClient in class VorbaIdFactory

getClientHandle

public ClientHandle getClientHandle()
Specified by:
getClientHandle in interface IVorbaIdFactory
Specified by:
getClientHandle in class VorbaIdFactory

setUser

protected void setUser(UserHandle userHandle)
Specified by:
setUser in class VorbaIdFactory

getUserHandle

public UserHandle getUserHandle()
Specified by:
getUserHandle in interface IVorbaIdFactory
Specified by:
getUserHandle in class VorbaIdFactory

getDummyFactory

protected static IdFactory getDummyFactory(java.lang.String clientname)
Convenience method used for default behaviour in testing and any anonymous internal vamsasDocument unmarshalling

Parameters:
clientname -
Returns: