airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1394659 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/ airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client/impl/ commons/registry-a...
Date Fri, 05 Oct 2012 17:12:54 GMT
Author: samindaw
Date: Fri Oct  5 17:12:53 2012
New Revision: 1394659

URL: http://svn.apache.org/viewvc?rev=1394659&view=rev
Log:
retrieving experiment meta information only

Added:
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
  (with props)
Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
Fri Oct  5 17:12:53 2012
@@ -716,8 +716,14 @@ public class AiravataClient implements A
 
  	public static void main(String[] args) throws Exception {
 		AiravataAPI api = AiravataClientUtils.getAPI(new URI("http://localhost:8080"), "admin",
"admin");
- 		ProvenanceManager pm = api.getProvenanceManager();
- 		ExperimentData workflowExperimentData = pm.getWorkflowExperimentData("Workflow1_9341caee-b3fc-4474-9b15-b943756a5839");
+		Workflow w = api.getWorkflowManager().getWorkflow("Workflow1");
+		List<WorkflowInput> workflowInputs = w.getWorkflowInputs();
+		for (WorkflowInput input : workflowInputs) {
+			input.setValue("0");
+		}
+		System.out.println(api.getExecutionManager().runExperiment(w,workflowInputs));
+// 		ProvenanceManager pm = api.getProvenanceManager();
+// 		ExperimentData workflowExperimentData = pm.getWorkflowExperimentData("Workflow1_9341caee-b3fc-4474-9b15-b943756a5839");
  		
 // 		pm.getExperimentIdList(owner)
 // 		workflowInstanceData = d.getWorkflowInstanceData().get(0).getNodeDataList();

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
Fri Oct  5 17:12:53 2012
@@ -239,6 +239,10 @@ public interface ProvenanceManager {
      */
 	public List<String> getExperimentIdList(String owner) throws AiravataAPIInvocationException;
 
+	public ExperimentData getExperimentMetaInformation(String experimentId)throws AiravataAPIInvocationException;
+	
+	public List<ExperimentData> getAllExperimentMetaInformation(String user)throws AiravataAPIInvocationException;
+	
     /**
      * Retrieve the id's of all the experiments run by the current user
      * @return
@@ -248,21 +252,28 @@ public interface ProvenanceManager {
 
     /**
      * Retrieve all the experiments run by the current user
+     * @deprecated
      * @return
      * @throws AiravataAPIInvocationException
      */
 	public List<ExperimentData> getWorkflowExperimentDataList() throws AiravataAPIInvocationException;
 
+	public List<ExperimentData> getExperimentDataList() throws AiravataAPIInvocationException;
+	
     /**
      * Retrieve all the experiments run by the given owner
+     * @deprecated
      * @param user
      * @return
      * @throws AiravataAPIInvocationException
      */
 	public List<ExperimentData> getWorkflowExperimentDataList(String user) throws AiravataAPIInvocationException;
+	
+	public List<ExperimentData> getExperimentDataList(String user) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve all the experiment data run by the given owner with paging
+     * @deprecated
      * @param user
      * @param pageSize
      * @param pageNo
@@ -270,9 +281,12 @@ public interface ProvenanceManager {
      * @throws AiravataAPIInvocationException
      */
 	public List<ExperimentData> getWorkflowExperimentData(String user, int pageSize, int
pageNo) throws AiravataAPIInvocationException;
+	
+	public List<ExperimentData> getExperimentData(String user, int pageSize, int pageNo)
throws AiravataAPIInvocationException;
 
 	/**
      * Retrieve all the experiment data run by the given owner with paging
+     * @deprecated
      * @param user
      * @param pageSize
      * @param pageNo
@@ -281,6 +295,8 @@ public interface ProvenanceManager {
      */
 	public ExperimentData getWorkflowExperimentData(String experimentId) throws AiravataAPIInvocationException;
 	
+	public ExperimentData getExperimentData(String experimentId) throws AiravataAPIInvocationException;
+	
     /**
      * Retrieve experiment data for a given workflow instance
      * @param experimentId

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
Fri Oct  5 17:12:53 2012
@@ -398,5 +398,49 @@ public class ProvenanceManagerImpl imple
 		
 	}
 
+	@Override
+	public ExperimentData getExperimentMetaInformation(String experimentId)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getExperimentMetaInformation(experimentId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<ExperimentData> getAllExperimentMetaInformation(String user)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getAllExperimentMetaInformation(user);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public List<ExperimentData> getExperimentDataList()
+			throws AiravataAPIInvocationException {
+		return getWorkflowExperimentDataList();
+	}
+
+	@Override
+	public List<ExperimentData> getExperimentDataList(String user)
+			throws AiravataAPIInvocationException {
+		return getWorkflowExperimentDataList(user);
+	}
+
+	@Override
+	public List<ExperimentData> getExperimentData(String user, int pageSize,
+			int pageNo) throws AiravataAPIInvocationException {
+		return getWorkflowExperimentData(user, pageSize, pageNo);
+	}
+
+	@Override
+	public ExperimentData getExperimentData(String experimentId)
+			throws AiravataAPIInvocationException {
+		return getWorkflowExperimentData(experimentId);
+	}
+
 	
 }

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
(original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
Fri Oct  5 17:12:53 2012
@@ -251,6 +251,10 @@ public interface ProvenanceRegistry exte
      * @throws RegistryException
      */
 	public abstract ExperimentData getExperiment(String experimentId) throws RegistryException;
+	
+	public ExperimentData getExperimentMetaInformation(String experimentId)throws RegistryException;
+	
+	public List<ExperimentData> getAllExperimentMetaInformation(String user)throws RegistryException;
     
     /**
      * Return experiment ids of experiments launched by the given user

Added: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java?rev=1394659&view=auto
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
(added)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
Fri Oct  5 17:12:53 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class ExperimentLazyLoadedException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public ExperimentLazyLoadedException(String experimentId) {
+		super("The experiment "+experimentId+" is lazy loaded by the client!!!");
+	}
+
+}

Propchange: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
(original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
Fri Oct  5 17:12:53 2012
@@ -24,6 +24,7 @@ package org.apache.airavata.registry.api
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
 import org.apache.airavata.registry.api.workflow.ExperimentData;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
@@ -33,14 +34,13 @@ import org.apache.airavata.registry.api.
 public class ExperimentDataImpl implements ExperimentData{
 	private WorkflowInstanceStatus executionStatus;
 	private String user;
-	private List<WorkflowNodeIOData> serviceInput;
-	private List<WorkflowNodeIOData> serviceOutput;
 	private List<WorkflowIOData> output;
 	private String experimentId;
 	private String metadata;
 	private String workflowInstanceName;
 	private List<WorkflowInstanceData> workflowInstanceDataList=new ArrayList<WorkflowInstanceData>();
-			
+	private boolean lazyLoaded=false;
+	
 	public String getMetadata() {
 		return metadata;
 	}
@@ -71,24 +71,6 @@ public class ExperimentDataImpl implemen
 	public void setUser(String user) {
 		this.user = user;
 	}
-	public List<WorkflowNodeIOData> getServiceInput() {
-		if (serviceInput==null){
-			serviceInput=new ArrayList<WorkflowNodeIOData>();
-		}
-		return serviceInput;
-	}
-	public void setServiceInput(List<WorkflowNodeIOData> serviceInput) {
-		this.serviceInput = serviceInput;
-	}
-	public List<WorkflowNodeIOData> getServiceOutput() {
-		if (serviceOutput==null){
-			serviceOutput=new ArrayList<WorkflowNodeIOData>();
-		}
-		return serviceOutput;
-	}
-	public void setServiceOutput(List<WorkflowNodeIOData> serviceOutput) {
-		this.serviceOutput = serviceOutput;
-	}
 	public List<WorkflowIOData> getOutput() {
 		if (output==null){
 			output=new ArrayList<WorkflowIOData>();
@@ -98,23 +80,9 @@ public class ExperimentDataImpl implemen
 	public void setOutput(List<WorkflowIOData> output) {
 		this.output = output;
 	}
-	
-	public void addServiceInput(WorkflowNodeIOData serviceInput) {
-		getServiceInput().add(serviceInput);
-	}
-	public void addServiceOutput(WorkflowNodeIOData serviceOutput) {
-		getServiceOutput().add(serviceOutput);
-	}
 	public void addOutput(WorkflowIOData output) {
 		getOutput().add(output);
 	}
-	
-	public WorkflowNodeIOData getServiceInput(String nodeId) {
-		return (WorkflowNodeIOData)getIOData(nodeId, getServiceInput());
-	}
-	public WorkflowNodeIOData getServiceOutput(String nodeId) {
-		return (WorkflowNodeIOData)getIOData(nodeId, getServiceOutput());
-	}
 	public WorkflowIOData getOutput(String nodeId) {
 		return (WorkflowNodeIOData)getIOData(nodeId, getOutput());
 	}
@@ -141,7 +109,16 @@ public class ExperimentDataImpl implemen
 	}
 	
 	@Override
-	public List<WorkflowInstanceData> getWorkflowInstanceData() {
+	public List<WorkflowInstanceData> getWorkflowInstanceData() throws ExperimentLazyLoadedException{
+		if (isLazyLoaded()){
+			throw new ExperimentLazyLoadedException(getExperimentId());
+		}
 		return workflowInstanceDataList;
 	}
+	public boolean isLazyLoaded() {
+		return lazyLoaded;
+	}
+	public void setLazyLoaded(boolean lazyLoaded) {
+		this.lazyLoaded = lazyLoaded;
+	}
 }

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
(original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
Fri Oct  5 17:12:53 2012
@@ -23,6 +23,8 @@ package org.apache.airavata.registry.api
 
 import java.util.List;
 
+import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
+
 public interface ExperimentData {
 	public String getExperimentId();
 	public String getTopic();
@@ -36,7 +38,7 @@ public interface ExperimentData {
 //	public WorkflowIOData getOutput(String nodeId);
 	public String getMetadata();
 	public String getExperimentName();
-	public List<WorkflowInstanceData> getWorkflowInstanceData();
+	public List<WorkflowInstanceData> getWorkflowInstanceData() throws ExperimentLazyLoadedException;
 	
 	public void setExperimentId(String experimentId);
 	public void setTopic(String topic);

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
(original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
Fri Oct  5 17:12:53 2012
@@ -61,7 +61,15 @@ public class WorkflowInstanceData {
 		return workflowInstance.getWorkflowInstanceId();
 	}
 	
+	/**
+	 * @deprecated Use "WorkflowInstanceData.getTemplateName()" instead
+	 * @return
+	 */
 	public String getWorkflowName(){
+		return getTemplateName();
+	}
+	
+	public String getTemplateName(){
 		return workflowInstance.getTemplateName();
 	}
 	
@@ -81,16 +89,6 @@ public class WorkflowInstanceData {
 		}
 		return null;
 	}
-	
-	public List<WorkflowInstanceNodeData> getInputNodeData(){
-		//TODO
-		return null;
-	}
-	
-	public List<WorkflowInstanceNodeData> getOutputNodeData(){
-		//TODO
-		return null;
-	}
 
 	public ExperimentData getExperimentData() {
 		return experimentData;

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Fri Oct  5 17:12:53 2012
@@ -1351,4 +1351,18 @@ public class AiravataJPARegistry extends
 	}
 
 
+	@Override
+	public ExperimentData getExperimentMetaInformation(String experimentId)
+			throws RegistryException {
+		return null;
+	}
+
+
+	@Override
+	public List<ExperimentData> getAllExperimentMetaInformation(String user)
+			throws RegistryException {
+		return null;
+	}
+
+
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java?rev=1394659&r1=1394658&r2=1394659&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
Fri Oct  5 17:12:53 2012
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.persistance.registry.jpa.resources;
 
+import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
 import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
 import org.apache.airavata.registry.api.workflow.*;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
@@ -91,7 +92,11 @@ public class ExperimentDataRetriever {
                     workflowInstanceNodeData.setOutput(rs.getString(12));
 
                     workflowInstanceData.getNodeDataList().add(workflowInstanceNodeData);
-                    experimentData.getWorkflowInstanceData().add(workflowInstanceData);
+                    try {
+						experimentData.getWorkflowInstanceData().add(workflowInstanceData);
+					} catch (ExperimentLazyLoadedException e) {
+						e.printStackTrace();
+					}
                 }
             }
             if(rs != null){
@@ -248,7 +253,11 @@ public class ExperimentDataRetriever {
                 workflowInstanceNodeData.setOutput(rs.getString(12));
 
                 workflowInstanceData.getNodeDataList().add(workflowInstanceNodeData);
-                experimentData.getWorkflowInstanceData().add(workflowInstanceData);
+                try {
+					experimentData.getWorkflowInstanceData().add(workflowInstanceData);
+				} catch (ExperimentLazyLoadedException e) {
+					e.printStackTrace();
+				}
                 experimentDataList.add(experimentData);
             }
             rs.close();



Mime
View raw message