choose a particular vamsas session, load, or create a new session and export the...
[jalview.git] / src / jalview / gui / VamsasApplication.java
index 18c2e55..cf44191 100644 (file)
@@ -56,12 +56,26 @@ public class VamsasApplication
   private static uk.ac.vamsas.client.IClientFactory getClientFactory() throws IOException {
     return new uk.ac.vamsas.client.simpleclient.SimpleClientFactory();
   }
+  /**
+   * Start a new vamsas session
+   * @param jdesktop
+   */
   public VamsasApplication(Desktop jdesktop)
   {
     this.jdesktop = jdesktop; 
     initClientSession(null);
   }
   /**
+   * init a connection to the session at the given url
+   * @param jdesktop
+   * @param sessionUrl
+   */
+  public VamsasApplication(Desktop jdesktop, String sessionUrl)
+  {
+    this.jdesktop = jdesktop; 
+    initClientSession(sessionUrl);
+  }
+  /**
    * @throws IOException or other if clientfactory instantiation failed.
    * @return list of current sessions or null if no session exists.
    */
@@ -80,7 +94,7 @@ public class VamsasApplication
       uk.ac.vamsas.client.IClientFactory clientfactory = getClientFactory();
       if (sess==null)
       {
-        vclient = clientfactory.getIClient(app);
+        vclient = clientfactory.getNewSessionIClient(app);
       }
       else
       {
@@ -89,10 +103,7 @@ public class VamsasApplication
       
       user = vclient.getUserHandle();
       
-    } catch (NoDefaultSessionException e)
-    {
-      return false;
-    }
+    } 
     catch (Exception e)
     {
       jalview.bin.Cache.log.error("Couldn't instantiate vamsas client !",e);