2 * Created on 13-Sep-2005
4 * TODO To change the template for this generated file go to
5 * Window - Preferences - Java - Code Style - Code Templates
7 package org.vamsas.client;
11 * Defines the API for the Vamsas XML Document
12 * as accessed by a Vamsas SimpleClient Application.
13 * An instance of this interface is valid for a
14 * particular set of user, session and application
17 * It initially represents a snapshot of the
18 * XML document at a particular time - queriable by
19 * reference or by retrieval of root objects.
20 * It provides methods to make new object references,
21 * These are guaranteed to be unique amongst existing
22 * objects in the document, all other references created
23 * by this object's instance and all other references
24 * constructed by any other vamsas agents in the session.
25 * TODO: Since a clientDocument is created for a particular
26 * UserHandle, there is scope for fine grain data access
27 * control based on user identity.
28 * A user may also want to make private notes, not
29 * available to other people using the same application
30 * in the same session.
34 public interface IClientDocument {
37 * Get a single object.
39 * @return object referred to by id or null if it doesn't exist.
41 object getObject(VorbaId id);
43 * Get a list of objects.
45 * @return array of objects using a vector of VorbaId ids.
47 object[] getObjects(VorbaId[] ids);
49 * Returns all root objects in document. All objects inherit
50 * from org.vamsas.client.object and have valid VorbaIds and provenance entries.
51 * @return array of root Vamsas element objects. (TODO: insert correct class here)
53 object[] getVamsasRoots();
55 * Returns an object with a valid VorbaId, and provenance element.
56 * The VorbaId is so the application may refer to it in
59 * Note: An object with valid VorbaId will not be reregistered.
60 * @param unregistered unregistered vamsas object
61 * @return VorbaId registered for vamsas object
63 VorbaId registerObject(object unregistered);
65 * Returns an array of objects, each with a valid VorbaId
66 * (and completed provenance entry).
67 * Note: An object with valid VorbaId will not be reregistered.
68 * @param unregistered array of unregistered objects.
69 * @return array of VorbaIds for the registered objects
71 VorbaId[] registerObjects(object[] unregistered);
74 * Gets the application data associated with this session's
75 * vamsas document that is accessible by the client
76 * application (and user)
77 * @return applicationData field
79 byte[] getApplicationData();
81 * Sets the application data entry associated with
82 * the application and user participating in this vamsas session.
83 * @param newData new contents of applicationData field.
85 void setApplicationData(byte[] newData);