airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1524530 - /airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
Date Wed, 18 Sep 2013 19:04:28 GMT
Author: chathuri
Date: Wed Sep 18 19:04:28 2013
New Revision: 1524530

URL: http://svn.apache.org/r1524530
Log:
fixing AIRAVATA-920

Modified:
    airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java?rev=1524530&r1=1524529&r2=1524530&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
Wed Sep 18 19:04:28 2013
@@ -22,10 +22,13 @@
 package org.apache.airavata.xbaya;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.List;
 
+import org.apache.airavata.client.AiravataAPIFactory;
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.AiravataManager;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.workflow.model.component.ComponentRegistryException;
 import org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry;
 import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
@@ -36,6 +39,7 @@ import org.apache.airavata.ws.monitor.Mo
 import org.apache.airavata.ws.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.component.registry.ComponentController;
 import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.registry.PasswordCallbackImpl;
 import org.apache.airavata.xbaya.ui.XBayaGUI;
 import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
 import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
@@ -82,6 +86,18 @@ public class XBayaEngine {
                 configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
         this.monitor = new Monitor(monitorConfiguration);
 
+        if (configuration.getAiravataAPI() == null && airavataAPI == null) {
+            try {
+                airavataAPI =  AiravataAPIFactory.getAPI(configuration.getRegistryURL(),
+                        configuration.getDefaultGateway(), configuration.getRegistryUserName(),
+                        new PasswordCallbackImpl(configuration.getRegistryUserName(), configuration.getRegistryPassphrase()));
+                configuration.setAiravataAPI(airavataAPI);
+            } catch (AiravataAPIInvocationException e) {
+                logger.error("Unable to instantiate airavata api instance", e);
+            }
+
+        }
+
         // MyProxy
         // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
         // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
@@ -238,8 +254,8 @@ public class XBayaEngine {
 	
 	public void updateXBayaConfigurationServiceURLs() {
 		try {
-			if (this.getConfiguration().getAiravataAPI()!=null && this.getConfiguration().getAiravataAPI()!=null){
-                AiravataAPI airavataAPI = getConfiguration().getAiravataAPI();
+			if (this.getConfiguration().getAiravataAPI()!=null){
+                airavataAPI = getConfiguration().getAiravataAPI();
                 AiravataManager airavataManager = airavataAPI.getAiravataManager();
 //                AiravataRegistry2 registry=this.getConfiguration().getJcrComponentRegistry().getRegistry();
 	        	URI eventingServiceURL = airavataManager.getEventingServiceURL();



Mime
View raw message