/* * Created on 13-Sep-2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package org.vamsas.client; /** * Defines the API for the Vamsas XML Document * as accessed by a Vamsas SimpleClient Application. * An instance of this interface is valid for a * particular set of user, session and application * handles. * * It initially represents a snapshot of the * XML document at a particular time - queriable by * reference or by retrieval of root objects. * It provides methods to make new object references, * These are guaranteed to be unique amongst existing * objects in the document, all other references created * by this object's instance and all other references * constructed by any other vamsas agents in the session. * TODO: Since a clientDocument is created for a particular * UserHandle, there is scope for fine grain data access * control based on user identity. * A user may also want to make private notes, not * available to other people using the same application * in the same session. * * @author jimp */ public interface IClientDocument { /** * Get a single object. * @param id * @return object referred to by id or null if it doesn't exist. */ object getObject(VorbaId id); /** * Get a list of objects. * @param ids * @return array of objects using a vector of VorbaId ids. */ object[] getObjects(VorbaId[] ids); /** * Returns all root objects in document. All objects inherit * from org.vamsas.client.object and have valid VorbaIds and provenance entries. * @return array of root Vamsas element objects. (TODO: insert correct class here) */ object[] getVamsasRoots(); /** * Returns an object with a valid VorbaId, and provenance element. * The VorbaId is so the application may refer to it in * its own dataspace. * * Note: An object with valid VorbaId will not be reregistered. * @param unregistered unregistered vamsas object * @return VorbaId registered for vamsas object */ VorbaId registerObject(object unregistered); /** * Returns an array of objects, each with a valid VorbaId * (and completed provenance entry). * Note: An object with valid VorbaId will not be reregistered. * @param unregistered array of unregistered objects. * @return array of VorbaIds for the registered objects */ VorbaId[] registerObjects(object[] unregistered); /** * Gets the application data associated with this session's * vamsas document that is accessible by the client * application (and user) * @return applicationData field */ byte[] getApplicationData(); /** * Sets the application data entry associated with * the application and user participating in this vamsas session. * @param newData new contents of applicationData field. */ void setApplicationData(byte[] newData); }