added new client factory methods to open a stored session document in a new session.
[vamsas.git] / src / uk / ac / vamsas / client / IClientFactory.java
index 6797fa6..ac9ff88 100644 (file)
@@ -6,6 +6,8 @@
  */
 package uk.ac.vamsas.client;
 
+import java.io.File;
+
 /**
  * Defines methods for instantiating Vorba client application agents
  * @author jimp
@@ -57,7 +59,21 @@ public interface IClientFactory {
         * @return
         */
        IClient getNewSessionIClient(ClientHandle applicationHandle, UserHandle userId);
-       
+       /**
+        * Create a new session and import an existing vamsas document into it.
+        * @param applicationHandle 
+        * @param vamsasDocument
+        * @return
+        */
+       IClient openAsNewSessionIClient(ClientHandle applicationHandle, File vamsasDocument) throws InvalidSessionDocumentException;
+       /**
+        * Create a new session as a particular user and import an existing vamsas document into it.
+        * @param applicationHandle 
+        * @param userId
+        * @param vamsasDocument
+        * @return
+        */
+      IClient openAsNewSessionIClient(ClientHandle applicationHandle, UserHandle userId, File vamsasDocument) throws InvalidSessionDocumentException;
        /**
         * enumerate the active sessions this IClientFactory instance knows about.
         * Can be used by caller to pick a session on catching a NoDefaultSessionException.