airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding resources - AIRAVATA-1017
Date Wed, 19 Feb 2014 16:21:27 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 867cfee4c -> 136cfeabb


adding resources - AIRAVATA-1017


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

Branch: refs/heads/master
Commit: 136cfeabbc97ce1947c0d6738ffadf428ef47f95
Parents: 867cfee
Author: chathuri <chathuri@apache.org>
Authored: Wed Feb 19 11:21:21 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Wed Feb 19 11:21:21 2014 -0500

----------------------------------------------------------------------
 .../AdvanceInputDataHandlingResource.java       |  41 ++++-
 .../AdvancedOutputDataHandlingResource.java     |  39 ++++-
 .../ComputationSchedulingResource.java          |  46 ++++-
 .../jpa/resources/ConfigDataResource.java       |  45 ++++-
 .../resources/DataTransferDetailResource.java   | 119 ++++++++++++-
 .../jpa/resources/ExperimentResource.java       |   1 -
 .../registry/jpa/resources/GatewayResource.java | 111 +++++-------
 .../jpa/resources/JobDetailResource.java        | 120 ++++++++++++-
 .../registry/jpa/resources/ProjectResource.java | 169 ++++++++-----------
 .../jpa/resources/QosParamResource.java         |  39 ++++-
 .../registry/jpa/resources/StatusResource.java  |  63 ++++++-
 .../registry/jpa/resources/WorkerResource.java  |  51 ++++--
 12 files changed, 621 insertions(+), 223 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvanceInputDataHandlingResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvanceInputDataHandlingResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvanceInputDataHandlingResource.java
index dda8d05..08edde4 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvanceInputDataHandlingResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvanceInputDataHandlingResource.java
@@ -23,10 +23,19 @@ 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.AdvancedInputDataHandling;
+import org.apache.airavata.persistance.registry.jpa.model.AdvancedOutputDataHandling;
+import org.apache.airavata.persistance.registry.jpa.model.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
 import java.util.List;
 
 public class AdvanceInputDataHandlingResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(AdvanceInputDataHandlingResource.class);
     private int dataHandlingId;
     private ExperimentResource experimentResource;
     private TaskDetailResource taskDetailResource;
@@ -93,26 +102,46 @@ public class AdvanceInputDataHandlingResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for input data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for input data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for input data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for input data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        AdvancedInputDataHandling dataHandling = new AdvancedInputDataHandling();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        dataHandling.setExpId(experimentResource.getExpID());
+        dataHandling.setExperiment(experiment);
+        dataHandling.setTaskId(taskDetailResource.getTaskId());
+        dataHandling.setTask(taskDetail);
+        dataHandling.setWorkingDir(workingDir);
+        dataHandling.setParentWorkingDir(workingDirParent);
+        dataHandling.setStageInputsToWorkingDir(stageInputFiles);
+        dataHandling.setCleanAfterJob(cleanAfterJob);
+        em.persist(dataHandling);
+        dataHandlingId = dataHandling.getDataHandlingId();
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvancedOutputDataHandlingResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvancedOutputDataHandlingResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvancedOutputDataHandlingResource.java
index 7e40913..c28ff4b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvancedOutputDataHandlingResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AdvancedOutputDataHandlingResource.java
@@ -23,10 +23,18 @@ 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.AdvancedOutputDataHandling;
+import org.apache.airavata.persistance.registry.jpa.model.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
 import java.util.List;
 
 public class AdvancedOutputDataHandlingResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(AdvancedOutputDataHandlingResource.class);
     private int outputDataHandlingId;
     private ExperimentResource experimentResource;
     private TaskDetailResource taskDetailResource;
@@ -84,26 +92,45 @@ public class AdvancedOutputDataHandlingResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for output data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for output data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for output data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for output data handling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        AdvancedOutputDataHandling dataHandling = new AdvancedOutputDataHandling();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        dataHandling.setExpId(experimentResource.getExpID());
+        dataHandling.setExperiment(experiment);
+        dataHandling.setTaskId(taskDetailResource.getTaskId());
+        dataHandling.setTask(taskDetail);
+        dataHandling.setDataRegUrl(dataRegUrl);
+        dataHandling.setOutputDataDir(outputDataDir);
+        dataHandling.setPersistOutputData(persistOutputData);
+        em.persist(dataHandling);
+        outputDataHandlingId = dataHandling.getOutputDataHandlingId();
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
index 76ce5eb..0056bbb 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ComputationSchedulingResource.java
@@ -23,11 +23,19 @@ 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.Computational_Resource_Scheduling;
+import org.apache.airavata.persistance.registry.jpa.model.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
 import java.sql.Timestamp;
 import java.util.List;
 
 public class ComputationSchedulingResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(ComputationSchedulingResource.class);
     private int schedulingId;
     private ExperimentResource experimentResource;
     private TaskDetailResource taskDetailResource;
@@ -139,26 +147,52 @@ public class ComputationSchedulingResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for computational scheduling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for computational scheduling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for computational scheduling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for computational scheduling resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+
+        Computational_Resource_Scheduling scheduling = new Computational_Resource_Scheduling();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        scheduling.setExpId(experimentResource.getExpID());
+        scheduling.setExperiment(experiment);
+        scheduling.setTaskId(taskDetailResource.getTaskId());
+        scheduling.setTask(taskDetail);
+        scheduling.setResourceHostId(resourceHostId);
+        scheduling.setCpuCount(cpuCount);
+        scheduling.setNodeCount(nodeCount);
+        scheduling.setNumberOfThreads(numberOfThreads);
+        scheduling.setQueueName(queueName);
+        scheduling.setWallTimeLimit(walltimeLimit);
+        scheduling.setJobStartTime(jobStartTime);
+        scheduling.setTotalPhysicalmemory(physicalMemory);
+        scheduling.setProjectName(projectName);
+        em.persist(scheduling);
+        schedulingId = scheduling.getSchedulingId();
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
index 8873094..3313f19 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigDataResource.java
@@ -23,11 +23,18 @@ 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.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.ExperimentConfigData;
 import org.apache.airavata.schemas.gfac.BooleanParameterType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import javax.persistence.EntityManager;
 import java.util.List;
 
 public class ConfigDataResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(ConfigDataResource.class);
     private ExperimentResource experimentResource;
     private boolean airavataAutoSchedule;
     private boolean overrideManualParams;
@@ -67,26 +74,54 @@ public class ConfigDataResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for config data resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for config data resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for config data resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for config data resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        ExperimentConfigData existingConfig = em.find(ExperimentConfigData.class, experimentResource.getExpID());
+        em.close();
+
+        em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        ExperimentConfigData configData = new ExperimentConfigData();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        configData.setExpId(experimentResource.getExpID());
+        configData.setExperiment(experiment);
+        configData.setAiravataAutoSchedule(airavataAutoSchedule);
+        configData.setOverrideManualParams(overrideManualParams);
+        configData.setShareExp(shareExp);
+        if (existingConfig != null){
+            existingConfig.setExpId(experimentResource.getExpID());
+            existingConfig.setExperiment(experiment);
+            existingConfig.setAiravataAutoSchedule(airavataAutoSchedule);
+            existingConfig.setOverrideManualParams(overrideManualParams);
+            existingConfig.setShareExp(shareExp);
+            configData = em.merge(existingConfig);
+        }else {
+            em.merge(configData);
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
index 1bc87b5..f95ad0a 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
@@ -23,11 +23,22 @@ 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.DataTransferDetail;
+import org.apache.airavata.persistance.registry.jpa.model.Status;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+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 DataTransferDetailResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(DataTransferDetailResource.class);
     private String transferId;
     private TaskDetailResource taskDetailResource;
     private Timestamp creationTime;
@@ -67,26 +78,122 @@ public class DataTransferDetailResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        switch (type){
+            case STATUS:
+                StatusResource statusResource = new StatusResource();
+                statusResource.setDataTransferDetail(this);
+                return statusResource;
+            default:
+                logger.error("Unsupported resource type for data transfer details data resource.", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Query q;
+        QueryGenerator generator;
+        switch (type){
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.TRANSFER_ID, name);
+                q = generator.deleteQuery(em);
+                q.executeUpdate();
+                break;
+            default:
+                logger.error("Unsupported resource type for data transfer details resource.", new IllegalArgumentException());
+                break;
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        QueryGenerator generator;
+        Query q;
+        switch (type) {
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.TRANSFER_ID, name);
+                q = generator.selectQuery(em);
+                Status status = (Status)q.getSingleResult();
+                StatusResource statusResource = (StatusResource)Utils.getResource(ResourceType.STATUS, status);
+                em.getTransaction().commit();
+                em.close();
+                return statusResource;
+            default:
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported resource type for data transfer details resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported resource type for data transfer details resource.");
+        }
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        List<Resource> resourceList = new ArrayList<Resource>();
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Query q;
+        QueryGenerator generator;
+        List results;
+        switch (type){
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.TRANSFER_ID, transferId);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        Status status = (Status) result;
+                        StatusResource statusResource =
+                                (StatusResource)Utils.getResource(ResourceType.STATUS, status);
+                        resourceList.add(statusResource);
+                    }
+                }
+                break;
+            default:
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported resource type for workflow node details resource.", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
+        em.getTransaction().commit();
+        em.close();
+        return resourceList;
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        DataTransferDetail existingDF = em.find(DataTransferDetail.class, transferId);
+        em.close();
+
+        em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        DataTransferDetail dataTransferDetail = new DataTransferDetail();
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        dataTransferDetail.setTransferId(transferId);
+        dataTransferDetail.setTask(taskDetail);
+        dataTransferDetail.setTaskId(taskDetailResource.getTaskId());
+        dataTransferDetail.setCreationTime(creationTime);
+        dataTransferDetail.setTransferDesc(transferDescription);
+        if (existingDF != null){
+            existingDF.setTransferId(transferId);
+            existingDF.setTask(taskDetail);
+            existingDF.setTaskId(taskDetailResource.getTaskId());
+            existingDF.setCreationTime(creationTime);
+            existingDF.setTransferDesc(transferDescription);
+            dataTransferDetail = em.merge(existingDF);
+        }else {
+            em.merge(dataTransferDetail);
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
index bdd5c50..f0ae728 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
@@ -32,7 +32,6 @@ 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.utils.QueryGenerator;
-import org.bouncycastle.jce.provider.JDKPSSSigner;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
index 05e3d6e..246bb00 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
@@ -124,10 +124,10 @@ public class GatewayResource extends AbstractResource {
                         new ApplicationDescriptorResource();
                 applicationDescriptorResource.setGatewayName(gatewayName);
                 return applicationDescriptorResource;
-//            case EXPERIMENT_METADATA:
-//                ExperimentMetadataResource metadataResource =new ExperimentMetadataResource();
-//                metadataResource.setGateway(this);
-//                return metadataResource;
+            case EXPERIMENT:
+                ExperimentResource experimentResource =new ExperimentResource();
+                experimentResource.setGateway(this);
+                return experimentResource;
             case GATEWAY_WORKER:
                 WorkerResource workerResource = new WorkerResource();
                 workerResource.setGateway(this);
@@ -176,13 +176,12 @@ public class GatewayResource extends AbstractResource {
                 q = generator.deleteQuery(em);
                 q.executeUpdate();
                 break;
-//            case EXPERIMENT_METADATA:
-//                generator = new QueryGenerator(EXPERIMENT_METADATA);
-//                generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-//                generator.setParameter(ExperimentMetadataConstants.GATEWAY_NAME, gatewayName);
-//                q = generator.deleteQuery(em);
-//                q.executeUpdate();
-//                break;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+                q = generator.deleteQuery(em);
+                q.executeUpdate();
+                break;
             case APPLICATION_DESCRIPTOR:
                 generator = new QueryGenerator(APPLICATION_DESCRIPTOR);
                 generator.setParameter(ApplicationDescriptorConstants.APPLICATION_DESC_ID, name);
@@ -244,17 +243,16 @@ public class GatewayResource extends AbstractResource {
                 em.getTransaction().commit();
                 em.close();
                 return hostDescriptorResource;
-//            case EXPERIMENT_METADATA:
-//                generator = new QueryGenerator(EXPERIMENT_METADATA);
-//                generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-////                generator.setParameter(ExperimentMetadataConstants.GATEWAY_NAME, gatewayName);
-//                q = generator.selectQuery(em);
-//                Experiment_Metadata experiment = (Experiment_Metadata)q.getSingleResult();
-//                ExperimentMetadataResource experimentResource =
-//                        (ExperimentMetadataResource)Utils.getResource(ResourceType.EXPERIMENT_METADATA, experiment);
-//                em.getTransaction().commit();
-//                em.close();
-//                return experimentResource;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+                q = generator.selectQuery(em);
+                Experiment experiment = (Experiment)q.getSingleResult();
+                ExperimentResource experimentResource =
+                        (ExperimentResource)Utils.getResource(ResourceType.EXPERIMENT, experiment);
+                em.getTransaction().commit();
+                em.close();
+                return experimentResource;
             case SERVICE_DESCRIPTOR:
                 generator = new QueryGenerator(SERVICE_DESCRIPTOR);
                 generator.setParameter(ServiceDescriptorConstants.SERVICE_DESC_ID, name);
@@ -385,20 +383,20 @@ public class GatewayResource extends AbstractResource {
                     }
                 }
                 break;
-//            case EXPERIMENT_METADATA:
-//                generator = new QueryGenerator(EXPERIMENT_METADATA);
-//                generator.setParameter(ExperimentMetadataConstants.GATEWAY_NAME, gatewayName);
-//                q = generator.selectQuery(em);
-//                results = q.getResultList();
-//                if (results.size() != 0) {
-//                    for (Object result : results) {
-//                        Experiment_Metadata experiment = (Experiment_Metadata) result;
-//                        ExperimentMetadataResource experimentResource =
-//                                (ExperimentMetadataResource)Utils.getResource(ResourceType.EXPERIMENT_METADATA, experiment);
-//                        resourceList.add(experimentResource);
-//                    }
-//                }
-//                break;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.GATEWAY_NAME, gatewayName);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        Experiment experiment = (Experiment) result;
+                        ExperimentResource experimentResource =
+                                (ExperimentResource)Utils.getResource(ResourceType.EXPERIMENT, experiment);
+                        resourceList.add(experimentResource);
+                    }
+                }
+                break;
             case USER:
 		        generator = new QueryGenerator(USERS);
 		        q = generator.selectQuery(em);
@@ -409,16 +407,6 @@ public class GatewayResource extends AbstractResource {
 		        	resourceList.add(userResource);
 		        }
 		        break;
-//            case ORCHESTRATOR:
-//                generator = new QueryGenerator(ORCHESTRATOR);
-//                q = generator.selectQuery(em);
-//                for (Object o : q.getResultList()) {
-//                    Orchestrator orchData = (Orchestrator) o;
-//                    OrchestratorDataResource orchestratorDataResource =
-//                            (OrchestratorDataResource)Utils.getResource(ResourceType.ORCHESTRATOR, orchData);
-//                    resourceList.add(orchestratorDataResource);
-//                }
-//                break;
             default:
                 em.getTransaction().commit();
                 em.close();
@@ -491,16 +479,11 @@ public class GatewayResource extends AbstractResource {
                 Application_Descriptor existingAppDesc = em.find(Application_Descriptor.class, new Application_Descriptor_PK(gatewayName, name.toString()));
                 em.close();
                 return existingAppDesc != null;
-//            case EXPERIMENT_METADATA:
-//                em = ResourceUtils.getEntityManager();
-//                Experiment_Metadata existingExp = em.find(Experiment_Metadata.class, name.toString());
-//                em.close();
-//                return existingExp != null;
-//            case ORCHESTRATOR:
-//                em = ResourceUtils.getEntityManager();
-//                Orchestrator existingOrchestrator = em.find(Orchestrator.class, name.toString());
-//                em.close();
-//                return existingOrchestrator != null;
+            case EXPERIMENT:
+                em = ResourceUtils.getEntityManager();
+                Experiment existingExp = em.find(Experiment.class, name.toString());
+                em.close();
+                return existingExp != null;
             default:
                 logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
@@ -756,16 +739,10 @@ public class GatewayResource extends AbstractResource {
     	remove(ResourceType.PUBLISHED_WORKFLOW, workflowTemplateName);
     }
     
-//    public OrchestratorDataResource createOrchestratorData(String experimentID){
-//    	OrchestratorDataResource dataResource = (OrchestratorDataResource)create(ResourceType.ORCHESTRATOR);
-//    	dataResource.setExperimentID(experimentID);
-//    	return dataResource;
-//    }
-
-//    public ExperimentMetadataResource createBasicMetada (String experimentID){
-//        ExperimentMetadataResource metadataResource = (ExperimentMetadataResource)create(ResourceType.EXPERIMENT_METADATA);
-//        metadataResource.setExpID(experimentID);
-//        return metadataResource;
-//    }
+    public ExperimentResource createExperiment (String experimentID){
+        ExperimentResource metadataResource = (ExperimentResource)create(ResourceType.EXPERIMENT);
+        metadataResource.setExpID(experimentID);
+        return metadataResource;
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
index 8bab116..13a889e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
@@ -23,11 +23,23 @@ 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.JobDetail;
+import org.apache.airavata.persistance.registry.jpa.model.JobDetails_PK;
+import org.apache.airavata.persistance.registry.jpa.model.Status;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+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 JobDetailResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(JobDetailResource.class);
     private String jobId;
     private TaskDetailResource taskDetailResource;
     private String jobDescription;
@@ -67,26 +79,122 @@ public class JobDetailResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        switch (type){
+            case STATUS:
+                StatusResource statusResource = new StatusResource();
+                statusResource.setJobId(jobId);
+                return statusResource;
+            default:
+                logger.error("Unsupported resource type for job details data resource.", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Query q;
+        QueryGenerator generator;
+        switch (type){
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.JOB_ID, name);
+                q = generator.deleteQuery(em);
+                q.executeUpdate();
+                break;
+            default:
+                logger.error("Unsupported resource type for job details resource.", new IllegalArgumentException());
+                break;
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        QueryGenerator generator;
+        Query q;
+        switch (type) {
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.JOB_ID, name);
+                q = generator.selectQuery(em);
+                Status status = (Status)q.getSingleResult();
+                StatusResource statusResource = (StatusResource)Utils.getResource(ResourceType.STATUS, status);
+                em.getTransaction().commit();
+                em.close();
+                return statusResource;
+            default:
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported resource type for job details resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported resource type for job details resource.");
+        }
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        List<Resource> resourceList = new ArrayList<Resource>();
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Query q;
+        QueryGenerator generator;
+        List results;
+        switch (type){
+            case STATUS:
+                generator = new QueryGenerator(STATUS);
+                generator.setParameter(StatusConstants.JOB_ID, jobId);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        Status status = (Status) result;
+                        StatusResource statusResource =
+                                (StatusResource)Utils.getResource(ResourceType.STATUS, status);
+                        resourceList.add(statusResource);
+                    }
+                }
+                break;
+            default:
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported resource type for workflow node details resource.", new UnsupportedOperationException());
+                throw new UnsupportedOperationException();
+        }
+        em.getTransaction().commit();
+        em.close();
+        return resourceList;
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        JobDetail existingJobDetail = em.find(JobDetail.class, new JobDetails_PK(jobId, taskDetailResource.getTaskId()));
+        em.close();
+
+        em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        JobDetail jobDetail = new JobDetail();
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        jobDetail.setJobId(jobId);
+        jobDetail.setTask(taskDetail);
+        jobDetail.setTaskId(taskDetailResource.getTaskId());
+        jobDetail.setCreationTime(creationTime);
+        jobDetail.setJobDescription(jobDescription);
+        if (existingJobDetail != null){
+            existingJobDetail.setJobId(jobId);
+            existingJobDetail.setTask(taskDetail);
+            existingJobDetail.setTaskId(taskDetailResource.getTaskId());
+            existingJobDetail.setCreationTime(creationTime);
+            existingJobDetail.setJobDescription(jobDescription);
+            jobDetail = em.merge(existingJobDetail);
+        }else {
+            em.merge(jobDetail);
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
index fa188ef..d592512 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
@@ -64,16 +64,16 @@ public class ProjectResource extends AbstractResource {
      * @return child resource
      */
     public Resource create(ResourceType type) {
-//        if (type == ResourceType.EXPERIMENT_METADATA) {
-//            ExperimentMetadataResource experimentResource = new ExperimentMetadataResource();
-//            experimentResource.setGateway(getGateway());
-//            experimentResource.setExecutionUser(getWorker().getUser());
-//            experimentResource.setProject(this);
-//            return experimentResource;
-//        } else {
+        if (type == ResourceType.EXPERIMENT) {
+            ExperimentResource experimentResource = new ExperimentResource();
+            experimentResource.setGateway(getGateway());
+            experimentResource.setWorker(worker);
+            experimentResource.setProject(this);
+            return experimentResource;
+        } else {
             logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
-//        }
+        }
     }
 
     /**
@@ -82,19 +82,19 @@ public class ProjectResource extends AbstractResource {
      * @param name child resource name
      */
     public void remove(ResourceType type, Object name) {
-//        EntityManager em = ResourceUtils.getEntityManager();
-//        em.getTransaction().begin();
-//        if (type == ResourceType.EXPERIMENT_METADATA) {
-//        	QueryGenerator generator = new QueryGenerator(EXPERIMENT_METADATA);
-//        	generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-//        	Query q = generator.deleteQuery(em);
-//        	q.executeUpdate();
-//        }else {
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        if (type == ResourceType.EXPERIMENT) {
+        	QueryGenerator generator = new QueryGenerator(EXPERIMENT);
+        	generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+        	Query q = generator.deleteQuery(em);
+        	q.executeUpdate();
+        }else {
             logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
-//        }
-//        em.getTransaction().commit();
-//        em.close();
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 
     /**
@@ -104,49 +104,23 @@ public class ProjectResource extends AbstractResource {
      * @return child resource
      */
     public Resource get(ResourceType type, Object name) {
-//        if (type == ResourceType.EXPERIMENT_METADATA) {
-//            EntityManager em = ResourceUtils.getEntityManager();
-//            em.getTransaction().begin();
-//        	QueryGenerator generator = new QueryGenerator(EXPERIMENT_METADATA);
-//        	generator.setParameter(ExperimentMetadataConstants.EXPERIMENT_ID, name);
-//        	Query q = generator.selectQuery(em);
-//            Experiment_Metadata experiment = (Experiment_Metadata) q.getSingleResult();
-//            ExperimentMetadataResource experimentResource = (ExperimentMetadataResource)
-//                    Utils.getResource(ResourceType.EXPERIMENT_METADATA, experiment);
-//            em.getTransaction().commit();
-//            em.close();
-//            return experimentResource;
-//        }else{
+        if (type == ResourceType.EXPERIMENT) {
+            EntityManager em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+        	QueryGenerator generator = new QueryGenerator(EXPERIMENT);
+        	generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+        	Query q = generator.selectQuery(em);
+            Experiment experiment = (Experiment) q.getSingleResult();
+            ExperimentResource experimentResource = (ExperimentResource)
+                    Utils.getResource(ResourceType.EXPERIMENT, experiment);
+            em.getTransaction().commit();
+            em.close();
+            return experimentResource;
+        }else{
             logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
-//        }
-
-    }
-
-    /**
-     *
-     * @param keys project name
-     * @return project resource
-     */
-    public List<Resource> populate(Object[] keys) {
-        List<Resource> list = new ArrayList<Resource>();
-        EntityManager em = ResourceUtils.getEntityManager();
-        em.getTransaction().begin();
-        QueryGenerator queryGenerator = new QueryGenerator(PROJECT);
-        queryGenerator.setParameter(ProjectConstants.PROJECT_NAME, keys[0]);
-        Query q = queryGenerator.selectQuery(em);
-        List<?> resultList = q.getResultList();
-        if (resultList.size() != 0) {
-            for (Object result : resultList) {
-                Project project = (Project) result;
-                ProjectResource projectResource = (ProjectResource)
-                        Utils.getResource(ResourceType.PROJECT, project);
-                list.add(projectResource);
-            }
         }
-        em.getTransaction().commit();
-        em.close();
-        return list;
+
     }
 
     /**
@@ -157,28 +131,28 @@ public class ProjectResource extends AbstractResource {
     public List<Resource> get(ResourceType type) {
         List<Resource> resourceList = new ArrayList<Resource>();
 
-//        if (type == ResourceType.EXPERIMENT_METADATA) {
-//            EntityManager em = ResourceUtils.getEntityManager();
-//            em.getTransaction().begin();
-//        	QueryGenerator generator = new QueryGenerator(EXPERIMENT_METADATA);
-//        	generator.setParameter(ExperimentMetadataConstants.PROJECT_NAME, name);
-//        	Query q = generator.selectQuery(em);
-//            List<?> results = q.getResultList();
-//            if (results.size() != 0) {
-//                for (Object result : results) {
-//                    Experiment_Metadata experiment = (Experiment_Metadata) result;
-//                    ExperimentMetadataResource experimentResource = (ExperimentMetadataResource)
-//                            Utils.getResource(ResourceType.EXPERIMENT_METADATA, experiment);
-//                    resourceList.add(experimentResource);
-//                }
-//            }
-//            em.getTransaction().commit();
-//            em.close();
-//        } else {
+        if (type == ResourceType.EXPERIMENT) {
+            EntityManager em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+        	QueryGenerator generator = new QueryGenerator(EXPERIMENT);
+        	generator.setParameter(ExperimentConstants.PROJECT_NAME, name);
+        	Query q = generator.selectQuery(em);
+            List<?> results = q.getResultList();
+            if (results.size() != 0) {
+                for (Object result : results) {
+                    Experiment experiment = (Experiment) result;
+                    ExperimentResource experimentResource = (ExperimentResource)
+                            Utils.getResource(ResourceType.EXPERIMENT, experiment);
+                    resourceList.add(experimentResource);
+                }
+            }
+            em.getTransaction().commit();
+            em.close();
+        } else {
             logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
-//        }
-//        return resourceList;
+        }
+        return resourceList;
     }
 
     /**
@@ -265,8 +239,7 @@ public class ProjectResource extends AbstractResource {
      * @return whether the experiment exist
      */
     public boolean isExperimentExists(String experimentId){
-//		return isExists(ResourceType.EXPERIMENT_METADATA, experimentId);
-        return true;
+		return isExists(ResourceType.EXPERIMENT, experimentId);
 	}
 
     /**
@@ -274,40 +247,40 @@ public class ProjectResource extends AbstractResource {
      * @param experimentId experiment ID
      * @return  experiment resource
      */
-//    public ExperimentMetadataResource createExperiment(String experimentId){
-//		ExperimentMetadataResource experimentResource = (ExperimentMetadataResource)create(ResourceType.EXPERIMENT_METADATA);
-//		experimentResource.setExpID(experimentId);
-//		return experimentResource;
-//	}
+    public ExperimentResource createExperiment(String experimentId){
+		ExperimentResource experimentResource = (ExperimentResource)create(ResourceType.EXPERIMENT);
+		experimentResource.setExpID(experimentId);
+		return experimentResource;
+	}
 
     /**
      *
      * @param experimentId experiment ID
      * @return experiment resource
      */
-//	public ExperimentMetadataResource getExperiment(String experimentId){
-//		return (ExperimentMetadataResource)get(ResourceType.EXPERIMENT_METADATA,experimentId);
-//	}
+	public ExperimentResource getExperiment(String experimentId){
+		return (ExperimentResource)get(ResourceType.EXPERIMENT,experimentId);
+	}
 
     /**
      *
      * @return  list of experiments
      */
-//    public List<ExperimentMetadataResource> getExperiments(){
-//		List<Resource> list = get(ResourceType.EXPERIMENT_METADATA);
-//		List<ExperimentMetadataResource> result=new ArrayList<ExperimentMetadataResource>();
-//		for (Resource resource : list) {
-//			result.add((ExperimentMetadataResource) resource);
-//		}
-//		return result;
-//	}
+    public List<ExperimentResource> getExperiments(){
+		List<Resource> list = get(ResourceType.EXPERIMENT);
+		List<ExperimentResource> result=new ArrayList<ExperimentResource>();
+		for (Resource resource : list) {
+			result.add((ExperimentResource) resource);
+		}
+		return result;
+	}
 
     /**
      *
      * @param experimentId experiment ID
      */
     public void removeExperiment(String experimentId){
-//		remove(ResourceType.EXPERIMENT_METADATA, experimentId);
+		remove(ResourceType.EXPERIMENT, experimentId);
 	}
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/QosParamResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/QosParamResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/QosParamResource.java
index 830db7c..3a89e4e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/QosParamResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/QosParamResource.java
@@ -23,10 +23,18 @@ 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.Experiment;
+import org.apache.airavata.persistance.registry.jpa.model.QosParam;
+import org.apache.airavata.persistance.registry.jpa.model.TaskDetail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
 import java.util.List;
 
 public class QosParamResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(QosParamResource.class);
     private int  qosId;
     private ExperimentResource experimentResource;
     private TaskDetailResource taskDetailResource;
@@ -84,26 +92,45 @@ public class QosParamResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for qos params resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for qos params resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for qos params resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for qos params resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        QosParam qosParam = new QosParam();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        qosParam.setExpId(experimentResource.getExpID());
+        qosParam.setExperiment(experiment);
+        qosParam.setTaskId(taskDetailResource.getTaskId());
+        qosParam.setTask(taskDetail);
+        qosParam.setStartExecutionAt(startExecutionAt);
+        qosParam.setExecuteBefore(executeBefore);
+        qosParam.setNoOfRetries(noOfRetries);
+        em.persist(qosParam);
+        qosId = qosParam.getQosId();
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/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
index 2101ecb..327e5e0 100644
--- 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
@@ -23,11 +23,17 @@ 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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import javax.persistence.EntityManager;
 import java.sql.Timestamp;
 import java.util.List;
 
 public class StatusResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(StatusResource.class);
     private int statusId;
     private ExperimentResource experimentResource;
     private WorkflowNodeDetailResource workflowNodeDetail;
@@ -112,26 +118,73 @@ public class StatusResource extends AbstractResource {
 
     @Override
     public Resource create(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for status resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void remove(ResourceType type, Object name) {
-
+        logger.error("Unsupported resource type for status resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public Resource get(ResourceType type, Object name) {
-        return null;
+        logger.error("Unsupported resource type for status resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public List<Resource> get(ResourceType type) {
-        return null;
+        logger.error("Unsupported resource type for status resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     @Override
     public void save() {
-
+        EntityManager em = ResourceUtils.getEntityManager();
+        Status existingStatus = em.find(Status.class, statusId);
+        em.close();
+
+        em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Status status = new Status();
+        Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
+        TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
+        WorkflowNodeDetail nodeDetail = em.find(WorkflowNodeDetail.class, workflowNodeDetail.getNodeInstanceId());
+        DataTransferDetail transferDetail = em.find(DataTransferDetail.class, dataTransferDetail.getTransferId());
+        status.setStatusId(statusId);
+        status.setExperiment(experiment);
+        status.setTask(taskDetail);
+        status.setNode(nodeDetail);
+        status.setTransferDetail(transferDetail);
+        status.setJobId(jobId);
+        status.setExpId(experimentResource.getExpID());
+        status.setTaskId(taskDetailResource.getTaskId());
+        status.setNodeId(workflowNodeDetail.getNodeInstanceId());
+        status.setTransferId(dataTransferDetail.getTransferId());
+        status.setState(state);
+        status.setStatusUpdateTime(statusUpdateTime);
+        status.setStatusType(statusType);
+        if (existingStatus != null){
+            existingStatus.setStatusId(statusId);
+            existingStatus.setExperiment(experiment);
+            existingStatus.setTask(taskDetail);
+            existingStatus.setNode(nodeDetail);
+            existingStatus.setTransferDetail(transferDetail);
+            existingStatus.setJobId(jobId);
+            existingStatus.setExpId(experimentResource.getExpID());
+            existingStatus.setTaskId(taskDetailResource.getTaskId());
+            existingStatus.setNodeId(workflowNodeDetail.getNodeInstanceId());
+            existingStatus.setTransferId(dataTransferDetail.getTransferId());
+            existingStatus.setState(state);
+            existingStatus.setStatusUpdateTime(statusUpdateTime);
+            existingStatus.setStatusType(statusType);
+            status = em.merge(existingStatus);
+        }else {
+            em.merge(status);
+        }
+        em.getTransaction().commit();
+        em.close();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/136cfeab/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 c285876..7c9d2af 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
@@ -76,6 +76,12 @@ public class WorkerResource extends AbstractResource {
 				userWorkflowResource.setGateway(gateway);
 				result=userWorkflowResource;
                 break;
+            case EXPERIMENT:
+                ExperimentResource experimentResource = new ExperimentResource();
+                experimentResource.setWorker(this);
+                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.");
@@ -109,6 +115,12 @@ public class WorkerResource extends AbstractResource {
                 q = generator.deleteQuery(em);
 	            q.executeUpdate();
 	            break;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+                q = generator.deleteQuery(em);
+                q.executeUpdate();
+                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -146,6 +158,13 @@ public class WorkerResource extends AbstractResource {
 	            User_Workflow userWorkflow = (User_Workflow) q.getSingleResult();
                 result= Utils.getResource(ResourceType.USER_WORKFLOW, userWorkflow);
 	            break;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+                q = generator.selectQuery(em);
+                Experiment experiment = (Experiment) q.getSingleResult();
+                result= Utils.getResource(ResourceType.EXPERIMENT, experiment);
+                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -231,6 +250,16 @@ public class WorkerResource extends AbstractResource {
 		            result.add(userWorkflowResource);
 	            }
 	            break;
+            case EXPERIMENT:
+                generator = new QueryGenerator(EXPERIMENT);
+                generator.setParameter(ExperimentConstants.EXECUTION_USER, getUser());
+                q = generator.selectQuery(em);
+                for (Object o : q.getResultList()) {
+                    Experiment experiment = (Experiment) o;
+                    ExperimentResource experimentResource = (ExperimentResource)Utils.getResource(ResourceType.EXPERIMENT, experiment);
+                    result.add(experimentResource);
+                }
+                break;
 			default:
                 logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
                 break;
@@ -414,9 +443,9 @@ public class WorkerResource extends AbstractResource {
      * @param name experiment name
      * @return experiment resource
      */
-//    public ExperimentMetadataResource getExperiment(String name){
-//		return (ExperimentMetadataResource)get(ResourceType.EXPERIMENT_METADATA, name);
-//	}
+    public ExperimentResource getExperiment(String name){
+		return (ExperimentResource)get(ResourceType.EXPERIMENT, name);
+	}
 //
 //    public GFacJobDataResource getGFacJob(String jobId){
 //    	return (GFacJobDataResource)get(ResourceType.GFAC_JOB_DATA,jobId);
@@ -426,14 +455,14 @@ public class WorkerResource extends AbstractResource {
      *
      * @return list of experiments for the user
      */
-//	public List<ExperimentMetadataResource> getExperiments(){
-//		List<ExperimentMetadataResource> result=new ArrayList<ExperimentMetadataResource>();
-//		List<Resource> list = get(ResourceType.EXPERIMENT_METADATA);
-//		for (Resource resource : list) {
-//			result.add((ExperimentMetadataResource) resource);
-//		}
-//		return result;
-//	}
+	public List<ExperimentResource> getExperiments(){
+		List<ExperimentResource> result=new ArrayList<ExperimentResource>();
+		List<Resource> list = get(ResourceType.EXPERIMENT);
+		for (Resource resource : list) {
+			result.add((ExperimentResource) resource);
+		}
+		return result;
+	}
 
     /**
      *


Mime
View raw message