airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [1/4] adding resources to data models - AIRAVATA-1017
Date Tue, 18 Feb 2014 05:28:13 GMT
Repository: airavata
Updated Branches:
  refs/heads/master b46488d5c -> a584c2c76


http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
new file mode 100644
index 0000000..0db1d72
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/StatusResource.java
@@ -0,0 +1,139 @@
+/*
+ *
+ * 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.persistance.registry.jpa.resources;
+
+import org.apache.airavata.persistance.registry.jpa.Resource;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.model.DataTransferDetail;
+import org.apache.airavata.persistance.registry.jpa.model.WorkflowNodeDetail;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+public class StatusResource extends AbstractResource {
+    private int statusId;
+    private ExperimentResource experimentResource;
+    private WorkflowNodeDetail workflowNodeDetail;
+    private DataTransferDetail dataTransferDetail;
+    private TaskDetailResource taskDetailResource;
+    private String jobId;
+    private String state;
+    private Timestamp statusUpdateTime;
+    private String statusType;
+
+    public int getStatusId() {
+        return statusId;
+    }
+
+    public void setStatusId(int statusId) {
+        this.statusId = statusId;
+    }
+
+    public ExperimentResource getExperimentResource() {
+        return experimentResource;
+    }
+
+    public void setExperimentResource(ExperimentResource experimentResource) {
+        this.experimentResource = experimentResource;
+    }
+
+    public WorkflowNodeDetail getWorkflowNodeDetail() {
+        return workflowNodeDetail;
+    }
+
+    public void setWorkflowNodeDetail(WorkflowNodeDetail workflowNodeDetail) {
+        this.workflowNodeDetail = workflowNodeDetail;
+    }
+
+    public DataTransferDetail getDataTransferDetail() {
+        return dataTransferDetail;
+    }
+
+    public void setDataTransferDetail(DataTransferDetail dataTransferDetail) {
+        this.dataTransferDetail = dataTransferDetail;
+    }
+
+    public TaskDetailResource getTaskDetailResource() {
+        return taskDetailResource;
+    }
+
+    public void setTaskDetailResource(TaskDetailResource taskDetailResource) {
+        this.taskDetailResource = taskDetailResource;
+    }
+
+    public String getJobId() {
+        return jobId;
+    }
+
+    public void setJobId(String jobId) {
+        this.jobId = jobId;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public Timestamp getStatusUpdateTime() {
+        return statusUpdateTime;
+    }
+
+    public void setStatusUpdateTime(Timestamp statusUpdateTime) {
+        this.statusUpdateTime = statusUpdateTime;
+    }
+
+    public String getStatusType() {
+        return statusType;
+    }
+
+    public void setStatusType(String statusType) {
+        this.statusType = statusType;
+    }
+
+    @Override
+    public Resource create(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void remove(ResourceType type, Object name) {
+
+    }
+
+    @Override
+    public Resource get(ResourceType type, Object name) {
+        return null;
+    }
+
+    @Override
+    public List<Resource> get(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void save() {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
new file mode 100644
index 0000000..8b8595d
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/TaskDetailResource.java
@@ -0,0 +1,101 @@
+/*
+ *
+ * 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.persistance.registry.jpa.resources;
+
+import org.apache.airavata.persistance.registry.jpa.Resource;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+public class TaskDetailResource extends AbstractResource {
+    private String taskId;
+    private WorkflowNodeDetailResource workflowNodeDetailResource;
+    private Timestamp creationTime;
+    private String applicationId;
+    private String applicationVersion;
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public WorkflowNodeDetailResource getWorkflowNodeDetailResource() {
+        return workflowNodeDetailResource;
+    }
+
+    public void setWorkflowNodeDetailResource(WorkflowNodeDetailResource workflowNodeDetailResource)
{
+        this.workflowNodeDetailResource = workflowNodeDetailResource;
+    }
+
+    public Timestamp getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Timestamp creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public String getApplicationId() {
+        return applicationId;
+    }
+
+    public void setApplicationId(String applicationId) {
+        this.applicationId = applicationId;
+    }
+
+    public String getApplicationVersion() {
+        return applicationVersion;
+    }
+
+    public void setApplicationVersion(String applicationVersion) {
+        this.applicationVersion = applicationVersion;
+    }
+
+    @Override
+    public Resource create(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void remove(ResourceType type, Object name) {
+
+    }
+
+    @Override
+    public Resource get(ResourceType type, Object name) {
+        return null;
+    }
+
+    @Override
+    public List<Resource> get(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void save() {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index 09b417f..d09adb1 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -268,27 +268,6 @@ public class Utils {
                     logger.error("Object should be a Gateway Worker.", new IllegalArgumentException());
                     throw  new IllegalArgumentException("Object should be a Gateway Worker.");
                 }
-            case EXPERIMENT_METADATA:
-//                if (o instanceof  Experiment_Metadata){
-//                    return createExperimentMetadata((Experiment_Metadata)o);
-//                }else {
-//                    logger.error("Object should be a Experiment MetaData.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Experiment MetaData.");
-//                }
-            case EXPERIMENT_CONFIG_DATA:
-//                if (o instanceof  Experiment_Configuration_Data){
-//                    return createExperimentConfigData((Experiment_Configuration_Data)o);
-//                }else {
-//                    logger.error("Object should be a Experiment Config data.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Experiment Config
data.");
-//                }
-            case EXPERIMENT_SUMMARY:
-//                if (o instanceof  Experiment_Summary){
-//                    return createExperimentSummary((Experiment_Summary)o);
-//                }else {
-//                    logger.error("Object should be a Experiment Summary data.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Experiment Summary
data.");
-//                }
             case EXPERIMENT_INPUT:
 //                if (o instanceof  Experiment_Input){
 //                    return createExperimentInput((Experiment_Input)o);
@@ -303,55 +282,6 @@ public class Utils {
 //                    logger.error("Object should be a Experiment output data.", new IllegalArgumentException());
 //                    throw new IllegalArgumentException("Object should be a Experiment output
data.");
 //                }
-            case WORKFLOW_DATA:
-//                if (o instanceof  Workflow_Data){
-//                    return createWorkflowData((Workflow_Data) o);
-//                }else {
-//                    logger.error("Object should be a Workflow Data.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Workflow Data.");
-//                }
-            case NODE_DATA:
-//                if (o instanceof  Node_Data){
-//                    return createNodeData((Node_Data) o);
-//                }else {
-//                    logger.error("Object should be a Node Data.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Node Data.");
-//                }
-            case GRAM_DATA:
-//                if (o instanceof  Gram_Data){
-//                    return createGramData((Gram_Data) o);
-//                }else {
-//                    logger.error("Object should be a Gram Data.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Gram Data.");
-//                }
-            case EXECUTION_ERROR:
-//                if (o instanceof Execution_Error){
-//                    return createExecutionError((Execution_Error) o);
-//                }else {
-//                    logger.error("Object should be a Node Error type.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a Node Error.");
-//                }
-            case GFAC_JOB_DATA:
-//                if (o instanceof GFac_Job_Data){
-//                    return createGfacJobData((GFac_Job_Data) o);
-//                }else {
-//                    logger.error("Object should be a GFac Job Data type.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a GFac Job Data.");
-//                }
-            case GFAC_JOB_STATUS:
-//                if (o instanceof GFac_Job_Status){
-//                    return createGfacJobStatus((GFac_Job_Status) o);
-//                }else {
-//                    logger.error("Object should be a GFac Job Status type.", new IllegalArgumentException());
-//                    throw new IllegalArgumentException("Object should be a GFac Job Status.");
-//                }
-            case ORCHESTRATOR:
-//            	if(o instanceof Orchestrator){
-//            		return createOrchestratorData((Orchestrator)o);
-//            	}else{
-//            		 logger.error("Object should be orchestrator data.", new IllegalArgumentException());
-//                     throw new IllegalArgumentException("Object should be orchestrator
data.");
-//            	}
             default:
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index 5f5467f..c285876 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -31,8 +31,6 @@ 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.*;
-import org.apache.airavata.persistance.registry.jpa.resources.AbstractResource.GFacJobStatusConstants;
-import org.apache.airavata.persistance.registry.jpa.resources.AbstractResource.WorkflowDataConstants;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -78,12 +76,6 @@ public class WorkerResource extends AbstractResource {
 				userWorkflowResource.setGateway(gateway);
 				result=userWorkflowResource;
                 break;
-            case EXPERIMENT_METADATA:
-//                ExperimentMetadataResource experimentResource = new ExperimentMetadataResource();
-//                experimentResource.setExecutionUser(user);
-//                experimentResource.setGateway(gateway);
-//                result=experimentResource;
-                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for worker
resource.");
@@ -117,18 +109,6 @@ public class WorkerResource extends AbstractResource {
                 q = generator.deleteQuery(em);
 	            q.executeUpdate();
 	            break;
-			case EXPERIMENT_METADATA:
-                generator = new QueryGenerator(EXPERIMENT_METADATA);
-                generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-                q = generator.deleteQuery(em);
-	            q.executeUpdate();
-	            break;
-            case WORKFLOW_DATA:
-                generator = new QueryGenerator(WORKFLOW_DATA);
-                generator.setParameter(WorkflowDataConstants.WORKFLOW_INSTANCE_ID, name);
-                q = generator.deleteQuery(em);
-                q.executeUpdate();
-                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -166,29 +146,6 @@ public class WorkerResource extends AbstractResource {
 	            User_Workflow userWorkflow = (User_Workflow) q.getSingleResult();
                 result= Utils.getResource(ResourceType.USER_WORKFLOW, userWorkflow);
 	            break;
-			case EXPERIMENT_METADATA:
-//                generator = new QueryGenerator(EXPERIMENT_METADATA);
-//                generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-//                q = generator.selectQuery(em);
-//	            Experiment_Metadata experiment = (Experiment_Metadata) q.getSingleResult();
-//                result= Utils.getResource(ResourceType.EXPERIMENT_METADATA, experiment);
-//				break;
-			case WORKFLOW_DATA:
-//                generator = new QueryGenerator(WORKFLOW_DATA);
-//                generator.setParameter(WorkflowDataConstants.WORKFLOW_INSTANCE_ID, name);
-//                q = generator.selectQuery(em);
-//                Workflow_Data eworkflowData = (Workflow_Data)q.getSingleResult();
-//                WorkflowDataResource workflowDataResource = (WorkflowDataResource)Utils.getResource(ResourceType.WORKFLOW_DATA,
eworkflowData);
-//                result= workflowDataResource;
-//                break;
-            case GFAC_JOB_DATA:
-//                generator = new QueryGenerator(GFAC_JOB_DATA);
-//                generator.setParameter(GFacJobDataConstants.LOCAL_JOB_ID, name);
-//                q = generator.selectQuery(em);
-//                GFac_Job_Data gFacJobData = (GFac_Job_Data)q.getSingleResult();
-//                GFacJobDataResource gFacJobDataResource = (GFacJobDataResource)Utils.getResource(ResourceType.GFAC_JOB_DATA,
gFacJobData);
-//                result= gFacJobDataResource;
-//                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -274,17 +231,6 @@ public class WorkerResource extends AbstractResource {
 		            result.add(userWorkflowResource);
 	            }
 	            break;
-			case EXPERIMENT_METADATA:
-//                generator = new QueryGenerator(EXPERIMENT_METADATA);
-//                generator.setParameter(ExperimentMetadataConstants.GATEWAY_NAME, gateway.getGatewayName());
-//                generator.setParameter(ExperimentMetadataConstants.EXECUTION_USER, user);
-//                q = generator.selectQuery(em);
-//	            for (Object o : q.getResultList()) {
-//	            	Experiment_Metadata experiment = (Experiment_Metadata) o;
-//	            	ExperimentMetadataResource experimentResource = (ExperimentMetadataResource)Utils.getResource(ResourceType.EXPERIMENT_METADATA,
experiment);
-//		            result.add(experimentResource);
-//	            }
-//	            break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -459,17 +405,9 @@ public class WorkerResource extends AbstractResource {
      * @return whether experiment is already exist for the given user
      */
 	public boolean isExperimentExists(String name){
-		return isExists(ResourceType.EXPERIMENT_METADATA, name);
+		return isExists(ResourceType.EXPERIMENT, name);
 	}
 	
-	/**
-	 * Returns of the gfac job record is present for the job id
-	 * @param jobId
-	 * @return
-	 */
-	public boolean isGFacJobExists(String jobId){
-		return isExists(ResourceType.GFAC_JOB_DATA, jobId);
-	}
 
     /**
      *
@@ -502,18 +440,6 @@ public class WorkerResource extends AbstractResource {
      * @param experimentId  experiment name
      */
 	public void removeExperiment(String experimentId){
-		remove(ResourceType.EXPERIMENT_METADATA, experimentId);
+		remove(ResourceType.EXPERIMENT, experimentId);
 	}
-	
-    public boolean isWorkflowInstancePresent(String workflowInstanceId){
-		return isExists(ResourceType.WORKFLOW_DATA, workflowInstanceId);
-    }
-    
-    public WorkflowDataResource getWorkflowInstance(String workflowInstanceId){
-    	return (WorkflowDataResource)get(ResourceType.WORKFLOW_DATA, workflowInstanceId);
-    }
-    
-    public void removeWorkflowInstance(String workflowInstanceId){
-    	remove(ResourceType.WORKFLOW_DATA, workflowInstanceId);
-    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
deleted file mode 100644
index 403a180..0000000
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- *
- * 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.persistance.registry.jpa.resources;
-
-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.*;
-import org.apache.airavata.persistance.registry.jpa.resources.AbstractResource.GFacJobDataConstants;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-
-public class WorkflowDataResource extends AbstractResource{
-    private final static Logger logger = LoggerFactory.getLogger(WorkflowDataResource.class);
-    public static final String NODE_DATA = "Node_Data";
-    public static final String GRAM_DATA = "Gram_Data";
-    public static final String EXECUTION_ERROR = "Execution_Error";
-    private String experimentID;
-    private String workflowInstanceID;
-    private String templateName;
-    private String status;
-    private Timestamp startTime;
-    private Timestamp lastUpdatedTime;
-
-    public String getExperimentID() {
-        return experimentID;
-    }
-
-    public String getWorkflowInstanceID() {
-        return workflowInstanceID;
-    }
-
-    public String getTemplateName() {
-        return templateName;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setExperimentID(String experimentID) {
-        this.experimentID = experimentID;
-    }
-
-    public void setWorkflowInstanceID(String workflowInstanceID) {
-        this.workflowInstanceID = workflowInstanceID;
-    }
-
-    public void setTemplateName(String templateName) {
-        this.templateName = templateName;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Timestamp getStartTime() {
-        return startTime;
-    }
-
-    public Timestamp getLastUpdatedTime() {
-        return lastUpdatedTime;
-    }
-
-    public void setStartTime(Timestamp startTime) {
-        this.startTime = startTime;
-    }
-
-    public void setLastUpdatedTime(Timestamp lastUpdatedTime) {
-        this.lastUpdatedTime = lastUpdatedTime;
-    }
-
-    public Resource create(ResourceType type) {
-//       switch (type){
-//           case NODE_DATA:
-////               NodeDataResource nodeDataResource = new NodeDataResource();
-////               nodeDataResource.setWorkflowDataResource(this);
-////               return nodeDataResource;
-//           case GRAM_DATA:
-//               GramDataResource gramDataResource = new GramDataResource();
-//               gramDataResource.setWorkflowDataResource(this);
-//               return gramDataResource;
-//           case EXECUTION_ERROR:
-//               ExecutionErrorResource executionErrorResource = new ExecutionErrorResource();
-//               executionErrorResource.setWorkflowDataResource(this);
-//               return executionErrorResource;
-//           case GFAC_JOB_DATA:
-//               GFacJobDataResource gFacJobDataResource = new GFacJobDataResource();
-//               gFacJobDataResource.setWorkflowDataResource(this);
-//               return gFacJobDataResource;
-//           default:
-               logger.error("Unsupported resource type for workflow data resource.", new
IllegalArgumentException());
-               throw new IllegalArgumentException("Unsupported resource type for workflow
data resource.");
-//       }
-    }
-
-    public void remove(ResourceType type, Object name) {
-        EntityManager em = ResourceUtils.getEntityManager();
-        em.getTransaction().begin();
-        Query q;
-        QueryGenerator generator;
-        switch (type){
-            case NODE_DATA:
-                generator = new QueryGenerator(NODE_DATA);
-                generator.setParameter(NodeDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-                generator.setParameter(NodeDataConstants.NODE_ID, name);
-                q = generator.deleteQuery(em);
-                q.executeUpdate();
-                break;
-            case GRAM_DATA:
-                generator = new QueryGenerator(GRAM_DATA);
-                generator.setParameter(GramDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-                generator.setParameter(GramDataConstants.NODE_ID, name);
-                q = generator.deleteQuery(em);
-                q.executeUpdate();
-                break;
-            case EXECUTION_ERROR:
-                generator = new QueryGenerator(EXECUTION_ERROR);
-                generator.setParameter(ExecutionErrorConstants.ERROR_ID, name);
-                q = generator.deleteQuery(em);
-                q.executeUpdate();
-                break;
-            case GFAC_JOB_DATA:
-                generator = new QueryGenerator(GFAC_JOB_DATA);
-                generator.setParameter(GFacJobDataConstants.LOCAL_JOB_ID, name);
-                q = generator.deleteQuery(em);
-                q.executeUpdate();
-                break;
-            default:
-                logger.error("Unsupported resource type for workflow data resource.", new
IllegalArgumentException());
-                break;
-        }
-        em.getTransaction().commit();
-        em.close();
-    }
-
-    public Resource get(ResourceType type, Object name) {
-//        EntityManager em = ResourceUtils.getEntityManager();
-//        em.getTransaction().begin();
-//        QueryGenerator generator;
-//        Query q;
-//        switch (type) {
-//            case NODE_DATA:
-//                generator = new QueryGenerator(NODE_DATA);
-//                generator.setParameter(NodeDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-//                generator.setParameter(NodeDataConstants.NODE_ID, name);
-//                q = generator.selectQuery(em);
-//                Node_Data enodeDeata = (Node_Data)q.getSingleResult();
-//                NodeDataResource nodeDataResource = (NodeDataResource)Utils.getResource(ResourceType.NODE_DATA,
enodeDeata);
-//                em.getTransaction().commit();
-//                em.close();
-//                return nodeDataResource;
-//            case GRAM_DATA:
-//                generator = new QueryGenerator(GRAM_DATA);
-//                generator.setParameter(GramDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-//                generator.setParameter(GramDataConstants.NODE_ID, name);
-//                q = generator.selectQuery(em);
-//                Gram_Data egramData = (Gram_Data)q.getSingleResult();
-//                GramDataResource gramDataResource = (GramDataResource)Utils.getResource(ResourceType.GRAM_DATA,
egramData);
-//                em.getTransaction().commit();
-//                em.close();
-//                return gramDataResource;
-//            case EXECUTION_ERROR:
-//                generator = new QueryGenerator(EXECUTION_ERROR);
-//                generator.setParameter(ExecutionErrorConstants.ERROR_ID, name);
-//                q = generator.selectQuery(em);
-//                Execution_Error execution_error = (Execution_Error)q.getSingleResult();
-//                ExecutionErrorResource executionErrorResource = (ExecutionErrorResource)Utils.getResource(ResourceType.EXECUTION_ERROR,
execution_error);
-//                em.getTransaction().commit();
-//                em.close();
-//                return executionErrorResource;
-//            case GFAC_JOB_DATA:
-//                generator = new QueryGenerator(GFAC_JOB_DATA);
-//                generator.setParameter(GFacJobDataConstants.LOCAL_JOB_ID, name);
-//                q = generator.selectQuery(em);
-//                GFac_Job_Data gFac_job_data = (GFac_Job_Data)q.getSingleResult();
-//                GFacJobDataResource gFacJobDataResource = (GFacJobDataResource)Utils.getResource(ResourceType.GFAC_JOB_DATA,
gFac_job_data);
-//                em.getTransaction().commit();
-//                em.close();
-//                return gFacJobDataResource;
-//            default:
-//                em.getTransaction().commit();
-//                em.close();
-                logger.error("Unsupported resource type for workflow data resource.", new
IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported resource type for workflow
data resource.");
-//        }
-    }
-
-    public List<Resource> get(ResourceType type) {
-        List<Resource> resourceList = new ArrayList<Resource>();
-        EntityManager em = ResourceUtils.getEntityManager();
-        em.getTransaction().begin();
-        Query q;
-        QueryGenerator generator;
-        List<?> results;
-//        switch (type){
-//            case NODE_DATA:
-//                generator = new QueryGenerator(NODE_DATA);
-//                generator.setParameter(NodeDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-//                q = generator.selectQuery(em);
-//                results = q.getResultList();
-//                if (results.size() != 0) {
-//                    for (Object result : results) {
-//                        Node_Data nodeData = (Node_Data)result;
-//                        NodeDataResource nodeDataResource = (NodeDataResource)Utils.getResource(ResourceType.NODE_DATA,nodeData);
-//                        resourceList.add(nodeDataResource);
-//
-//                    }
-//                }
-//                break;
-//            case GRAM_DATA:
-//                generator = new QueryGenerator(GRAM_DATA);
-//                generator.setParameter(GramDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-//                q = generator.selectQuery(em);
-//                results = q.getResultList();
-//                if (results.size() != 0) {
-//                    for (Object result : results) {
-//                        Gram_Data gramData = (Gram_Data)result;
-//                        GramDataResource gramDataResource = (GramDataResource)Utils.getResource(ResourceType.GRAM_DATA,
gramData);
-//                        resourceList.add(gramDataResource);
-//                    }
-//                }
-//                break;
-//            case EXECUTION_ERROR:
-//                generator = new QueryGenerator(EXECUTION_ERROR);
-//                generator.setParameter(ExecutionErrorConstants.WORKFLOW_ID, workflowInstanceID);
-//                q = generator.selectQuery(em);
-//                results = q.getResultList();
-//                if (results.size() != 0) {
-//                    for (Object result : results) {
-//                        Execution_Error executionError = (Execution_Error)result;
-//                        ExecutionErrorResource executionErrorResource = (ExecutionErrorResource)Utils.getResource(ResourceType.EXECUTION_ERROR,
executionError);
-//                        resourceList.add(executionErrorResource);
-//                    }
-//                }
-//                break;
-//            case GFAC_JOB_DATA:
-//                generator = new QueryGenerator(GFAC_JOB_DATA);
-//                generator.setParameter(GFacJobDataConstants.EXPERIMENT_ID, experimentID);
-//                generator.setParameter(GFacJobDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
-//                q = generator.selectQuery(em);
-//                results = q.getResultList();
-//                if (results.size() != 0) {
-//                    for (Object result : results) {
-//                        GFac_Job_Data gFac_job_data = (GFac_Job_Data)result;
-//                        GFacJobDataResource gFacJobDataResource = (GFacJobDataResource)Utils.getResource(ResourceType.GFAC_JOB_DATA,
gFac_job_data);
-//                        resourceList.add(gFacJobDataResource);
-//                    }
-//                }
-//                break;
-//            default:
-//                em.getTransaction().commit();
-//                em.close();
-                logger.error("Unsupported resource type for workflow data resource.", new
IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported resource type for workflow
data resource.");
-//        }
-//        em.getTransaction().commit();
-//        em.close();
-//        return resourceList;
-    }
-
-    public List<Resource> getGFacJobs(){
-    	return get(ResourceType.GFAC_JOB_DATA);
-    }
-    
-    public void save() {
-//        if(lastUpdatedTime == null){
-//            java.util.Date date= new java.util.Date();
-//            lastUpdatedTime = new Timestamp(date.getTime());
-//        }
-//        EntityManager em = ResourceUtils.getEntityManager();
-////        Workflow_Data existingWFData = em.find(Workflow_Data.class, workflowInstanceID);
-//        em.close();
-//
-//        em = ResourceUtils.getEntityManager();
-//        em.getTransaction().begin();
-////        Workflow_Data workflowData = new Workflow_Data();
-////        Experiment_Metadata expData = em.find(Experiment_Metadata.class, experimentID);
-////        workflowData.setExperiment_data(expData);
-////        workflowData.setWorkflow_instanceID(workflowInstanceID);
-////        workflowData.setLast_update_time(lastUpdatedTime);
-////        workflowData.setStart_time(startTime);
-////        workflowData.setTemplate_name(templateName);
-////        workflowData.setStatus(status);
-//        if(existingWFData != null){
-//            existingWFData.setExperiment_data(expData);
-//            existingWFData.setLast_update_time(lastUpdatedTime);
-//            existingWFData.setStart_time(startTime);
-//            existingWFData.setStatus(status);
-//            existingWFData.setTemplate_name(templateName);
-//            workflowData = em.merge(existingWFData);
-//        }else {
-//            em.persist(workflowData);
-//        }
-//        em.getTransaction().commit();
-//        em.close();
-    }
-    
-    public boolean isNodeExists(String nodeId){
-    	return isExists(ResourceType.NODE_DATA, nodeId);
-    }
-    
-    public boolean isGramDataExists(String nodeId){
-    	return isExists(ResourceType.GRAM_DATA, nodeId);
-    }
-    
-//    public NodeDataResource getNodeData(String nodeId){
-//		return (NodeDataResource) get(ResourceType.NODE_DATA,nodeId);
-//    }
-//
-//    public GramDataResource getGramData(String nodeId){
-//    	return (GramDataResource) get(ResourceType.GRAM_DATA,nodeId);
-//    }
-//
-//    public List<NodeDataResource> getNodeData(){
-//    	return getResourceList(get(ResourceType.NODE_DATA),NodeDataResource.class);
-//    }
-//
-//    public List<GramDataResource> getGramData(){
-//    	return getResourceList(get(ResourceType.GRAM_DATA),GramDataResource.class);
-//    }
-//
-//    public NodeDataResource createNodeData(String nodeId){
-//    	NodeDataResource data=(NodeDataResource)create(ResourceType.NODE_DATA);
-//    	data.setNodeID(nodeId);
-//    	return data;
-//    }
-//
-//    public GramDataResource createGramData(String nodeId){
-//    	GramDataResource data=(GramDataResource)create(ResourceType.GRAM_DATA);
-//    	data.setNodeID(nodeId);
-//    	return data;
-//    }
-    
-    public void removeNodeData(String nodeId){
-    	remove(ResourceType.NODE_DATA, nodeId);
-    }
-    
-    public void removeGramData(String nodeId){
-    	remove(ResourceType.GRAM_DATA, nodeId);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
new file mode 100644
index 0000000..d78bc19
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowNodeDetailResource.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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.persistance.registry.jpa.resources;
+
+import org.apache.airavata.persistance.registry.jpa.Resource;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+public class WorkflowNodeDetailResource extends AbstractResource {
+    private ExperimentResource experimentResource;
+    private String nodeInstanceId;
+    private Timestamp creationTime;
+    private String nodeName;
+
+    public ExperimentResource getExperimentResource() {
+        return experimentResource;
+    }
+
+    public void setExperimentResource(ExperimentResource experimentResource) {
+        this.experimentResource = experimentResource;
+    }
+
+    public String getNodeInstanceId() {
+        return nodeInstanceId;
+    }
+
+    public void setNodeInstanceId(String nodeInstanceId) {
+        this.nodeInstanceId = nodeInstanceId;
+    }
+
+    public Timestamp getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Timestamp creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public String getNodeName() {
+        return nodeName;
+    }
+
+    public void setNodeName(String nodeName) {
+        this.nodeName = nodeName;
+    }
+
+    @Override
+    public Resource create(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void remove(ResourceType type, Object name) {
+
+    }
+
+    @Override
+    public Resource get(ResourceType type, Object name) {
+        return null;
+    }
+
+    @Override
+    public List<Resource> get(ResourceType type) {
+        return null;
+    }
+
+    @Override
+    public void save() {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index df9fc95..fd88e4d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -143,7 +143,7 @@ CREATE TABLE EXPERIMENT
         FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
 );
 
-CREATE TABLE EXPERIMENT_INPUTS
+CREATE TABLE EXPERIMENT_INPUT
 (
         EXPERIMENT_ID VARCHAR(255),
         INPUT_KEY VARCHAR(255),
@@ -154,7 +154,7 @@ CREATE TABLE EXPERIMENT_INPUTS
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );
 
-CREATE TABLE EXPERIMENT_OUTPUTS
+CREATE TABLE EXPERIMENT_OUTPUT
 (
         EXPERIMENT_ID VARCHAR(255),
         OUTPUT_KEY VARCHAR(255),
@@ -343,7 +343,7 @@ CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
 );
 
-CREATE TABLE QOS_PARAMS
+CREATE TABLE QOS_PARAM
 (
         QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
         EXPERIMENT_ID VARCHAR(255),

http://git-wip-us.apache.org/repos/asf/airavata/blob/a584c2c7/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index fcd3f76..59ea82d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -143,7 +143,7 @@ CREATE TABLE EXPERIMENT
         FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
 );
 
-CREATE TABLE EXPERIMENT_INPUTS
+CREATE TABLE EXPERIMENT_INPUT
 (
         EXPERIMENT_ID VARCHAR(255),
         INPUT_KEY VARCHAR(255),
@@ -154,7 +154,7 @@ CREATE TABLE EXPERIMENT_INPUTS
         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );
 
-CREATE TABLE EXPERIMENT_OUTPUTS
+CREATE TABLE EXPERIMENT_OUTPUT
 (
         EXPERIMENT_ID VARCHAR(255),
         OUTPUT_KEY VARCHAR(255),
@@ -344,7 +344,7 @@ CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
 );
 
-CREATE TABLE QOS_PARAMS
+CREATE TABLE QOS_PARAM
 (
         QOS_ID INTEGER NOT NULL AUTO_INCREMENT,
         EXPERIMENT_ID VARCHAR(255),


Mime
View raw message