2 * This file is part of the Vamsas Client version 0.1.
3 * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
4 * Andrew Waterhouse and Dominik Lindner.
6 * Earlier versions have also been incorporated into Jalview version 2.4
7 * since 2008, and TOPALi version 2 since 2007.
9 * The Vamsas Client is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * The Vamsas Client is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.
22 package uk.ac.vamsas.client;
27 * Defines methods for instantiating Vorba client application agents
31 * (it's VORBA, not CORBA!)
34 public interface IClientFactory {
37 * Create a new Vorba Session
39 * @param applicationHandle
40 * is the application's VAMSAS handle string
41 * @throws NoDefaultSessionException
42 * if more than one session exists that the client may connect to
44 IClient getIClient(ClientHandle applicationHandle)
45 throws NoDefaultSessionException;
48 * returns new Vorba for a given session.
50 * @param applicationHandle
52 * session to connect to (or null to create a new session)
55 IClient getIClient(ClientHandle applicationHandle, String sessionUrn);
58 * returns new vorba for a given session acting as a particular identity
60 * @param applicationHandle
63 * session to connect to (or null to create a new session)
66 IClient getIClient(ClientHandle applicationHandle, UserHandle userId,
70 * New session for application and specific user
72 * @param applicationHandle
75 * @throws NoDefaultSessionException
76 * if more than one session exists that the client may connect to
78 IClient getIClient(ClientHandle applicationHandle, UserHandle userId)
79 throws NoDefaultSessionException;
82 * Create a new sesssion for the application with the current user
84 * @param applicationHandle
87 IClient getNewSessionIClient(ClientHandle applicationHandle);
90 * Create a new session for the application using a particular user identity
92 * @param applicationHandle
96 IClient getNewSessionIClient(ClientHandle applicationHandle, UserHandle userId);
99 * Create a new session and import an existing vamsas document into it.
101 * @param applicationHandle
102 * @param vamsasDocument
105 IClient openAsNewSessionIClient(ClientHandle applicationHandle,
106 File vamsasDocument) throws InvalidSessionDocumentException;
109 * Create a new session as a particular user and import an existing vamsas
112 * @param applicationHandle
114 * @param vamsasDocument
117 IClient openAsNewSessionIClient(ClientHandle applicationHandle,
118 UserHandle userId, File vamsasDocument)
119 throws InvalidSessionDocumentException;
122 * enumerate the active sessions this IClientFactory instance knows about. Can
123 * be used by caller to pick a session on catching a
124 * NoDefaultSessionException. LATER: Define interface for discovering more
125 * information about a session (so it can be presented to a user in a
128 * @return possibly empty array of sessionUrn strings
130 public String[] getCurrentSessions();