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 uk.ac.vamsas.client;
12 * Defines methods for instantiating Vorba client application agents
15 * (it's VORBA, not CORBA!)
18 public interface IClientFactory {
21 * Create a new Vorba Session
22 * @param applicationHandle is the application's VAMSAS handle string
23 * @throws NoDefaultSessionException if more than one session exists that the client may connect to
25 IClient getIClient(ClientHandle applicationHandle) throws NoDefaultSessionException;
27 * returns new Vorba for a given session.
28 * @param applicationHandle
29 * @param sessionUrn session to connect to (or null to create a new session)
32 IClient getIClient(ClientHandle applicationHandle, String sessionUrn);
34 * returns new vorba for a given session acting as a particular identity
35 * @param applicationHandle
37 * @param sessionUrn session to connect to (or null to create a new session)
40 IClient getIClient(ClientHandle applicationHandle, UserHandle userId, String sessionUrn);
42 * New session for application and specific user
43 * @param applicationHandle
46 * @throws NoDefaultSessionException if more than one session exists that the client may connect to
48 IClient getIClient(ClientHandle applicationHandle, UserHandle userId) throws NoDefaultSessionException;
50 * Create a new sesssion for the application with the current user
51 * @param applicationHandle
54 IClient getNewSessionIClient(ClientHandle applicationHandle);
56 * Create a new session for the application using a particular user identity
57 * @param applicationHandle
61 IClient getNewSessionIClient(ClientHandle applicationHandle, UserHandle userId);
63 * Create a new session and import an existing vamsas document into it.
64 * @param applicationHandle
65 * @param vamsasDocument
68 IClient openAsNewSessionIClient(ClientHandle applicationHandle, File vamsasDocument) throws InvalidSessionDocumentException;
70 * Create a new session as a particular user and import an existing vamsas document into it.
71 * @param applicationHandle
73 * @param vamsasDocument
76 IClient openAsNewSessionIClient(ClientHandle applicationHandle, UserHandle userId, File vamsasDocument) throws InvalidSessionDocumentException;
78 * enumerate the active sessions this IClientFactory instance knows about.
79 * Can be used by caller to pick a session on catching a NoDefaultSessionException.
80 * LATER: Define interface for discovering more information about a session (so it can be presented to a user in a meaningful way)
81 * @return possibly empty array of sessionUrn strings
83 public String[] getCurrentSessions();