2 * org.vamsas.client.IClient
5 package org.vamsas.client;
7 import java.beans.PropertyChangeListener;
8 import java.util.EventListener;
11 * Defines the methods availabable to a vamsas
12 * application for interacting with its Vorba agent
13 * created by an IClientFactory instance for a particular session,
14 * user, and application handle.
15 * (it's VORBA, not CORBA!)
18 public interface IClient {
21 * Self-documenting/describing info for the application to present
23 * TODO: formalise this for describing VAMSAS system, a particular
24 * Vorba client agent, and a particular session.
25 * @returns string like VamsasClient v.1.1.1 (GPL) and whatever
27 public String getAbout();
30 * TODO: Is this not be the same as the SessionUrn ?
31 * @return current SessionUrn
33 public String getSessionUrn();
35 * Returns a valid URN for other applications to connect to
37 * @return session handle for this session.
39 public SessionHandle getSessionHandle();
41 * Included for applications with several ClientHandle
43 * @return ClientHandle used to interact with
44 * other Vamsas applications.
46 public ClientHandle getClientHandle();
49 * @return UserHandle used when interacting
50 * with other Vamsas applications.
52 public UserHandle getUserHandle();
54 * Method called by client application on exit.
55 * Vorba will inform other clients if they exist.
56 * If this is the last application in the session
57 * then the session will be closed.
58 * Note: The application should be ready to handle
59 * 'RequestToCloseDocument' events from the Vorba
60 * agent in the latter case and so prompt the user
61 * to save the session locally.
62 * TODO: pick a better name ?
64 public void finalizeClient();
66 * register handler for updates for the current session
68 public void addDocumentUpdateHandler(EventListener evt);
70 * get vamsas document with
71 * user and app specific data
73 public IClientDocument getClientDocument();
75 * Queue new Vorba objects for storage and propagation
76 * to other clients (via Event.DOCUMENT_UPDATE based
77 * notification of document change)
78 * New objects without provenance information will be
79 * given a default entry using the IClient's application,
80 * user (and session) handles
82 public void updateDocument(IClientDocument newdoc);
84 * Any application may call storeDocument to
85 * save a local copy of the current vamsas document
86 * including all application specific entries.
88 * @param location to write zip file
90 public void storeDocument(java.io.File location);
92 * Add a listener to a particular event chain.
93 * See org.vamsas.client.Events for allowed values for EventChain.
94 * The EventChain value is passed as the propertyName in the java.bean.PropertyChangeEvent
95 * TODO: build our own vamsas Event/Listener model.
96 * @param EventChain Name of event. Blank/null registers handler for all events.
97 * @param evt - event handler function.
99 public void addVorbaEventHandler(String EventChain, PropertyChangeListener evt);