airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1514348 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/ airavata-client/src/main/java/org/apache/airavata/client/impl/ commons/workflow-execution-context/src/main/java/org/apache/airavata/common/work...
Date Thu, 15 Aug 2013 16:19:32 GMT
Author: samindaw
Date: Thu Aug 15 16:19:32 2013
New Revision: 1514348

URL: http://svn.apache.org/r1514348
Log:
https://issues.apache.org/jira/browse/AIRAVATA-838

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
    airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java?rev=1514348&r1=1514347&r2=1514348&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
Thu Aug 15 16:19:32 2013
@@ -47,10 +47,11 @@ public class AiravataAPIUtils {
 	//------------------End of Deprecated Functions---------------------//
 
 	public static WorkflowContextHeaderBuilder createWorkflowContextHeaderBuilder(
-			ExperimentAdvanceOptions options, String submissionUser)
+			ExperimentAdvanceOptions options, String executionUser, String submissionUser)
 			throws AiravataAPIInvocationException {
 		WorkflowContextHeaderBuilder builder=createWorkflowContextHeader();
-		builder.setUserIdentifier(submissionUser);
+		builder.setUserIdentifier(executionUser);
+		builder.setSubmissionUser(submissionUser);
 		NodeSettings[] nodeSettingsList = options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
 		for (NodeSettings nodeSettings : nodeSettingsList) {
 			List<NameValuePairType> nameValuePairTypes = nodeSettings.getNameValuePair();
@@ -73,7 +74,7 @@ public class AiravataAPIUtils {
         if (options.getCustomSecuritySettings().getCredentialStoreSecuritySettings() != null)
{
             builder.setCredentialManagementService(options.getCustomSecuritySettings().
                     getCredentialStoreSecuritySettings().getTokenId(),
-                    submissionUser);
+                    executionUser);
         }
 
 

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java?rev=1514348&r1=1514347&r2=1514348&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
Thu Aug 15 16:19:32 2013
@@ -59,6 +59,7 @@ import org.apache.airavata.ws.monitor.Ev
 import org.apache.airavata.ws.monitor.Monitor;
 import org.apache.airavata.ws.monitor.MonitorConfiguration;
 import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
 import org.apache.axis2.AxisFault;
 
@@ -217,7 +218,7 @@ public class ExecutionManagerImpl implem
 			if (executionUser==null){
 				executionUser=submissionUser;
 			}
-			WorkflowContextHeaderBuilder builder = AiravataAPIUtils.createWorkflowContextHeaderBuilder(options,
submissionUser);
+			WorkflowContextHeaderBuilder builder = AiravataAPIUtils.createWorkflowContextHeaderBuilder(options,
executionUser, submissionUser);
 			runPreWorkflowExecutionTasks(experimentID, executionUser, options.getExperimentMetadata(),
options.getExperimentName());
 			NameValue[] inputVals = inputValues.toArray(new NameValue[] {});
 			if (listener!=null){
@@ -271,9 +272,11 @@ public class ExecutionManagerImpl implem
 		try {
 			builder.getWorkflowMonitoringContext().setExperimentId(experimentId);
 			WorkflowInterpretorStub stub = new WorkflowInterpretorStub(getClient().getAiravataManager().getWorkflowInterpreterServiceURL().toString());
+			OMElement wchOMElement = AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder
+					.getXml()));
+			wchOMElement.addAttribute("submissionUser", builder.getSubmissionUser(), wchOMElement.getNamespace());
 			stub._getServiceClient().addHeader(
-					AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder
-							.getXml())));
+					wchOMElement);
 			stub.launchWorkflow(workflowGraph, experimentId, inputs);
 		} catch (AxisFault e) {
 			e.printStackTrace();
@@ -303,7 +306,7 @@ public class ExecutionManagerImpl implem
 		try {
 			ExperimentAdvanceOptions b = a.createExperimentAdvanceOptions();
 			b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", "da", false);
-			WorkflowContextHeaderBuilder c = AiravataAPIUtils.createWorkflowContextHeaderBuilder(b,
"meeee");
+			WorkflowContextHeaderBuilder c = AiravataAPIUtils.createWorkflowContextHeaderBuilder(b,
"sheeeeeeeeeeee","meeee");
 			System.out.println(XMLUtil.xmlElementToString(c.getXml()));
 		} catch (AiravataAPIInvocationException e) {
 			e.printStackTrace();

Modified: airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java?rev=1514348&r1=1514347&r2=1514348&view=diff
==============================================================================
--- airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
(original)
+++ airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
Thu Aug 15 16:19:32 2013
@@ -20,13 +20,17 @@
  */
 package org.apache.airavata.common.workflow.execution.context;
 
-import java.lang.reflect.Array;
-import java.util.Map;
-
 import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.schemas.wec.*;
+import org.apache.airavata.schemas.wec.ApplicationOutputDataHandlingDocument;
+import org.apache.airavata.schemas.wec.ApplicationSchedulingContextDocument;
+import org.apache.airavata.schemas.wec.ContextHeaderDocument;
+import org.apache.airavata.schemas.wec.NameValuePairType;
+import org.apache.airavata.schemas.wec.SecurityContextDocument;
+import org.apache.airavata.schemas.wec.SoaServiceEprsDocument;
+import org.apache.airavata.schemas.wec.WorkflowMonitoringContextDocument;
+import org.apache.airavata.schemas.wec.WorkflowOutputDataHandlingDocument;
+import org.apache.airavata.schemas.wec.WorkflowSchedulingContextDocument;
 import org.apache.xmlbeans.XmlException;
-import org.omg.CORBA.NameValuePair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xmlpull.v1.builder.XmlElement;
@@ -42,6 +46,7 @@ public class WorkflowContextHeaderBuilde
     private SoaServiceEprsDocument.SoaServiceEprs soaServiceEprs = null;
 
     private String userIdentifier = null;
+    private String submissionUser = null;
 
     private WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling workflowOutputDataHandling
= null;
 
@@ -447,4 +452,12 @@ public class WorkflowContextHeaderBuilde
         WorkflowContextHeaderBuilder.setCurrentContextHeader(parse.getContextHeader());
         return header;
     }
+
+	public String getSubmissionUser() {
+		return submissionUser;
+	}
+
+	public void setSubmissionUser(String submissionUser) {
+		this.submissionUser = submissionUser;
+	}
 }

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java?rev=1514348&r1=1514347&r2=1514348&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
(original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
Thu Aug 15 16:19:32 2013
@@ -52,7 +52,7 @@ public class ExperimentExecutionService 
     	String user =  WorkflowContext.getRequestUser();
         String gatewayId = WorkflowContext.getGatewayId();
     	try {
-			String experimentId = getInterpreterService().setupAndLaunch(workflowTemplateName, advanceOptions.getCustomExperimentId(),
gatewayId, user, workflowInputs, true, AiravataAPIUtils.createWorkflowContextHeaderBuilder(advanceOptions,
user));
+			String experimentId = getInterpreterService().setupAndLaunch(workflowTemplateName, advanceOptions.getCustomExperimentId(),
gatewayId, user, workflowInputs, true, AiravataAPIUtils.createWorkflowContextHeaderBuilder(advanceOptions,
advanceOptions.getExperimentExecutionUser(),user));
 	    	Response.ResponseBuilder builder = Response.status(Response.Status.OK);
 	        builder.entity(experimentId);
 	        return builder.build();

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1514348&r1=1514347&r2=1514348&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
Thu Aug 15 16:19:32 2013
@@ -281,7 +281,7 @@ public class WorkflowInterpretorSkeleton
         }
         Map<String, String> configuration = new HashMap<String, String>();
         WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext,
configuration);
-        String user = workflowContextHeaderBuilder.getUserIdentifier();
+        String user = workflowContextHeaderBuilder.getSubmissionUser();
 
         String s = null;
         try {
@@ -330,7 +330,10 @@ public class WorkflowInterpretorSkeleton
         } catch (AiravataAPIInvocationException e) {
             log.error(e.getMessage());
         }
-        return new WorkflowContextHeaderBuilder(parse.getContextHeader());
+    	String submissionUser = workflowContext.getAttributeValue(new QName(workflowContext.getNamespace().getNamespaceURI(),
"submissionUser"));
+        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = new WorkflowContextHeaderBuilder(parse.getContextHeader());
+        workflowContextHeaderBuilder.setSubmissionUser(submissionUser);
+		return workflowContextHeaderBuilder;
     }
     public String setupAndLaunch(String workflowAsString, String experimentId, String gatewayId,
String username,
             Map<String,String> inputs,boolean inNewThread,WorkflowContextHeaderBuilder
builder) throws AiravataAPIInvocationException{



Mime
View raw message