airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1352790 [1/2] - in /incubator/airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/airavata/ airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client...
Date Fri, 22 Jun 2012 07:49:29 GMT
Author: samindaw
Date: Fri Jun 22 07:49:26 2012
New Revision: 1352790

URL: http://svn.apache.org/viewvc?rev=1352790&view=rev
Log:
airavata api update + some api interfaced implemented + refactoring

Added:
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPI.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPIInvocationException.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/UserManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowManager.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/AiravataManagerImpl.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecution.java
      - copied, changed from r1352481, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceStatus.java
      - copied, changed from r1352481, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java
    incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowInput.java
Removed:
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/WorkflowInput.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
Modified:
    incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
    incubator/airavata/trunk/modules/commons/registry-service/src/main/java/org/apache/airavata/registry/service/RegistryService.java
    incubator/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/Workflow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java

Modified: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java?rev=1352790&r1=1352789&r2=1352790&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java (original)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/airavata/AiravataClient.java Fri Jun 22 07:49:26 2012
@@ -47,12 +47,19 @@ import javax.jcr.ValueFormatException;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.AiravataManager;
+import org.apache.airavata.client.api.ApplicationManager;
+import org.apache.airavata.client.api.ExecutionManager;
+import org.apache.airavata.client.api.ProvenanceManager;
+import org.apache.airavata.client.api.UserManager;
+import org.apache.airavata.client.api.WorkflowManager;
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.registry.api.AiravataRegistry;
-import org.apache.airavata.registry.api.WorkflowExecution;
 import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
 import org.apache.airavata.workflow.model.component.ComponentException;
 import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
 import org.apache.airavata.workflow.model.graph.GraphException;
@@ -60,6 +67,7 @@ import org.apache.airavata.workflow.mode
 import org.apache.airavata.workflow.model.graph.system.InputNode;
 import org.apache.airavata.workflow.model.graph.util.GraphUtil;
 import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
 import org.apache.airavata.xbaya.interpretor.NameValue;
 import org.apache.airavata.xbaya.interpretor.WorkflowInterpretorStub;
 import org.apache.airavata.xbaya.monitor.Monitor;
@@ -70,7 +78,7 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
 import org.apache.axis2.AxisFault;
 
-public class AiravataClient {
+public class AiravataClient implements AiravataAPI {
 //	private static final MLogger log = MLogger.getLogger();
 
 	public static final String GFAC = "gfac";
@@ -199,6 +207,10 @@ public class AiravataClient {
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#loadWorkflowFromaFile(java.lang.String)
+	 */
+	@Override
 	public void loadWorkflowFromaFile(String workflowFile)
 			throws URISyntaxException, IOException {
 		File workflow = null;
@@ -225,6 +237,10 @@ public class AiravataClient {
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#loadWorkflowasaString(java.lang.String)
+	 */
+	@Override
 	public void loadWorkflowasaString(String workflowAsaString) {
 		this.workflow = workflowAsaString;
 	}
@@ -243,6 +259,10 @@ public class AiravataClient {
 		}
 	}
 	
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#setInputs(java.lang.String)
+	 */
+	@Override
 	public NameValue[] setInputs(String fileName) throws IOException {
 		URL url = this.getClass().getClassLoader().getResource(fileName);
 		if (url == null) {
@@ -284,6 +304,10 @@ public class AiravataClient {
 		return null;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#setInputs(java.util.Properties)
+	 */
+	@Override
 	public void setInputs(Properties inputList) {
 		try {
 			Workflow workflow = new Workflow(this.workflow);
@@ -300,14 +324,26 @@ public class AiravataClient {
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String)
+	 */
+	@Override
 	public String runWorkflow(String topic) {
 		return runWorkflow(topic, (String) null);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, java.lang.String)
+	 */
+	@Override
 	public String runWorkflow(String topic, String user) {
 		return runWorkflow(topic, user, null);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, java.lang.String, java.lang.String)
+	 */
+	@Override
 	public String runWorkflow(String topic, String user, String metadata) {
         String worflowoutput = null;
                 try {
@@ -331,11 +367,19 @@ public class AiravataClient {
         return worflowoutput;
 	}
 
-  public Monitor getWorkflowExecutionMonitor(String topic) {
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowExecutionMonitor(java.lang.String)
+	 */
+	@Override
+	public Monitor getWorkflowExecutionMonitor(String topic) {
         return getWorkflowExecutionMonitor(topic, null);
     }
 
-    public Monitor getWorkflowExecutionMonitor(String topic,
+    /* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowExecutionMonitor(java.lang.String, org.apache.airavata.xbaya.monitor.MonitorEventListener)
+	 */
+    @Override
+	public Monitor getWorkflowExecutionMonitor(String topic,
             MonitorEventListener listener) {
         final String fTopic = topic;
         try {
@@ -371,14 +415,26 @@ public class AiravataClient {
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, org.apache.airavata.xbaya.interpretor.NameValue[])
+	 */
+	@Override
 	public String runWorkflow(String topic, NameValue[] inputs) throws Exception {
 		return runWorkflow(topic, inputs, null);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, org.apache.airavata.xbaya.interpretor.NameValue[], java.lang.String)
+	 */
+	@Override
 	public String runWorkflow(String topic, NameValue[] inputs, String user) throws Exception {
 		return runWorkflow(topic, inputs, user, null);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, org.apache.airavata.xbaya.interpretor.NameValue[], java.lang.String, java.lang.String)
+	 */
+	@Override
 	public String runWorkflow(final String topic, final NameValue[] inputs, final String user,
 			final String metadata) throws Exception{
 		new Thread(new Runnable() {
@@ -407,26 +463,28 @@ public class AiravataClient {
 		return topic;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowExecutionDataByUser(java.lang.String)
+	 */
+	@Override
 	public List<WorkflowExecution> getWorkflowExecutionDataByUser(String user)
 			throws RegistryException {
 		return getRegistry().getWorkflowExecutionByUser(user);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowExecutionData(java.lang.String)
+	 */
+	@Override
 	public WorkflowExecution getWorkflowExecutionData(String topic)
 			throws RegistryException {
 		return getRegistry().getWorkflowExecution(topic);
 	}
 
-	/**
-	 * 
-	 * @param user
-	 * @param pageSize
-	 *            - number of executions to return (page size)
-	 * @param PageNo
-	 *            - which page to return to (>=0)
-	 * @return
-	 * @throws RegistryException
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowExecutionData(java.lang.String, int, int)
 	 */
+	@Override
 	public List<WorkflowExecution> getWorkflowExecutionData(String user,
 			int pageSize, int PageNo) throws RegistryException {
 		return getRegistry().getWorkflowExecutionByUser(user, pageSize, PageNo);
@@ -440,6 +498,10 @@ public class AiravataClient {
 		AiravataClient.workflow = workflow;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getRegistry()
+	 */
+	@Override
 	public AiravataRegistry getRegistry() {
 		if (registry == null) {
 			try {
@@ -472,6 +534,10 @@ public class AiravataClient {
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getClientConfiguration()
+	 */
+	@Override
 	public AiravataClientConfiguration getClientConfiguration() {
 		if (clientConfiguration == null) {
 			clientConfiguration = new AiravataClientConfiguration();
@@ -518,10 +584,10 @@ public class AiravataClient {
 		return urlString;
 	}
 
-	/**
-	 * Retrieve the names of the workflow templates saved in the registry
-	 * @return
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowTemplateIds()
 	 */
+	@Override
 	public List<String> getWorkflowTemplateIds() {
 		List<String> workflowList = new ArrayList<String>();
 		Map<QName, Node> workflows;
@@ -538,25 +604,18 @@ public class AiravataClient {
 		return workflowList;
 	}
 
-	/**
-	 * Execute the given workflow template with the given inputs and return the topic id 
-	 * @param workflowTemplateId
-	 * @param inputs
-	 * @return
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, java.util.List)
 	 */
+	@Override
 	public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs) throws Exception{
 		return runWorkflow(workflowTemplateId,inputs,getRegistry().getUsername(),null);
 	}
 	
-	/**
-	 * Execute the given workflow template with the given inputs, user, metadata and return the topic id
-	 * @param workflowTemplateId
-	 * @param inputs
-	 * @param user
-	 * @param metadata
-	 * @return
-	 * @throws Exception
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#runWorkflow(java.lang.String, java.util.List, java.lang.String, java.lang.String)
 	 */
+	@Override
 	public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata) throws Exception{
 		try {
 			List<WSComponentPort> ports = getWSComponentPortInputs(workflowTemplateId);
@@ -592,26 +651,14 @@ public class AiravataClient {
 		return null;
 	}
 	
-	/**
-	 * Retrieve the inputs for the given workflow template
-	 * @param workflowTemplateId
-	 * @return
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowInputs(java.lang.String)
 	 */
+	@Override
 	public List<WorkflowInput> getWorkflowInputs(String workflowTemplateId) throws Exception{
 		try {
 			Workflow workflowTemplate = getWorkflow(workflowTemplateId);
-			List<WSComponentPort> inputs = getWSComponentPortInputs(workflowTemplate);
-			List<InputNode> inputNodes = getInputNodes(workflowTemplate);
-			List<WorkflowInput> results=new ArrayList<WorkflowInput>();
-			for (InputNode port : inputNodes) {
-				Object value=null;
-				WSComponentPort wsComponentPort = getWSComponentPort(port.getName(), inputs);
-				if (wsComponentPort!=null){
-					value=wsComponentPort.getValue();
-				}
-				results.add(new WorkflowInput(port.getName(), port.getParameterType().getLocalPart(), port.getDefaultValue(), value, !port.isVisibility()));
-			}
-			return results;
+			return workflowTemplate.getWorkflowInputs();
 		} catch (RegistryException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
@@ -622,6 +669,10 @@ public class AiravataClient {
 		return null;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.airavata.client.airavata.AiravataAPI#getWorkflowAsString(java.lang.String)
+	 */
+	@Override
 	public Property getWorkflowAsString(String workflowTemplateId)
 			throws RegistryException, PathNotFoundException,
 			RepositoryException {
@@ -659,8 +710,7 @@ public class AiravataClient {
 		return inputs;
 	}
 	
-	private List<InputNode> getInputNodes(
-		String workflowTemplateId) throws PathNotFoundException, GraphException, ComponentException, ValueFormatException, RegistryException, RepositoryException{
+	private List<InputNode> getInputNodes(String workflowTemplateId) throws PathNotFoundException, GraphException, ComponentException, ValueFormatException, RegistryException, RepositoryException{
 		Workflow workflow = getWorkflow(workflowTemplateId);
 		return getInputNodes(workflow);
 	}
@@ -685,7 +735,7 @@ public class AiravataClient {
 
 	public static void main(String[] args) throws Exception {
 		HashMap<String, String> config = new HashMap<String,String>();
-		AiravataClient airavataClient = new AiravataClient(config);
+		AiravataAPI airavataClient = new AiravataClient(config);
 		String workflowName = "Workflow1";
 		List<WorkflowInput> workflowInputs = airavataClient.getWorkflowInputs(workflowName);
 		workflowInputs.get(0).setValue("hi");
@@ -693,4 +743,40 @@ public class AiravataClient {
 		System.out.println(topicId);
 	}
 
+	@Override
+	public AiravataManager getAiravataManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ApplicationManager getApplicationManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowManager getWorkflowManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ProvenanceManager getProvenanceManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public UserManager getUserManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ExecutionManager getExecutionManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 }

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPI.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPI.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPI.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPI.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,150 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Properties;
+
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+
+import org.apache.airavata.client.airavata.AiravataClientConfiguration;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+import org.apache.airavata.xbaya.interpretor.NameValue;
+import org.apache.airavata.xbaya.monitor.Monitor;
+import org.apache.airavata.xbaya.monitor.MonitorEventListener;
+
+public interface AiravataAPI {
+
+	public abstract void loadWorkflowFromaFile(String workflowFile)
+			throws URISyntaxException, IOException;
+
+	public abstract void loadWorkflowasaString(String workflowAsaString);
+
+	public abstract NameValue[] setInputs(String fileName) throws IOException;
+
+	public abstract void setInputs(Properties inputList);
+
+	public abstract String runWorkflow(String topic);
+
+	public abstract String runWorkflow(String topic, String user);
+
+	public abstract String runWorkflow(String topic, String user,
+			String metadata);
+
+	public abstract Monitor getWorkflowExecutionMonitor(String topic);
+
+	public abstract Monitor getWorkflowExecutionMonitor(String topic,
+			MonitorEventListener listener);
+
+	public abstract String runWorkflow(String topic, NameValue[] inputs)
+			throws Exception;
+
+	public abstract String runWorkflow(String topic, NameValue[] inputs,
+			String user) throws Exception;
+
+	public abstract String runWorkflow(final String topic,
+			final NameValue[] inputs, final String user, final String metadata)
+			throws Exception;
+
+	public abstract List<WorkflowExecution> getWorkflowExecutionDataByUser(
+			String user) throws RegistryException;
+
+	public abstract WorkflowExecution getWorkflowExecutionData(String topic)
+			throws RegistryException;
+
+	/**
+	 * 
+	 * @param user
+	 * @param pageSize
+	 *            - number of executions to return (page size)
+	 * @param PageNo
+	 *            - which page to return to (>=0)
+	 * @return
+	 * @throws RegistryException
+	 */
+	public abstract List<WorkflowExecution> getWorkflowExecutionData(
+			String user, int pageSize, int PageNo) throws RegistryException;
+
+	public abstract AiravataRegistry getRegistry();
+
+	public abstract AiravataClientConfiguration getClientConfiguration();
+
+	/**
+	 * Retrieve the names of the workflow templates saved in the registry
+	 * @return
+	 */
+	public abstract List<String> getWorkflowTemplateIds();
+
+	/**
+	 * Execute the given workflow template with the given inputs and return the topic id 
+	 * @param workflowTemplateId
+	 * @param inputs
+	 * @return
+	 */
+	public abstract String runWorkflow(String workflowTemplateId,
+			List<WorkflowInput> inputs) throws Exception;
+
+	/**
+	 * Execute the given workflow template with the given inputs, user, metadata and return the topic id
+	 * @param workflowTemplateId
+	 * @param inputs
+	 * @param user
+	 * @param metadata
+	 * @return
+	 * @throws Exception
+	 */
+	public abstract String runWorkflow(String workflowTemplateId,
+			List<WorkflowInput> inputs, String user, String metadata)
+			throws Exception;
+
+	/**
+	 * Retrieve the inputs for the given workflow template
+	 * @param workflowTemplateId
+	 * @return
+	 */
+	public abstract List<WorkflowInput> getWorkflowInputs(
+			String workflowTemplateId) throws Exception;
+
+	public abstract Property getWorkflowAsString(String workflowTemplateId)
+			throws RegistryException, PathNotFoundException,
+			RepositoryException;
+	
+	public AiravataManager getAiravataManager();
+	
+	public ApplicationManager getApplicationManager();
+	
+	public WorkflowManager getWorkflowManager();
+	
+	public ProvenanceManager getProvenanceManager();
+	
+	public UserManager getUserManager();
+	
+	public ExecutionManager getExecutionManager();
+
+}
\ No newline at end of file

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPIInvocationException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPIInvocationException.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPIInvocationException.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataAPIInvocationException.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,32 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+public class AiravataAPIInvocationException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+	
+	public AiravataAPIInvocationException(Throwable e) {
+		super("Error invoking API", e);
+	}
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/AiravataManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,46 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.net.URI;
+import java.util.List;
+
+public interface AiravataManager {
+	public List<URI> getGFaCURLs() throws AiravataAPIInvocationException;
+	public URI getGFaCURL() throws AiravataAPIInvocationException;
+	public URI getGFaCURL(URI defaultURL) throws AiravataAPIInvocationException;
+	
+	public List<URI> getWorkflowInterpreterServiceURLs() throws AiravataAPIInvocationException;
+	public URI getWorkflowInterpreterServiceURL() throws AiravataAPIInvocationException;
+	public URI getWorkflowInterpreterServiceURL(URI defaultURL) throws AiravataAPIInvocationException;
+	
+	public List<URI> getMessageBoxServiceURLs() throws AiravataAPIInvocationException;
+	public URI getMessageBoxServiceURL() throws AiravataAPIInvocationException;
+	public URI getMessageBoxServiceURL(URI defaultURL) throws AiravataAPIInvocationException;
+	
+	public List<URI> getEventingServiceURLs() throws AiravataAPIInvocationException;
+	public URI getEventingServiceURL() throws AiravataAPIInvocationException;
+	public URI getEventingServiceURL(URI defaultURL) throws AiravataAPIInvocationException;
+	
+	public URI getRegistryURL() throws AiravataAPIInvocationException;
+	public URI getRegistryURL(URI defaultURL) throws AiravataAPIInvocationException;
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+
+public interface ApplicationManager {
+	//Service descriptors
+	public ServiceDescription getServiceDescription(String serviceId) throws AiravataAPIInvocationException;
+    public List<ServiceDescription> getAllServiceDescriptions() throws AiravataAPIInvocationException;
+    public String saveServiceDescription(ServiceDescription service)throws AiravataAPIInvocationException;
+    public void deleteServiceDescription(String serviceId) throws AiravataAPIInvocationException;
+    public List<ServiceDescription> searchServiceDescription(String nameRegEx) throws AiravataAPIInvocationException;
+
+    //Application descriptors
+    public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId)throws AiravataAPIInvocationException;
+    public String saveDeploymentDescription(String serviceId, String hostId, ApplicationDeploymentDescription app)throws AiravataAPIInvocationException;
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName)throws AiravataAPIInvocationException;
+    public Map<ApplicationDeploymentDescription, String> getAllDeploymentDescriptions() throws AiravataAPIInvocationException;
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName,String applicationName) throws AiravataAPIInvocationException;
+    public Map<HostDescription, List<ApplicationDeploymentDescription>> searchDeploymentDescription(String serviceName)throws AiravataAPIInvocationException;
+    public void deleteDeploymentDescription(String serviceName, String hostName, String applicationName)throws AiravataAPIInvocationException;
+    
+    //Host descriptors
+    public HostDescription getHostDescription(String hostId) throws AiravataAPIInvocationException;
+    public List<HostDescription> getAllHostDescriptions() throws AiravataAPIInvocationException;
+    public String saveHostDescription(HostDescription host)throws AiravataAPIInvocationException;
+    public List<HostDescription> searchHostDescription(String regExName) throws AiravataAPIInvocationException;
+    public void deleteHostDescription(String hostId) throws AiravataAPIInvocationException;
+    
+    public boolean deployServiceOnHost(String serviceName, String hostName)throws AiravataAPIInvocationException;
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,45 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+import org.apache.airavata.xbaya.monitor.Monitor;
+import org.apache.airavata.xbaya.monitor.MonitorEventListener;
+
+public interface ExecutionManager {
+
+	public abstract String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs) throws AiravataAPIInvocationException;
+
+	public abstract String runWorkflow(Workflow workflow,List<WorkflowInput> inputs) throws AiravataAPIInvocationException;
+	
+	public abstract String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata)throws AiravataAPIInvocationException;
+	
+	public abstract String runWorkflow(Workflow workflow,List<WorkflowInput> inputs, String user, String metadata)throws AiravataAPIInvocationException;
+	
+	public Monitor getWorkflowExecutionMonitor(String topic)throws AiravataAPIInvocationException;
+
+	public Monitor getWorkflowExecutionMonitor(String topic, MonitorEventListener listener) throws AiravataAPIInvocationException;
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,106 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.util.List;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceUser;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+
+public interface ProvenanceManager {
+	
+	//Instance Node data
+	public void addWorkflowInstanceNodeInputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
+	
+	public void addWorkflowInstanceNodeInputData(String experimentId, String topicId, String nodeId, String data) throws AiravataAPIInvocationException;
+	
+	public void addWorkflowInstanceNodeOutputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
+	
+	public void addWorkflowInstanceNodeOutputData(String experimentId, String topicId, String nodeId, String data) throws AiravataAPIInvocationException;
+	
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
+	
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(String experimentId, String topicId, String nodeId) throws AiravataAPIInvocationException;
+	
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
+	
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(String experimentId, String topicId, String nodeId) throws AiravataAPIInvocationException;
+	
+	//Instance Status
+	public void setWorkflowInstanceStatus(String experimentId, String topicId, ExecutionStatus status) throws AiravataAPIInvocationException;
+	
+	public void setWorkflowInstanceStatus(WorkflowInstanceStatus status) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceStatus getWorkflowInstanceStatus(String experimentId, String topicId) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceStatus getWorkflowInstanceStatus(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	
+	//Instance User
+	public void setWorkflowInstanceUser(String experimentId, String topicId, String user) throws AiravataAPIInvocationException;
+	
+	public void setWorkflowInstanceUser(WorkflowInstanceUser user) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceUser getWorkflowInstanceUser(String experimentId, String topicId) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceUser getWorkflowInstanceUser(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	
+	//Instance Metadata
+	public void setWorkflowInstanceMetadata(String experimentId, String topicId, String metadata) throws AiravataAPIInvocationException;
+	
+	public void setWorkflowInstanceMetadata(WorkflowInstanceMetadata instanceMetadata) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(String experimentId, String topicId) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	
+	
+
+	//General
+	public List<String> getExperiments() throws AiravataAPIInvocationException;
+	
+	public List<WorkflowInstance> getWorkflowInstances() throws AiravataAPIInvocationException;
+
+	public List<WorkflowInstance> getWorkflowInstances(String user) throws AiravataAPIInvocationException;
+
+	public List<WorkflowInstance> getWorkflowInstances(String user, int pageSize, int pageNo) throws AiravataAPIInvocationException;
+
+	public WorkflowInstanceData getWorkflowInstanceData(String experimentId, String topicId) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceData getWorkflowInstanceData(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+
+
+	
+	public String[] getWorkflowExecutionOutputNames(String exeperimentId) throws RegistryException;
+
+    
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/UserManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/UserManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/UserManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+public interface UserManager {
+
+		public String getAiravataUser();
+	
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowManager.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowManager.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowManager.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.api;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+
+public interface WorkflowManager {
+
+	//privilledged API
+	public boolean saveWorkflow(String workflowAsString, String owner) throws AiravataAPIInvocationException;
+	
+    public boolean saveWorkflow(Workflow workflow, String owner) throws AiravataAPIInvocationException;
+
+    public List<Workflow> getWorkflows(String owner) throws AiravataAPIInvocationException;
+    
+    public List<String> getWorkflowTemplateIds(String owner) throws AiravataAPIInvocationException;
+
+    public Workflow getWorkflow(String workflowName, String owner) throws AiravataAPIInvocationException;
+
+    public String getWorkflowAsString(String workflowName, String owner) throws AiravataAPIInvocationException;
+
+    public boolean deleteWorkflow(String workflowName, String owner) throws AiravataAPIInvocationException;
+    
+    //user api
+	public boolean saveWorkflow(String workflowAsString) throws AiravataAPIInvocationException;
+
+	public boolean saveWorkflowAsPublic(String workflowAsString) throws AiravataAPIInvocationException;
+	
+    public boolean saveWorkflow(Workflow workflow) throws AiravataAPIInvocationException;
+    
+    public boolean saveWorkflowAsPublic(Workflow workflow) throws AiravataAPIInvocationException;
+
+    public List<Workflow> getWorkflows() throws AiravataAPIInvocationException;
+    
+    public List<String> getWorkflowTemplateIds() throws AiravataAPIInvocationException;
+
+    public Workflow getWorkflow(String workflowName) throws AiravataAPIInvocationException;
+
+    public String getWorkflowAsString(String workflowName) throws AiravataAPIInvocationException;
+
+    public boolean deleteWorkflow(String workflowName) throws AiravataAPIInvocationException;
+    
+    public Workflow getWorkflowFromString(String workflowAsString) throws AiravataAPIInvocationException;
+    
+    public String getWorkflowAsString(Workflow workflow) throws AiravataAPIInvocationException;
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/AiravataManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/AiravataManagerImpl.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/AiravataManagerImpl.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/AiravataManagerImpl.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,189 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.client.airavata.AiravataClient;
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.AiravataManager;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class AiravataManagerImpl implements AiravataManager {
+	private AiravataClient client;
+	
+	public AiravataManagerImpl(AiravataClient client) {
+		setClient(client);
+	}
+	
+	@Override
+	public List<URI> getGFaCURLs()  throws AiravataAPIInvocationException{
+		List<URI> list=new ArrayList<URI>();
+		try {
+			List<String> gFacDescriptorList = getClient().getRegistry().getGFacDescriptorList();
+			for (String urlString : gFacDescriptorList) {
+				try {
+					list.add(new URI(urlString));
+				} catch (URISyntaxException e) {
+					e.printStackTrace();
+				}
+			}
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+		return list;
+	}
+
+	@Override
+	public URI getGFaCURL()  throws AiravataAPIInvocationException{
+		try {
+			return getClient().getClientConfiguration().getGfacURL().toURI();
+		} catch (URISyntaxException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getGFaCURL(URI defaultURL)  throws AiravataAPIInvocationException{
+		if (getGFaCURL()==null){
+			return defaultURL;	
+		}
+		return getGFaCURL();
+	}
+
+	@Override
+	public List<URI> getWorkflowInterpreterServiceURLs()  throws AiravataAPIInvocationException{
+		try {
+			return getClient().getRegistry().getInterpreterServiceURLList();
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+
+
+	public AiravataClient getClient() {
+		return client;
+	}
+
+	public void setClient(AiravataClient client) {
+		this.client = client;
+	}
+
+	@Override
+	public URI getWorkflowInterpreterServiceURL()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getClientConfiguration().getXbayaServiceURL().toURI();
+		} catch (URISyntaxException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getWorkflowInterpreterServiceURL(URI defaultURL)
+			throws AiravataAPIInvocationException {
+		if (getWorkflowInterpreterServiceURL()==null){
+			return defaultURL;	
+		}
+		return getWorkflowInterpreterServiceURL();
+		
+	}
+
+	@Override
+	public List<URI> getMessageBoxServiceURLs()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getMessageBoxServiceURLList();
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getMessageBoxServiceURL() throws AiravataAPIInvocationException {
+		try {
+			return getClient().getClientConfiguration().getMessageboxURL().toURI();
+		} catch (URISyntaxException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getMessageBoxServiceURL(URI defaultURL)
+			throws AiravataAPIInvocationException {
+		if (getMessageBoxServiceURL()==null){
+			return defaultURL;	
+		}
+		return getMessageBoxServiceURL();
+	}
+
+	@Override
+	public List<URI> getEventingServiceURLs()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getEventingServiceURLList();
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getEventingServiceURL() throws AiravataAPIInvocationException {
+		try {
+			return getClient().getClientConfiguration().getMessagebrokerURL().toURI();
+		} catch (URISyntaxException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getEventingServiceURL(URI defaultURL)
+			throws AiravataAPIInvocationException {
+		if (getEventingServiceURL()==null){
+			return defaultURL;	
+		}
+		return getEventingServiceURL();
+	}
+
+	@Override
+	public URI getRegistryURL() throws AiravataAPIInvocationException {
+		try {
+			return getClient().getClientConfiguration().getJcrURL().toURI();
+		} catch (URISyntaxException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public URI getRegistryURL(URI defaultURL)
+			throws AiravataAPIInvocationException {
+		if (getRegistryURL()==null){
+			return defaultURL;	
+		}
+		return getRegistryURL();
+	}
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,236 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.client.airavata.AiravataClient;
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.ApplicationManager;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+
+public class ApplicationManagerImpl implements ApplicationManager {
+	private AiravataClient client;
+	
+	public ApplicationManagerImpl(AiravataClient client) {
+		setClient(client);
+	}
+	
+	@Override
+	public ServiceDescription getServiceDescription(String serviceId)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getServiceDescription(serviceId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<ServiceDescription> getAllServiceDescriptions()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchServiceDescription(".*");
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public String saveServiceDescription(ServiceDescription service)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().saveServiceDescription(service);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public void deleteServiceDescription(String serviceId)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().deleteServiceDescription(serviceId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+
+	}
+
+	@Override
+	public List<ServiceDescription> searchServiceDescription(String nameRegEx)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchServiceDescription(nameRegEx);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public ApplicationDeploymentDescription getDeploymentDescription(
+			String serviceId, String hostId)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getDeploymentDescription(serviceId, hostId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public String saveDeploymentDescription(String serviceId, String hostId,
+			ApplicationDeploymentDescription app)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().saveDeploymentDescription(serviceId, hostId, app);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<ApplicationDeploymentDescription> searchDeploymentDescription(
+			String serviceName, String hostName)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchDeploymentDescription(serviceName, hostName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public Map<ApplicationDeploymentDescription, String> getAllDeploymentDescriptions()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchDeploymentDescription();
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<ApplicationDeploymentDescription> searchDeploymentDescription(
+			String serviceName, String hostName, String applicationName)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchDeploymentDescription(serviceName, hostName, applicationName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public Map<HostDescription, List<ApplicationDeploymentDescription>> searchDeploymentDescription(
+			String serviceName) throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchDeploymentDescription(serviceName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public void deleteDeploymentDescription(String serviceName,
+			String hostName, String applicationName)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().deleteDeploymentDescription(serviceName, hostName, applicationName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public HostDescription getHostDescription(String hostId)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getHostDescription(hostId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<HostDescription> getAllHostDescriptions()
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchHostDescription(".*");
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public String saveHostDescription(HostDescription host)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().saveHostDescription(host);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<HostDescription> searchHostDescription(String regExName)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().searchHostDescription(regExName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public void deleteHostDescription(String hostId)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().deleteHostDescription(hostId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public boolean deployServiceOnHost(String serviceName, String hostName)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().deployServiceOnHost(serviceName, hostName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	public AiravataClient getClient() {
+		return client;
+	}
+
+	public void setClient(AiravataClient client) {
+		this.client = client;
+	}
+
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,246 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import java.util.List;
+
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.ProvenanceManager;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceUser;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
+
+public class ProvenanceManagerImpl implements ProvenanceManager {
+
+	@Override
+	public void addWorkflowInstanceNodeInputData(
+			WorkflowInstanceNodePortData data)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void addWorkflowInstanceNodeInputData(String experimentId,
+			String topicId, String nodeId, String data)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void addWorkflowInstanceNodeOutputData(
+			WorkflowInstanceNodePortData data)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void addWorkflowInstanceNodeOutputData(String experimentId,
+			String topicId, String nodeId, String data)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(
+			WorkflowInstanceNode node) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(
+			String experimentId, String topicId, String nodeId)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(
+			WorkflowInstanceNode node) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(
+			String experimentId, String topicId, String nodeId)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void setWorkflowInstanceStatus(String experimentId, String topicId,
+			ExecutionStatus status) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setWorkflowInstanceStatus(WorkflowInstanceStatus status)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public WorkflowInstanceStatus getWorkflowInstanceStatus(
+			String experimentId, String topicId)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowInstanceStatus getWorkflowInstanceStatus(
+			WorkflowInstance workflowInstance)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void setWorkflowInstanceUser(String experimentId, String topicId,
+			String user) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setWorkflowInstanceUser(WorkflowInstanceUser user)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public WorkflowInstanceUser getWorkflowInstanceUser(String experimentId,
+			String topicId) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowInstanceUser getWorkflowInstanceUser(
+			WorkflowInstance workflowInstance)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void setWorkflowInstanceMetadata(String experimentId,
+			String topicId, String metadata)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setWorkflowInstanceMetadata(
+			WorkflowInstanceMetadata instanceMetadata)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(
+			String experimentId, String topicId)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(
+			WorkflowInstance workflowInstance)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<String> getExperiments() throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstance> getWorkflowInstances()
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstance> getWorkflowInstances(String user)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<WorkflowInstance> getWorkflowInstances(String user,
+			int pageSize, int pageNo) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowInstanceData getWorkflowInstanceData(String experimentId,
+			String topicId) throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public WorkflowInstanceData getWorkflowInstanceData(
+			WorkflowInstance workflowInstance)
+			throws AiravataAPIInvocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String[] getWorkflowExecutionOutputNames(String exeperimentId)
+			throws RegistryException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	
+}

Added: incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java?rev=1352790&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java (added)
+++ incubator/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowManagerImpl.java Fri Jun 22 07:49:26 2012
@@ -0,0 +1,214 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.ValueFormatException;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.airavata.AiravataClient;
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.WorkflowManager;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.wf.Workflow;
+
+public class WorkflowManagerImpl implements WorkflowManager {
+	private AiravataClient client;
+    private static final String OGCE_WORKFLOW_NS = "http://workflow.ogce.org/";
+
+	public WorkflowManagerImpl(AiravataClient client) {
+		setClient(client);
+	}
+	
+	public AiravataClient getClient() {
+		return client;
+	}
+
+	public void setClient(AiravataClient client) {
+		this.client = client;
+	}
+
+	private String getWorkflowStringFromNode(Node node) throws ValueFormatException, IllegalStateException, PathNotFoundException, RepositoryException{
+		return node.getProperty("workflow").getValue().getString();
+	}
+	
+	@Override
+	public boolean saveWorkflow(String workflowAsString, String owner)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(getWorkflowFromString(workflowAsString), workflowAsString, owner);
+	}
+
+	@Override
+	public boolean saveWorkflow(Workflow workflow, String owner)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner);
+	}
+	
+	private boolean saveWorkflow(Workflow workflow, String workflowAsString,String owner)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().saveWorkflow(new QName(OGCE_WORKFLOW_NS,StringUtil.convertToJavaIdentifier(workflow.getName())), workflow.getName(), workflow.getDescription(), workflowAsString, owner, owner==null? true:false);
+			return true;
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<Workflow> getWorkflows(String owner)
+			throws AiravataAPIInvocationException {
+		try {
+			List<Workflow> workflows=new ArrayList<Workflow>();
+			Map<QName, Node> workflowMap = getClient().getRegistry().getWorkflows(owner);
+			for(Node node:workflowMap.values()){
+				workflows.add(getWorkflowFromString(getWorkflowStringFromNode(node)));
+			}
+			return workflows;
+		} catch (Exception e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<String> getWorkflowTemplateIds(String owner)
+			throws AiravataAPIInvocationException {
+		try {
+			List<String> workflowList = new ArrayList<String>();
+			Map<QName, Node> workflows;
+			workflows = getClient().getRegistry().getWorkflows(owner);
+			for (QName qname : workflows.keySet()) {
+				workflowList.add(qname.getLocalPart());
+			}
+			return workflowList;
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public Workflow getWorkflow(String workflowName, String owner)
+			throws AiravataAPIInvocationException {
+		return getWorkflowFromString(getWorkflowAsString(workflowName, owner));
+	}
+
+	@Override
+	public String getWorkflowAsString(String workflowName, String owner)
+			throws AiravataAPIInvocationException {
+		try {
+			return getWorkflowStringFromNode(getClient().getRegistry().getWorkflow(new QName(workflowName), owner));
+		} catch (Exception e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public boolean deleteWorkflow(String workflowName, String owner)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().deleteWorkflow(new QName(workflowName), owner);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public boolean saveWorkflow(String workflowAsString)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(workflowAsString, getCurrentUser());
+	}
+
+	@Override
+	public boolean saveWorkflowAsPublic(String workflowAsString)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(workflowAsString, null);
+	}
+
+	@Override
+	public boolean saveWorkflow(Workflow workflow)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(workflow, getCurrentUser());
+	}
+
+	private String getCurrentUser() {
+		return getClient().getUserManager().getAiravataUser();
+	}
+
+	@Override
+	public boolean saveWorkflowAsPublic(Workflow workflow)
+			throws AiravataAPIInvocationException {
+		return saveWorkflow(workflow, null);
+	}
+
+	@Override
+	public List<Workflow> getWorkflows() throws AiravataAPIInvocationException {
+		return getWorkflows(getCurrentUser());
+	}
+
+	@Override
+	public List<String> getWorkflowTemplateIds()
+			throws AiravataAPIInvocationException {
+		return getWorkflowTemplateIds(getCurrentUser());
+	}
+
+	@Override
+	public Workflow getWorkflow(String workflowName)
+			throws AiravataAPIInvocationException {
+		return getWorkflow(workflowName, getCurrentUser());
+	}
+
+	@Override
+	public String getWorkflowAsString(String workflowName)
+			throws AiravataAPIInvocationException {
+		return getWorkflowAsString(workflowName, getCurrentUser());
+	}
+
+	@Override
+	public boolean deleteWorkflow(String workflowName)
+			throws AiravataAPIInvocationException {
+		return deleteWorkflow(workflowName, getCurrentUser());
+	}
+
+	@Override
+	public Workflow getWorkflowFromString(String workflowAsString)
+			throws AiravataAPIInvocationException {
+		try {
+			return new Workflow(workflowAsString);
+		} catch (Exception e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public String getWorkflowAsString(Workflow workflow)
+			throws AiravataAPIInvocationException {
+		return XMLUtil.xmlElementToString(workflow.toXML());
+	}
+
+}

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java?rev=1352790&r1=1352789&r2=1352790&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java Fri Jun 22 07:49:26 2012
@@ -35,12 +35,14 @@ import org.apache.airavata.common.regist
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.WorkflowExecutionStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.exception.DeploymentDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.HostDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
 import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 
 public interface AiravataRegistry extends Registry{
     /**
@@ -243,11 +245,11 @@ public interface AiravataRegistry extend
 
     public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx)throws RegistryException;
 
-    public boolean saveWorkflowExecutionStatus(String experimentId,WorkflowExecutionStatus status)throws RegistryException;
+    public boolean saveWorkflowExecutionStatus(String experimentId,WorkflowInstanceStatus status)throws RegistryException;
     
     public boolean saveWorkflowExecutionStatus(String experimentId,ExecutionStatus status)throws RegistryException;
 
-    public WorkflowExecutionStatus getWorkflowExecutionStatus(String experimentId)throws RegistryException;
+    public WorkflowInstanceStatus getWorkflowExecutionStatus(String experimentId)throws RegistryException;
 
     public boolean saveWorkflowExecutionOutput(String experimentId,String outputNodeName,String output) throws RegistryException;
     

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1352790&r1=1352789&r2=1352790&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java Fri Jun 22 07:49:26 2012
@@ -53,13 +53,14 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.wsdl.WSDLGenerator;
 import org.apache.airavata.registry.api.Axis2Registry;
 import org.apache.airavata.registry.api.DataRegistry;
-import org.apache.airavata.registry.api.WorkflowExecution;
-import org.apache.airavata.registry.api.WorkflowExecutionStatus;
-import org.apache.airavata.registry.api.WorkflowExecutionStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.exception.DeploymentDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.HostDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 import org.apache.airavata.schemas.gfac.MethodType;
 import org.apache.airavata.schemas.gfac.PortTypeType;
@@ -76,7 +77,7 @@ public class AiravataJCRRegistry extends
     private static final String WORKFLOW_INTERPRETER_INSTANCE_DATA = "WORKFLOW_INTERPRETER_INSTANCE_DATA";
     private static final String MESSAGE_BOX_INSTANCE_DATA = "MESSAGE_BOX_INSTANCE_DATA";
     private static final String EVENTING_INSTANCE_DATA = "EVENTING_INSTANCE_DATA";
-    private static final String METADATA_NODE = "METADATA";
+    private static final String AIRAVATA_CONFIG_NODE = "AIRAVATA_CONFIGURATION_DATA";
     private static final String DEPLOY_NODE_NAME = "APP_HOST";
     private static final String HOST_NODE_NAME = "GFAC_HOST";
     private static final String XML_PROPERTY_NAME = "XML";
@@ -606,7 +607,7 @@ public class AiravataJCRRegistry extends
     }
 
     private Node getMetadataNode(Session session) throws RepositoryException{
-        return getOrAddNode(getRootNode(session), METADATA_NODE);
+        return getOrAddNode(getRootNode(session), AIRAVATA_CONFIG_NODE);
     }
     
     public boolean saveGFacDescriptor(String gfacURL) throws RegistryException{
@@ -902,7 +903,7 @@ public class AiravataJCRRegistry extends
         return workflowIODataList;
     }
 
-    public boolean saveWorkflowExecutionStatus(String experimentId,WorkflowExecutionStatus status)throws RegistryException{
+    public boolean saveWorkflowExecutionStatus(String experimentId,WorkflowInstanceStatus status)throws RegistryException{
         Session session = null;
         boolean isSaved = true;
         try {
@@ -925,9 +926,9 @@ public class AiravataJCRRegistry extends
         return isSaved;
     }
 
-    public WorkflowExecutionStatus getWorkflowExecutionStatus(String experimentId)throws RegistryException{
+    public WorkflowInstanceStatus getWorkflowExecutionStatus(String experimentId)throws RegistryException{
     	Session session = null;
-    	WorkflowExecutionStatus property = null;
+    	WorkflowInstanceStatus property = null;
         try {
             session = getSession();
             Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
@@ -948,7 +949,7 @@ public class AiravataJCRRegistry extends
 					date = cal.getTime();
 				}
 			}
-			property=new WorkflowExecutionStatus(status, date);
+			property=new WorkflowInstanceStatus(new WorkflowInstance(experimentId,experimentId),status, date);
             session.save();
         } catch (Exception e) {
             throw new RegistryException("Error while retrieving workflow execution status!!!", e);
@@ -1048,14 +1049,14 @@ public class AiravataJCRRegistry extends
         }
         return matchList;
     }
-    public Map<String, WorkflowExecutionStatus> getWorkflowExecutionStatusWithRegex(String regex) throws RegistryException {
+    public Map<String, WorkflowInstanceStatus> getWorkflowExecutionStatusWithRegex(String regex) throws RegistryException {
         Session session=null;
-        Map<String,WorkflowExecutionStatus> workflowStatusMap = new HashMap<String, WorkflowExecutionStatus>();
+        Map<String,WorkflowInstanceStatus> workflowStatusMap = new HashMap<String, WorkflowInstanceStatus>();
         try {
             session = getSession();
             List<String> matchingExperimentIds = getMatchingExperimentIds(regex, session);
             for(String experimentId:matchingExperimentIds){
-                WorkflowExecutionStatus workflowStatus = getWorkflowExecutionStatus(experimentId);
+                WorkflowInstanceStatus workflowStatus = getWorkflowExecutionStatus(experimentId);
                 workflowStatusMap.put(experimentId,workflowStatus);
             }
 		} catch (RepositoryException e) {
@@ -1259,10 +1260,9 @@ public class AiravataJCRRegistry extends
 
 	public boolean saveWorkflowExecutionStatus(String experimentId,
 			ExecutionStatus status) throws RegistryException {
-		return saveWorkflowExecutionStatus(experimentId,new WorkflowExecutionStatus(status));
+		return saveWorkflowExecutionStatus(experimentId,new WorkflowInstanceStatus(new WorkflowInstance(experimentId, experimentId), status));
 	}
 
-
 	private void saveServiceURL(URI gfacURL, String nodeName)
 			throws Exception {
 		java.util.Date today = Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime();

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java?rev=1352790&r1=1352789&r2=1352790&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java Fri Jun 22 07:49:26 2012
@@ -24,13 +24,13 @@ package org.apache.airavata.registry.api
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.airavata.registry.api.WorkflowExecution;
-import org.apache.airavata.registry.api.WorkflowExecutionStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
 import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 
 public class WorkflowExecutionImpl implements WorkflowExecution{
-	private WorkflowExecutionStatus executionStatus;
+	private WorkflowInstanceStatus executionStatus;
 	private String user;
 	private List<WorkflowServiceIOData> serviceInput;
 	private List<WorkflowServiceIOData> serviceOutput;
@@ -56,10 +56,10 @@ public class WorkflowExecutionImpl imple
 	public void setTopic(String topic) {
 		this.experimentId = topic;
 	}
-	public WorkflowExecutionStatus getExecutionStatus() {
+	public WorkflowInstanceStatus getExecutionStatus() {
 		return executionStatus;
 	}
-	public void setExecutionStatus(WorkflowExecutionStatus executionStatus) {
+	public void setExecutionStatus(WorkflowInstanceStatus executionStatus) {
 		this.executionStatus = executionStatus;
 	}
 	public String getUser() {



Mime
View raw message