airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding util methods to create thrift model objects - AIRAVATA-1006
Date Tue, 25 Feb 2014 19:12:21 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 49bb74874 -> 605ffaa27


adding util methods to create thrift model objects - AIRAVATA-1006


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/605ffaa2
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/605ffaa2
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/605ffaa2

Branch: refs/heads/master
Commit: 605ffaa272cd3870bc23211b159b7890f91a00c9
Parents: 49bb748
Author: chathuri <chathuri@apache.org>
Authored: Tue Feb 25 14:12:17 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Tue Feb 25 14:12:17 2014 -0500

----------------------------------------------------------------------
 .../model/util/ExperimentModelUtil.java         | 38 ++++++++++++++++++--
 .../registry/jpa/impl/ExperimentRegistry.java   |  2 --
 2 files changed, 36 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/605ffaa2/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
index 2fd64cd..8e2dda2 100644
--- a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
@@ -42,7 +42,6 @@ public class ExperimentModelUtil {
         experiment.setDescription(expDescription);
         experiment.setApplicationId(applicationId);
         experiment.setExperimentInputs(experimentInputList);
-
         return experiment;
     }
 
@@ -83,7 +82,7 @@ public class ExperimentModelUtil {
         return inputDataHandling;
     }
 
-    public static AdvancedOutputDataHandling createOutputDataHandling(String outputDatadir,
+    public static AdvancedOutputDataHandling createAdvancedOutputDataHandling(String outputDatadir,
                                                                       String dataRegUrl,
                                                                       boolean persistOutput)
{
         AdvancedOutputDataHandling outputDataHandling = new AdvancedOutputDataHandling();
@@ -102,4 +101,39 @@ public class ExperimentModelUtil {
         qosParams.setNumberofRetries(numberOfRetires);
         return qosParams;
     }
+
+    public static TaskDetails cloneTaskFromExperiment (Experiment experiment){
+        TaskDetails taskDetails = new TaskDetails();
+        taskDetails.setCreationTime(experiment.getCreationTime());
+        taskDetails.setApplicationId(experiment.getApplicationId());
+        taskDetails.setApplicationVersion(experiment.getApplicationVersion());
+        List<DataObjectType> experimentInputs = experiment.getExperimentInputs();
+        if (experimentInputs != null){
+            taskDetails.setApplicationInputs(experimentInputs);
+        }
+        UserConfigurationData configData = experiment.getUserConfigurationData();
+        if (configData != null){
+            ComputationalResourceScheduling scheduling = configData.getComputationalResourceScheduling();
+            if (scheduling != null){
+                taskDetails.setTaskScheduling(scheduling);
+            }
+            AdvancedInputDataHandling advanceInputDataHandling = configData.getAdvanceInputDataHandling();
+            if (advanceInputDataHandling != null){
+                taskDetails.setAdvancedInputDataHandling(advanceInputDataHandling);
+            }
+            AdvancedOutputDataHandling outputHandling = configData.getAdvanceOutputDataHandling();
+            if (outputHandling != null){
+                taskDetails.setAdvancedOutputDataHandling(outputHandling);
+            }
+        }
+        return taskDetails;
+    }
+
+    public static WorkflowNodeDetails createWorkflowNode (String nodeName,
+                                                          List<DataObjectType> nodeInputs){
+        WorkflowNodeDetails wfnod = new WorkflowNodeDetails();
+        wfnod.setNodeName(nodeName);
+        wfnod.setNodeInputs(nodeInputs);
+        return wfnod;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/605ffaa2/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 5f39c4f..9704f3e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -27,7 +27,6 @@ import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.Status;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
 import org.apache.airavata.persistance.registry.jpa.utils.ThriftDataModelConversion;
 import org.apache.airavata.registry.cpi.CompositeIdentifier;
@@ -37,7 +36,6 @@ import org.apache.airavata.registry.cpi.utils.StatusType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.xml.crypto.Data;
 import java.sql.Timestamp;
 import java.util.*;
 


Mime
View raw message