uk.ac.vamsas.test.simpleclient
Class ClientDoc

java.lang.Object
  extended byuk.ac.vamsas.client.ClientDocument
      extended byuk.ac.vamsas.test.simpleclient.ClientDoc
All Implemented Interfaces:
IClientDocument

public class ClientDoc
extends ClientDocument


Field Summary
 VAMSAS[] _VamsasRoots
           
protected  VamsasDocument doc
           
protected  VamsasArchive iohandler
           
protected  boolean isModified
           
protected  VamsasArchiveReader reader
           
 
Fields inherited from class uk.ac.vamsas.client.ClientDocument
vamsasObjects, vorbafactory
 
Constructor Summary
ClientDoc(VamsasDocument doc, VamsasArchive iohandler, VamsasArchiveReader reader, java.lang.String app, java.lang.String user, java.util.Hashtable objrefs)
           
 
Method Summary
 void addVamsasRoot(VAMSAS newroot)
          Adds a new VAMSAS root entry TODO: decide on same InvalidVamsasObject exceptions.
 void closeDoc()
          tell vamsas client to close the document and reset the object.
protected  void finalize()
           
 IClientAppdata getClientAppdata()
          Get instance of Client and User specific vamsas document data access interface.
 Vobject getObject(VorbaId id)
          Get a single Vobject.
 Vobject[] getObjects(VorbaId[] ids)
          Get a list of objects.
protected  Entry getProvenanceEntry(java.lang.String action)
           
 VamsasArchiveReader getReader()
           
 VAMSAS[] getVamsasRoots()
          Returns all root objects in document.
 VorbaId registerObject(Vobject unregistered)
          Returns an Vobject with a valid VorbaId, and provenance element.
 VorbaId[] registerObjects(Vobject[] unregistered)
          Returns an array of objects, each with a valid VorbaId (and completed provenance entry).
 void setVamsasRoots(VAMSAS[] newroots)
          update the document with new roots.
protected  void updateDocumentRoots()
           
 
Methods inherited from class uk.ac.vamsas.client.ClientDocument
_registerObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isModified

protected boolean isModified

doc

protected VamsasDocument doc

_VamsasRoots

public VAMSAS[] _VamsasRoots

iohandler

protected VamsasArchive iohandler

reader

protected VamsasArchiveReader reader
Constructor Detail

ClientDoc

public ClientDoc(VamsasDocument doc,
                 VamsasArchive iohandler,
                 VamsasArchiveReader reader,
                 java.lang.String app,
                 java.lang.String user,
                 java.util.Hashtable objrefs)
Parameters:
doc -
iohandler -
reader -
app -
user -
Method Detail

getClientAppdata

public IClientAppdata getClientAppdata()
Description copied from interface: IClientDocument
Get instance of Client and User specific vamsas document data access interface.

Returns:
Interface to Client and user specific application data

getProvenanceEntry

protected Entry getProvenanceEntry(java.lang.String action)

getVamsasRoots

public VAMSAS[] getVamsasRoots()
Description copied from interface: IClientDocument
Returns all root objects in document. All objects inherit from uk.ac.vamsas.client.Vobject and have valid VorbaIds and provenance entries.

Returns:
array of root Vamsas element objects.

setVamsasRoots

public void setVamsasRoots(VAMSAS[] newroots)
update the document with new roots. LATER: decide: this affects the next call to getVamsasRoots()

Parameters:
newroots -
See Also:
org.vamsas.IClientDocument.setVamsasRoots

addVamsasRoot

public void addVamsasRoot(VAMSAS newroot)
Description copied from interface: IClientDocument
Adds a new VAMSAS root entry TODO: decide on same InvalidVamsasObject exceptions. TODO: decide if a 'removeVamsasRoot' method is really needed.

Parameters:
newroot -

getReader

public VamsasArchiveReader getReader()

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

registerObjects

public VorbaId[] registerObjects(Vobject[] unregistered)
Description copied from interface: IClientDocument
Returns an array of objects, each with a valid VorbaId (and completed provenance entry). Note: An Vobject with valid VorbaId will not be reregistered.

Parameters:
unregistered - array of unregistered objects.
Returns:
array of VorbaIds for the registered objects

registerObject

public VorbaId registerObject(Vobject unregistered)
Description copied from interface: IClientDocument
Returns an Vobject with a valid VorbaId, and provenance element. The VorbaId is so the application may refer to it in its own dataspace. Note: An Vobject with valid VorbaId will not be reregistered. Advice: Calling this method for a high-level Vobject (such as uk.ac.vamsas.objects.core.VAMSAS) will register all its component objects too.

Parameters:
unregistered - unregistered vamsas Vobject
Returns:
VorbaId registered for vamsas Vobject

getObject

public Vobject getObject(VorbaId id)
Description copied from interface: IClientDocument
Get a single Vobject.

Parameters:
id -
Returns:
Vobject referred to by id or null if it doesn't exist.

getObjects

public Vobject[] getObjects(VorbaId[] ids)
Description copied from interface: IClientDocument
Get a list of objects.

Parameters:
ids -
Returns:
array of objects using a vector of VorbaId ids.

updateDocumentRoots

protected void updateDocumentRoots()

closeDoc

public void closeDoc()
tell vamsas client to close the document and reset the object. Once closed, nothing can be done with the object.