vamsas API version 0.2 - allow new sessions or imported sessions to be created with...
[vamsas.git] / src / uk / ac / vamsas / client / IClientFactory.java
index 5f16a6e..0ec1d79 100644 (file)
@@ -28,7 +28,8 @@ import java.io.File;
  * 
  * @author jimp
  * 
- *         (it's VORBA, not CORBA!)
+ * @note  (it's VORBA, not CORBA!)
+ * @history added additional sessionName argument for openAsNewSessionIClient method (v0.2)
  */
 
 public interface IClientFactory {
@@ -97,7 +98,7 @@ public interface IClientFactory {
 
   /**
    * Create a new session and import an existing vamsas document into it.
-   * 
+   * Session name will inherit from vamsasDocument path.
    * @param applicationHandle
    * @param vamsasDocument
    * @return
@@ -106,6 +107,17 @@ public interface IClientFactory {
       File vamsasDocument) throws InvalidSessionDocumentException;
 
   /**
+   * Create a new session and import an existing vamsas document into it.
+   * 
+   * @param applicationHandle
+   * @param vamsasDocument
+   * @param sessionName - preferred session name (may be null)  
+   * @return
+   */
+  IClient openAsNewSessionIClient(ClientHandle applicationHandle, 
+      File vamsasDocument, String sessionName) throws InvalidSessionDocumentException;
+
+  /**
    * Create a new session as a particular user and import an existing vamsas
    * document into it.
    * 
@@ -116,8 +128,20 @@ public interface IClientFactory {
    */
   IClient openAsNewSessionIClient(ClientHandle applicationHandle,
       UserHandle userId, File vamsasDocument)
-      throws InvalidSessionDocumentException;
-
+      throws InvalidSessionDocumentException;  
+  /**
+   * Create a new session as a particular user and import an existing vamsas
+   * document into it.
+   * 
+   * @param applicationHandle
+   * @param userId
+   * @param vamsasDocument
+   * @param sessionName - preferred session name (may be null)  
+   * @return
+   */
+  IClient openAsNewSessionIClient(ClientHandle applicationHandle,
+      UserHandle userId, File vamsasDocument, String sessionName)
+  throws InvalidSessionDocumentException;
   /**
    * enumerate the active sessions this IClientFactory instance knows about. Can
    * be used by caller to pick a session on catching a