airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1421525 - in /airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api: impl/ workflow/
Date Thu, 13 Dec 2012 20:59:44 GMT
Author: samindaw
Date: Thu Dec 13 20:59:39 2012
New Revision: 1421525

URL: http://svn.apache.org/viewvc?rev=1421525&view=rev
Log:
refactor + add getId()

Modified:
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowInstanceDataImpl.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java?rev=1421525&r1=1421524&r2=1421525&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
Thu Dec 13 20:59:39 2012
@@ -22,17 +22,24 @@
 package org.apache.airavata.registry.api.impl;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
-import org.apache.airavata.registry.api.workflow.*;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
 
+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.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode;
+
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement
 public class ExperimentDataImpl implements ExperimentData{
@@ -189,11 +196,32 @@ public class ExperimentDataImpl implemen
 
     @Override
     public void addNodeData(WorkflowInstanceNodeData... nodeData) throws ExperimentLazyLoadedException
{
-        getNodeDataList().addAll(Arrays.asList(nodeData));
+    	getWorkflowInstanceData().get(0).addNodeData(nodeData);
     }
 
     @Override
     public WorkflowInstanceNodeData getNodeData(String nodeId) throws ExperimentLazyLoadedException
{
         return getWorkflowInstanceData().get(0).getNodeData(nodeId);
     }
+
+	@Override
+	public String getId() {
+		return getExperimentId();
+	}
+
+	@Override
+	public List<WorkflowInstanceNodeData> getNodeDataList(WorkflowNode type)
+			throws ExperimentLazyLoadedException {
+		return getWorkflowInstanceData().get(0).getNodeDataList(type);
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowInput() throws ExperimentLazyLoadedException{
+		return getWorkflowInstanceData().get(0).getWorkflowInput();
+	}
+
+	@Override
+	public List<WorkflowInstanceNodePortData> getWorkflowOutput()throws ExperimentLazyLoadedException
{
+		return getWorkflowInstanceData().get(0).getWorkflowOutput();
+	}
 }

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowInstanceDataImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowInstanceDataImpl.java?rev=1421525&r1=1421524&r2=1421525&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowInstanceDataImpl.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowInstanceDataImpl.java
Thu Dec 13 20:59:39 2012
@@ -29,6 +29,7 @@ import java.util.List;
 import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
 import org.apache.airavata.registry.api.workflow.*;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -83,6 +84,9 @@ public class WorkflowInstanceDataImpl im
 		return workflowInstance.getWorkflowInstanceId();
 	}
 
+	/**
+	 * @deprecated Use getId() instead
+	 */
     public String getWorkflowInstanceId(){
         return workflowInstance.getWorkflowInstanceId();
     }
@@ -123,31 +127,38 @@ public class WorkflowInstanceDataImpl im
 	public void setExperimentData(ExperimentDataImpl experimentData) {
 		this.experimentData = experimentData;
 	}
+    public String getId(){
+        return workflowInstance.getWorkflowInstanceId();
+    }
 
     @Override
-    public List<WorkflowInstanceNodePortData> getWorkflowInput(String worklfowInstanceID)
{
+    public List<WorkflowInstanceNodePortData> getWorkflowInput() {
         List<WorkflowInstanceNodePortData> workflowInstanceNodePortDatas = new ArrayList<WorkflowInstanceNodePortData>();
-        for (WorkflowInstanceNodeData workflowInstanceNodeData : getNodeDataList()){
-            if(getWorkflowNodeType(workflowInstanceNodeData, WorkflowNodeType.WorkflowNode.INPUTNODE)){
-                 workflowInstanceNodePortDatas.addAll(workflowInstanceNodeData.getInputData());
-            }
+        for (WorkflowInstanceNodeData workflowInstanceNodeData : getNodeDataList(WorkflowNodeType.WorkflowNode.INPUTNODE)){
+             workflowInstanceNodePortDatas.addAll(workflowInstanceNodeData.getOutputData());
         }
         return workflowInstanceNodePortDatas;
     }
 
-    private boolean getWorkflowNodeType(WorkflowInstanceNodeData workflowInstanceNodeData,
WorkflowNodeType.WorkflowNode nodeType ) {
-        return workflowInstanceNodeData.getType().equals(nodeType);
+    @Override
+    public List<WorkflowInstanceNodeData> getNodeDataList(WorkflowNode type) {
+        List<WorkflowInstanceNodeData> workflowInstanceNodePortDatas = new ArrayList<WorkflowInstanceNodeData>();
+    	for (WorkflowInstanceNodeData workflowInstanceNodeData : getNodeDataList()){
+            if(workflowInstanceNodeData.getType().equals(type)){
+                 workflowInstanceNodePortDatas.add(workflowInstanceNodeData);
+            }
+        }
+        return workflowInstanceNodePortDatas;
     }
-
+    
     @Override
-    public List<WorkflowInstanceNodePortData> getWorkflowOutput(String worklfowInstanceID)
{
+    public List<WorkflowInstanceNodePortData> getWorkflowOutput() {
         List<WorkflowInstanceNodePortData> workflowInstanceNodePortDatas = new ArrayList<WorkflowInstanceNodePortData>();
-        for (WorkflowInstanceNodeData workflowInstanceNodeData : getNodeDataList()){
-            if(getWorkflowNodeType(workflowInstanceNodeData, WorkflowNodeType.WorkflowNode.OUTPUTNODE)){
-                workflowInstanceNodePortDatas.addAll(workflowInstanceNodeData.getInputData());
-            }
+        for (WorkflowInstanceNodeData workflowInstanceNodeData : getNodeDataList(WorkflowNodeType.WorkflowNode.OUTPUTNODE)){
+             workflowInstanceNodePortDatas.addAll(workflowInstanceNodeData.getInputData());
         }
         return workflowInstanceNodePortDatas;
+
     }
 
 }

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java?rev=1421525&r1=1421524&r2=1421525&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
Thu Dec 13 20:59:39 2012
@@ -61,4 +61,5 @@ public interface ExperimentData extends 
 	public void setMetadata(String metadata);
 	public void setExperimentName(String experimentName);
     public WorkflowInstanceData getWorkflowInstance(String workflowInstanceID) throws ExperimentLazyLoadedException;
+    public String getId();
 }

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java?rev=1421525&r1=1421524&r2=1421525&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
Thu Dec 13 20:59:39 2012
@@ -21,6 +21,7 @@ package org.apache.airavata.registry.api
 
 import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
 import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -33,6 +34,7 @@ import java.util.List;
 public interface WorkflowInstanceData {
     public WorkflowInstance getWorkflowInstance() throws ExperimentLazyLoadedException;
     public List<WorkflowInstanceNodeData> getNodeDataList() throws ExperimentLazyLoadedException;
+    public List<WorkflowInstanceNodeData> getNodeDataList(WorkflowNode type)throws
ExperimentLazyLoadedException;
     public void addNodeData(WorkflowInstanceNodeData...nodeData) throws ExperimentLazyLoadedException;
     public WorkflowInstanceNodeData getNodeData(String nodeId) throws ExperimentLazyLoadedException;
     public String getExperimentId();
@@ -42,6 +44,7 @@ public interface WorkflowInstanceData {
     public Date getStatusUpdateTime() throws ExperimentLazyLoadedException;
     public ExperimentDataImpl getExperimentData() throws ExperimentLazyLoadedException;
     public void setExperimentData(ExperimentDataImpl experimentData) throws ExperimentLazyLoadedException;
-    public List<WorkflowInstanceNodePortData> getWorkflowInput (String worklfowInstanceID);
-    public List<WorkflowInstanceNodePortData> getWorkflowOutput (String worklfowInstanceID);
+    public List<WorkflowInstanceNodePortData> getWorkflowInput () throws ExperimentLazyLoadedException;
+    public List<WorkflowInstanceNodePortData> getWorkflowOutput ()throws ExperimentLazyLoadedException;
+    public String getId();
 }

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java?rev=1421525&r1=1421524&r2=1421525&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
Thu Dec 13 20:59:39 2012
@@ -155,4 +155,8 @@ public class WorkflowInstanceNodeData{
     public void setType(WorkflowNodeType.WorkflowNode type) {
         this.type = type;
     }
+    public String getId(){
+    	return getWorkflowInstanceNode().getNodeId();
+    }
+
 }



Mime
View raw message