You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/06/27 18:13:56 UTC

svn commit: r1354604 - in /incubator/airavata/branches/0.3-incubating-snapshot/modules: airavata-client/src/main/java/org/apache/airavata/client/airavata/ gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/ xbaya-gui/src/main/jav...

Author: lahiru
Date: Wed Jun 27 16:13:51 2012
New Revision: 1354604

URL: http://svn.apache.org/viewvc?rev=1354604&view=rev
Log:
adding new method to AC to be used to configure workflowContextHeader.

Modified:
    incubator/airavata/branches/0.3-incubating-snapshot/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java
    incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
    incubator/airavata/branches/0.3-incubating-snapshot/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java

Modified: incubator/airavata/branches/0.3-incubating-snapshot/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/branches/0.3-incubating-snapshot/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java?rev=1354604&r1=1354603&r2=1354604&view=diff
==============================================================================
--- incubator/airavata/branches/0.3-incubating-snapshot/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java (original)
+++ incubator/airavata/branches/0.3-incubating-snapshot/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java Wed Jun 27 16:13:51 2012
@@ -139,7 +139,6 @@ public class AiravataClient {
 
 	private void initialize() throws MalformedURLException {
 		updateClientConfiguration(configuration);
-		
         // At this point we do not know the workflowExperimentId
 		builder = new WorkflowContextHeaderBuilder(configuration.get(BROKER),
         		configuration.get(GFAC),configuration.get(JCR),null,null,
@@ -654,4 +653,22 @@ public class AiravataClient {
     public static WorkflowContextHeaderBuilder getBuilder() {
         return builder;
     }
+
+    public List<String> getWorkflowServiceIDs(String templateID){
+        Property workflowAsString = null;
+        try {
+            workflowAsString = this.getWorkflowAsString(templateID);
+            Workflow workflow = new Workflow(workflowAsString.getString());
+            return workflow.getWorkflowServiceNodeIDs();
+        } catch (RegistryException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (RepositoryException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (GraphException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (ComponentException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+    }
+
 }

Modified: incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1354604&r1=1354603&r2=1354604&view=diff
==============================================================================
--- incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java (original)
+++ incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java Wed Jun 27 16:13:51 2012
@@ -160,10 +160,6 @@ public class GFacMessageReciever impleme
         String brokerURL = getEventBrokerURL(messageContext);
         String topic = getTopic(messageContext);
         OMElement outputElement = null;
-        SecurityContextDocument parse =
-                SecurityContextDocument.Factory.parse(getHeader(messageContext).getFirstChildWithName
-                        (new QName("http://schemas.airavata.apache.org/workflow-execution-context", "security-context")).toStringWithConsume());
-        SecurityContextDocument.SecurityContext.GridMyproxyRepository gridMyproxyRepository = parse.getSecurityContext().getGridMyproxyRepository();
         OMElement header = getHeader(messageContext);
         ContextHeaderDocument document = null;
         try {
@@ -191,13 +187,14 @@ public class GFacMessageReciever impleme
         }
         DefaultInvocationContext invocationContext = null;
         JobContext jobContext = new JobContext(actualParameters,topic,serviceName,brokerURL);
-        if(document.getContextHeader().getSecurityContext().getAmazonWebservices() != null){
+        //todo send security context and handle amazon services scenario
+//        if(document.getContextHeader().getSecurityContext().getAmazonWebservices() != null){
 //            invocationContext.getExecutionContext().setSecurityContextHeader(header);
             //todo if there's amazoneWebServices context we need to set that value, this will refer in EC2Provider
-        }else {
+//        }else {
             gfacAPI = new GfacAPI();
             invocationContext = gfacAPI.gridJobSubmit(jobContext, (GFacConfiguration) context.getProperty(GFacService.GFAC_CONFIGURATION));
-        }
+//        }
         try {
             /*
              * Add notifiable object

Modified: incubator/airavata/branches/0.3-incubating-snapshot/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/branches/0.3-incubating-snapshot/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java?rev=1354604&r1=1354603&r2=1354604&view=diff
==============================================================================
--- incubator/airavata/branches/0.3-incubating-snapshot/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java (original)
+++ incubator/airavata/branches/0.3-incubating-snapshot/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/wf/Workflow.java Wed Jun 27 16:13:51 2012
@@ -28,12 +28,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import javax.imageio.ImageIO;
 import javax.xml.namespace.QName;
@@ -913,4 +908,15 @@ public class Workflow implements Cloneab
 		getGraph().setEditable(editable);
 	}
 
+    public List<String> getWorkflowServiceNodeIDs(){
+        List<NodeImpl> nodes = getGraph().getNodes();
+        ArrayList<String> nodeIDs = new ArrayList<String>();
+        for(Node node:nodes){
+            if(node instanceof WSNode) {
+                nodeIDs.add(node.getID());
+            }
+        }
+        return nodeIDs;
+    }
+
 }
\ No newline at end of file