airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [2/3] git commit: add and update methods for experiment and experiment config data - AIRAVATA-1006
Date Thu, 20 Feb 2014 18:32:35 GMT
add and update methods for experiment and experiment config data - AIRAVATA-1006


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

Branch: refs/heads/master
Commit: 64e2cc4961bd29db8d3cc433555a66289cf61455
Parents: 6cb5d82 7d603e5
Author: chathuri <chathuri@apache.org>
Authored: Thu Feb 20 13:18:13 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Thu Feb 20 13:18:13 2014 -0500

----------------------------------------------------------------------
 .../persistance/registry/jpa/ResourceUtils.java |  54 +--
 .../registry/jpa/impl/ExperimentRegistry.java   | 398 ++++++++++---------
 .../registry/jpa/impl/RegistryImpl.java         |  37 +-
 .../persistance/registry/jpa/impl/UserReg.java  |   6 +-
 .../registry/jpa/model/Experiment.java          |   8 -
 .../resources/DataTransferDetailResource.java   |  12 +
 .../jpa/resources/ExperimentResource.java       |   6 +-
 .../registry/jpa/resources/GatewayResource.java |   8 +-
 .../registry/jpa/resources/UserResource.java    |  34 --
 .../registry/jpa/resources/Utils.java           |   2 +-
 .../jpa/utils/ThriftDataModelConversion.java    | 108 +++--
 .../src/main/resources/registry-derby.sql       |  21 +-
 .../registry/jpa/ProjectResourceTest.java       |  81 ----
 .../test/resources/airavata-registry-derby.sql  | 353 +++++++++-------
 .../src/test/resources/registry-derby.sql       | 376 ++++++++++++++++++
 .../apache/airavata/registry/cpi/Registry.java  |  20 +-
 .../airavata/registry/cpi/utils/Constants.java  |   1 -
 17 files changed, 973 insertions(+), 552 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
index 97ed481,97ed481..7562d37
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
@@@ -103,7 -103,7 +103,26 @@@ public class ResourceUtils 
  
      }
  
--    public static Resource getWorker(String gatewayName, String userName){
++    public static void addUser (String userName, String password){
++        UserResource resource = new UserResource();
++        resource.setUserName(userName);
++        resource.setPassword(password);
++        resource.save();
++    }
++
++    public static boolean isUserExist (String username){
++        EntityManager em = getEntityManager();
++        em.getTransaction().begin();
++        QueryGenerator generator = new QueryGenerator(AbstractResource.USERS);
++        generator.setParameter(AbstractResource.UserConstants.USERNAME, username);
++        Query q = generator.selectQuery(em);
++        int size = q.getResultList().size();
++        em.getTransaction().commit();
++        em.close();
++        return size>0;
++    }
++
++    public static Resource getWorker(String gatewayName, String userName) {
          EntityManager em = getEntityManager();
          Gateway_Worker gatewayWorker = em.find(Gateway_Worker.class, new Gateway_Worker_PK(gatewayName, userName));
          WorkerResource workerResource = (WorkerResource) Utils.getResource(ResourceType.GATEWAY_WORKER, gatewayWorker);
@@@ -160,10 -160,10 +179,14 @@@
          try {
              EntityManager em = getEntityManager();
              em.getTransaction().begin();
--            Gateway gateway = new Gateway();
--            gateway.setGateway_name(gatewayResource.getGatewayName());
--            Users user = new Users();
--            user.setUser_name(userResource.getUserName());
++            if (!isGatewayExist(gatewayResource.getGatewayName())){
++                gatewayResource.save();
++            }
++            if (!isUserExist(userResource.getUserName())){
++                userResource.save();
++            }
++            Gateway gateway = em.find(Gateway.class, gatewayResource.getGatewayName());
++            Users user = em.find(Users.class, userResource.getUserName());
              Gateway_Worker gatewayWorker = new Gateway_Worker();
              gatewayWorker.setGateway(gateway);
              gatewayWorker.setUser(user);
@@@ -311,27 -311,27 +334,6 @@@
          }
      }
  
--//    public static List<Resource> getOrchestratorDataWithStatus(String status) {
--//        List<Resource> resourceList = new ArrayList<Resource>();
--//        EntityManager em = ResourceUtils.getEntityManager();
--//        em.getTransaction().begin();
--//        QueryGenerator generator = new QueryGenerator(AbstractResource.ORCHESTRATOR);
--//        generator.setParameter(AbstractResource.OrchestratorDataConstants.STATUS, status);
--//        Query q = generator.selectQuery(em);
--//        List<?> results = q.getResultList();
--//        if (results.size() != 0) {
--//            for (Object result : results) {
--//                Orchestrator orchestratorData = (Orchestrator) result;
--//                OrchestratorDataResource orchestratorDataResource = (OrchestratorDataResource)
--//                        Utils.getResource(ResourceType.ORCHESTRATOR, orchestratorData);
--//                resourceList.add(orchestratorDataResource);
--//            }
--//        }
--//        em.getTransaction().commit();
--//        em.close();
--//        return resourceList;
--//    }
--
      public static Lock getLock() {
          return lock;
      }

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index e642cea,e642cea..cde03c9
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@@ -23,12 -23,12 +23,11 @@@ package org.apache.airavata.persistance
  
  import org.apache.airavata.common.exception.ApplicationSettingsException;
  import org.apache.airavata.common.utils.ServerSettings;
--import org.apache.airavata.model.workspace.experiment.Experiment;
--import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
++import org.apache.airavata.model.workspace.experiment.*;
  import org.apache.airavata.persistance.registry.jpa.Resource;
  import org.apache.airavata.persistance.registry.jpa.ResourceType;
--import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
--import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
++import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
++import org.apache.airavata.persistance.registry.jpa.resources.*;
  import org.apache.airavata.registry.cpi.utils.Constants;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
@@@ -36,151 -36,151 +35,182 @@@
  import java.sql.Timestamp;
  import java.util.*;
  
--import org.apache.airavata.persistance.registry.jpa.utils.ThriftDataModelConversion;
--
  public class ExperimentRegistry {
      private GatewayRegistry gatewayRegistry;
      private UserReg userReg;
      private final static Logger logger = LoggerFactory.getLogger(ExperimentRegistry.class);
  
--    public String add(Experiment experiment) {
++    public String addExperiment(Experiment experiment) throws Exception{
          String experimentID = "";
          try {
++            if (!ResourceUtils.isUserExist(experiment.getUserName())){
++                logger.error("User does not exist in the system..");
++                throw new Exception("User does not exist in the system..");
++            }
              gatewayRegistry = new GatewayRegistry();
              GatewayResource gateway = gatewayRegistry.getDefaultGateway();
              userReg = new UserReg();
--            WorkerResource worker = userReg.getSysteUser();
++            WorkerResource worker = userReg.getExistingUser(gateway.getGatewayName(), experiment.getUserName());
              experimentID = getExperimentID(experiment.getName());
--//            ExperimentMetadataResource exBasicData = gateway.createBasicMetada(experimentID);
--//            exBasicData.setExperimentName(experiment.getExperimentName());
--//            exBasicData.setDescription(experiment.getExperimentDescription());
--//            exBasicData.setExecutionUser(experiment.getUserName());
--//            exBasicData.setSubmittedDate(getCurrentTimestamp());
--//            exBasicData.setShareExp(experiment.isSetShareExperimentPublicly());
--//            ProjectResource projectResource = worker.getProject(experiment.getProjectID());
--//            exBasicData.setProject(projectResource);
--//            exBasicData.save();
++            ExperimentResource experimentResource = new ExperimentResource();
++            experimentResource.setExpID(experimentID);
++            experimentResource.setExpName(experiment.getName());
++            experimentResource.setWorker(worker);
++            experimentResource.setGateway(gateway);
++            if (!worker.isProjectExists(experiment.getProjectID())){
++                ProjectResource project = worker.createProject(experiment.getProjectID());
++                experimentResource.setProject(project);
++            }
++            experimentResource.setCreationTime(getTime(experiment.getCreationTime()));
++            experimentResource.setDescription(experiment.getDescription());
++            experimentResource.setApplicationId(experiment.getApplicationId());
++            experimentResource.setApplicationVersion(experiment.getApplicationVersion());
++            experimentResource.setWorkflowTemplateId(experiment.getWorkflowTemplateId());
++            experimentResource.setWorkflowTemplateVersion(experiment.getWorkflowTemplateVersion());
++            experimentResource.setWorkflowExecutionId(experiment.getWorkflowExecutionInstanceId());
++            experimentResource.save();
++            List<DataObjectType> experimentInputs = experiment.getExperimentInputs();
++            addExpInputs(experimentInputs, experimentResource);
          } catch (ApplicationSettingsException e) {
              logger.error("Unable to read airavata-server properties", e.getMessage());
++        }catch (Exception e){
++            logger.error("Error while saving experiment to registry", e.getMessage());
          }
          return experimentID;
      }
  
--    public void add(UserConfigurationData configurationData, String experimentID) {
++    public void addUserConfigData(UserConfigurationData configurationData, String experimentID) {
          try {
              gatewayRegistry = new GatewayRegistry();
              GatewayResource gateway = gatewayRegistry.getDefaultGateway();
--//            ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, experimentID);
--//            ExperimentConfigDataResource exConfigData = (ExperimentConfigDataResource) exBasicData.create(ResourceType.EXPERIMENT_CONFIG_DATA);
--//            BasicMetadata updatedBasicMetadata = configurationData.getExperiment();
--//            if (updatedBasicMetadata != null) {
--//                if (updatedBasicMetadata.getExperimentName() != null && !updatedBasicMetadata.getExperimentName().equals("")) {
--//                    exBasicData.setExperimentName(updatedBasicMetadata.getExperimentName());
--//                }
--//                if (updatedBasicMetadata.getExperimentDescription() != null && !updatedBasicMetadata.getExperimentDescription().equals("")) {
--//                    exBasicData.setDescription(updatedBasicMetadata.getExperimentDescription());
--//                }
--//                if (updatedBasicMetadata.getUserName() != null && !updatedBasicMetadata.getUserName().equals("")) {
--//                    exBasicData.setExecutionUser(updatedBasicMetadata.getUserName());
--//                }
--//                exBasicData.setShareExp(updatedBasicMetadata.isSetShareExperimentPublicly());
--//                exBasicData.save();
--//            }
--//            exConfigData.setExMetadata(exBasicData);
--//            exConfigData.setApplicationID(configurationData.getApplicationId());
--//            exConfigData.setApplicationVersion(configurationData.getApplicationVersion());
--//            exConfigData.setWorkflowTemplateId(configurationData.getWorkflowTemplateId());
--//            exConfigData.setWorkflowTemplateVersion(configurationData.getWorklfowTemplateVersion());
--//
--//            ComputationalResourceScheduling resourceScheduling = configurationData.getComputationalResourceScheduling();
--//            if (resourceScheduling != null) {
--//                exConfigData.setCpuCount(resourceScheduling.getTotalCPUCount());
--//                exConfigData.setAiravataAutoSchedule(resourceScheduling.isAiravataAutoSchedule());
--//                exConfigData.setOverrideManualSchedule(resourceScheduling.isOverrideManualScheduledParams());
--//                exConfigData.setResourceHostID(resourceScheduling.getResourceHostId());
--//                exConfigData.setNodeCount(resourceScheduling.getNodeCount());
--//                exConfigData.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
--//                exConfigData.setQueueName(resourceScheduling.getQueueName());
--//                exConfigData.setWallTimeLimit(resourceScheduling.getWallTimeLimit());
--//                exConfigData.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
--//                exConfigData.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
--//                exConfigData.setProjectAccount(resourceScheduling.getComputationalProjectAccount());
--//            }
--//
--//            AdvancedInputDataHandling inputDataHandling = configurationData.getAdvanceInputDataHandling();
--//            if (inputDataHandling != null) {
--//                exConfigData.setStageInputsToWDir(inputDataHandling.isStageInputFilesToWorkingDir());
--//                exConfigData.setWorkingDirParent(inputDataHandling.getWorkingDirectoryParent());
--//                exConfigData.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
--//                exConfigData.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
--//            }
--//
--//            AdvancedOutputDataHandling outputDataHandling = configurationData.getAdvanceOutputDataHandling();
--//            if (outputDataHandling != null) {
--//                exConfigData.setOutputDataDir(outputDataHandling.getOutputdataDir());
--//                exConfigData.setDataRegURL(outputDataHandling.getDataRegistryURL());
--//                exConfigData.setPersistOutputData(outputDataHandling.isPersistOutputData());
--//            }
--//
--//            QualityOfServiceParams qosParams = configurationData.getQosParams();
--//            if (qosParams != null) {
--//                exConfigData.setStartExecutionAt(qosParams.getStartExecutionAt());
--//                exConfigData.setExecuteBefore(qosParams.getExecuteBefore());
--//                exConfigData.setNumberOfRetries(qosParams.getNumberofRetries());
--//            }
--//
--//            Map<String, String> experimentInputs = configurationData.getExperimentInputs();
--//            for (String inputKey : experimentInputs.keySet()) {
--//                ExperimentInputResource exInputResource = (ExperimentInputResource) exBasicData.create(ResourceType.EXPERIMENT_INPUT);
--//                String value = experimentInputs.get(inputKey);
--//                exInputResource.setExperimentKey(inputKey);
--//                exInputResource.setValue(value);
--//                exInputResource.setExperimentMetadataResource(exBasicData);
--//                exInputResource.save();
--//            }
--//            exConfigData.save();
++            ExperimentResource experiment = gateway.getExperiment(experimentID);
++            ConfigDataResource configData = (ConfigDataResource)experiment.create(ResourceType.CONFIG_DATA);
++            configData.setExperimentResource(experiment);
++            configData.setAiravataAutoSchedule(configurationData.isAiravataAutoSchedule());
++            configData.setOverrideManualParams(configurationData.isOverrideManualScheduledParams());
++            configData.setShareExp(configurationData.isShareExperimentPublicly());
++
++            ComputationalResourceScheduling resourceScheduling = configurationData.getComputationalResourceScheduling();
++            if (resourceScheduling != null) {
++                ComputationSchedulingResource cmsr = new ComputationSchedulingResource();
++                cmsr.setExperimentResource(experiment);
++                cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
++                cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
++                cmsr.setNodeCount(resourceScheduling.getNodeCount());
++                cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
++                cmsr.setQueueName(resourceScheduling.getQueueName());
++                cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
++                cmsr.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
++                cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
++                cmsr.setProjectName(resourceScheduling.getComputationalProjectAccount());
++                cmsr.save();
++            }
++            AdvancedInputDataHandling inputDataHandling = configurationData.getAdvanceInputDataHandling();
++            if (inputDataHandling != null) {
++                AdvanceInputDataHandlingResource adidh = new AdvanceInputDataHandlingResource();
++                adidh.setExperimentResource(experiment);
++                adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
++                adidh.setWorkingDirParent(inputDataHandling.getParentWorkingDirectory());
++                adidh.setStageInputFiles(inputDataHandling.isSetStageInputFilesToWorkingDir());
++                adidh.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
++                adidh.save();
++            }
++
++            AdvancedOutputDataHandling outputDataHandling = configurationData.getAdvanceOutputDataHandling();
++            if (outputDataHandling != null) {
++                AdvancedOutputDataHandlingResource adodh = new AdvancedOutputDataHandlingResource();
++                adodh.setExperimentResource(experiment);
++                adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
++                adodh.setDataRegUrl(outputDataHandling.getDataRegistryURL());
++                adodh.setPersistOutputData(outputDataHandling.isPersistOutputData());
++                adodh.save();
++            }
++
++            QualityOfServiceParams qosParams = configurationData.getQosParams();
++            if (qosParams != null) {
++                QosParamResource qosr = new QosParamResource();
++                qosr.setExperimentResource(experiment);
++                qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
++                qosr.setExecuteBefore(qosParams.getExecuteBefore());
++                qosr.setNoOfRetries(qosParams.getNumberofRetries());
++                qosr.save();
++            }
++            configData.save();
          } catch (ApplicationSettingsException e) {
              logger.error("Unable to read airavata-server properties", e.getMessage());
++        }catch (Exception e){
++            logger.error("Unable to save user config data", e.getMessage());
          }
      }
  
--    public String getExperimentID(String experimentName) {
--        return experimentName + "_" + UUID.randomUUID();
++    public void addExpInputs (List<DataObjectType> exInputs, ExperimentResource experimentResource ){
++        for (DataObjectType input : exInputs){
++            ExperimentInputResource resource = (ExperimentInputResource)experimentResource.create(ResourceType.EXPERIMENT_INPUT);
++            resource.setExperimentResource(experimentResource);
++            resource.setExperimentKey(input.getKey());
++            resource.setValue(input.getValue());
++            resource.setInputType(input.getType());
++            resource.setMetadata(input.getMetaData());
++            resource.save();
++        }
++    }
++
++    public void updateExpInputs (List<DataObjectType> exInputs, ExperimentResource experimentResource ){
++        List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
++        for (DataObjectType input : exInputs){
++            for (ExperimentInputResource exinput : experimentInputs){
++                if (exinput.getExperimentKey().equals(input.getKey())){
++                    exinput.setValue(input.getValue());
++                    exinput.setInputType(input.getType());
++                    exinput.setMetadata(input.getMetaData());
++                    exinput.save();
++                }
++            }
++        }
      }
  
--    public void update(Object experimentObject, String expId) {
++    public void addExpOuputs (List<DataObjectType> exOutput, String expId ) {
          try {
              gatewayRegistry = new GatewayRegistry();
--            if (experimentObject instanceof Experiment) {
--                updateBasicData((Experiment) experimentObject, expId);
--            } else if (experimentObject instanceof UserConfigurationData) {
--                updateExpConfigData((UserConfigurationData) experimentObject, expId);
++            GatewayResource gateway = gatewayRegistry.getDefaultGateway();
++            ExperimentResource experiment = gateway.getExperiment(expId);
++            for (DataObjectType output : exOutput) {
++                ExperimentOutputResource resource = (ExperimentOutputResource) experiment.create(ResourceType.EXPERIMENT_OUTPUT);
++                resource.setExperimentResource(experiment);
++                resource.setExperimentKey(output.getKey());
++                resource.setValue(output.getValue());
++                resource.setOutputType(output.getType());
++                resource.setMetadata(output.getMetaData());
++                resource.save();
              }
--
          } catch (ApplicationSettingsException e) {
              logger.error("Unable to read airavata-server properties", e.getMessage());
          }
      }
  
--    public void updateExpBasicMetadataField(String expID, String fieldName, Object value) {
++    public String getExperimentID(String experimentName) {
++        return experimentName + "_" + UUID.randomUUID();
++    }
++
++    public void updateExperimentField(String expID, String fieldName, Object value) {
          try {
              GatewayResource gateway = gatewayRegistry.getDefaultGateway();
--//            ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expID);
--//            if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.EXPERIMENT_NAME)) {
--//                exBasicData.setExperimentName((String) value);
++            ExperimentResource experiment = gateway.getExperiment(expID);
++            if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME)) {
++                experiment.setExpName((String)value);
  //                exBasicData.save();
--//            } else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.USER_NAME)) {
++            } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.USER_NAME)) {
  //                exBasicData.setExecutionUser((String) value);
  //                exBasicData.save();
--//            } else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.EXPERIMENT_DESC)) {
++            } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_DESC)) {
  //                exBasicData.setDescription((String) value);
  //                exBasicData.save();
--//            } else if (fieldName.equals(Constants.FieldConstants.BasicMetadataConstants.SHARE_EXP_PUBLIC)) {
++            } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.APPLICATION_ID)) {
  //                exBasicData.setShareExp((Boolean) value);
  //                exBasicData.save();
--//            }else {
++            }else {
                  logger.error("Unsupported field type for Experiment basic metadata");
--//            }
++            }
  
          } catch (ApplicationSettingsException e) {
              logger.error("Unable to read airavata-server properties", e.getMessage());
@@@ -260,90 -260,90 +290,85 @@@
          }
      }
  
--    public void updateBasicData(Experiment experiment, String expId) throws ApplicationSettingsException {
++    public void updateExperiment(Experiment experiment, String expId) throws ApplicationSettingsException {
          GatewayResource gateway = gatewayRegistry.getDefaultGateway();
--        WorkerResource worker = userReg.getSysteUser();
--//        ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
--//        exBasicData.setExperimentName(basicMetadata.getExperimentName());
--//        exBasicData.setDescription(basicMetadata.getExperimentDescription());
--//        exBasicData.setExecutionUser(basicMetadata.getUserName());
--//        exBasicData.setSubmittedDate(getCurrentTimestamp());
--//        exBasicData.setShareExp(basicMetadata.isSetShareExperimentPublicly());
--//        exBasicData.setProject(worker.getProject(basicMetadata.getProjectID()));
--//        exBasicData.save();
++        ExperimentResource existingExperiment = gateway.getExperiment(expId);
++        userReg = new UserReg();
++        WorkerResource worker = userReg.getExistingUser(gateway.getGatewayName(), experiment.getUserName());
++        existingExperiment.setExpName(experiment.getName());
++        existingExperiment.setWorker(worker);
++        existingExperiment.setGateway(gateway);
++        if (!worker.isProjectExists(experiment.getProjectID())){
++            ProjectResource project = worker.createProject(experiment.getProjectID());
++            existingExperiment.setProject(project);
++        }
++        existingExperiment.setCreationTime(getTime(experiment.getCreationTime()));
++        existingExperiment.setDescription(experiment.getDescription());
++        existingExperiment.setApplicationId(experiment.getApplicationId());
++        existingExperiment.setApplicationVersion(experiment.getApplicationVersion());
++        existingExperiment.setWorkflowTemplateId(experiment.getWorkflowTemplateId());
++        existingExperiment.setWorkflowTemplateVersion(experiment.getWorkflowTemplateVersion());
++        existingExperiment.setWorkflowExecutionId(experiment.getWorkflowExecutionInstanceId());
++        existingExperiment.save();
++        List<DataObjectType> experimentInputs = experiment.getExperimentInputs();
++        updateExpInputs(experimentInputs, existingExperiment);
      }
  
--    public void updateExpConfigData(UserConfigurationData configData, String expId) throws ApplicationSettingsException {
++    public void updateUserConfigData(UserConfigurationData configData, String expId) throws ApplicationSettingsException {
          GatewayResource gateway = gatewayRegistry.getDefaultGateway();
--//        ExperimentMetadataResource exBasicData = (ExperimentMetadataResource) gateway.get(ResourceType.EXPERIMENT_METADATA, expId);
--//        ExperimentConfigDataResource exConfigResource = (ExperimentConfigDataResource) exBasicData.get(ResourceType.EXPERIMENT_CONFIG_DATA, expId);
--//        BasicMetadata updatedBasicMetadata = configData.getExperiment();
--//        if (updatedBasicMetadata != null) {
--//            if (updatedBasicMetadata.getExperimentName() != null && !updatedBasicMetadata.getExperimentName().equals("")) {
--//                exBasicData.setExperimentName(updatedBasicMetadata.getExperimentName());
--//            }
--//            if (updatedBasicMetadata.getExperimentDescription() != null && !updatedBasicMetadata.getExperimentDescription().equals("")) {
--//                exBasicData.setDescription(updatedBasicMetadata.getExperimentDescription());
--//            }
--//            if (updatedBasicMetadata.getUserName() != null && !updatedBasicMetadata.getUserName().equals("")) {
--//                exBasicData.setExecutionUser(updatedBasicMetadata.getUserName());
--//            }
--//            exBasicData.setShareExp(updatedBasicMetadata.isSetShareExperimentPublicly());
--//            exBasicData.save();
--//        }
--//        exConfigResource.setExMetadata(exBasicData);
--//        exConfigResource.setApplicationID(configData.getApplicationId());
--//        exConfigResource.setApplicationVersion(configData.getApplicationVersion());
--//        exConfigResource.setWorkflowTemplateId(configData.getWorkflowTemplateId());
--//        exConfigResource.setWorkflowTemplateVersion(configData.getWorklfowTemplateVersion());
--//
--//        ComputationalResourceScheduling resourceScheduling = configData.getComputationalResourceScheduling();
--//        if (resourceScheduling != null) {
--//            exConfigResource.setCpuCount(resourceScheduling.getTotalCPUCount());
--//            exConfigResource.setAiravataAutoSchedule(resourceScheduling.isAiravataAutoSchedule());
--//            exConfigResource.setOverrideManualSchedule(resourceScheduling.isOverrideManualScheduledParams());
--//            exConfigResource.setResourceHostID(resourceScheduling.getResourceHostId());
--//            exConfigResource.setNodeCount(resourceScheduling.getNodeCount());
--//            exConfigResource.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
--//            exConfigResource.setQueueName(resourceScheduling.getQueueName());
--//            exConfigResource.setWallTimeLimit(resourceScheduling.getWallTimeLimit());
--//            exConfigResource.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
--//            exConfigResource.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
--//            exConfigResource.setProjectAccount(resourceScheduling.getComputationalProjectAccount());
--//        }
--//
--//        AdvancedInputDataHandling inputDataHandling = configData.getAdvanceInputDataHandling();
--//        if (inputDataHandling != null) {
--//            exConfigResource.setStageInputsToWDir(inputDataHandling.isStageInputFilesToWorkingDir());
--//            exConfigResource.setWorkingDirParent(inputDataHandling.getWorkingDirectoryParent());
--//            exConfigResource.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
--//            exConfigResource.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
--//        }
--//
--//        AdvancedOutputDataHandling outputDataHandling = configData.getAdvanceOutputDataHandling();
--//        if (outputDataHandling != null) {
--//            exConfigResource.setOutputDataDir(outputDataHandling.getOutputdataDir());
--//            exConfigResource.setDataRegURL(outputDataHandling.getDataRegistryURL());
--//            exConfigResource.setPersistOutputData(outputDataHandling.isPersistOutputData());
--//        }
--//
--//        QualityOfServiceParams qosParams = configData.getQosParams();
--//        if (qosParams != null) {
--//            exConfigResource.setStartExecutionAt(qosParams.getStartExecutionAt());
--//            exConfigResource.setExecuteBefore(qosParams.getExecuteBefore());
--//            exConfigResource.setNumberOfRetries(qosParams.getNumberofRetries());
--//        }
--//
--//        Map<String, String> experimentInputs = configData.getExperimentInputs();
--//        for (String inputKey : experimentInputs.keySet()) {
--//            ExperimentInputResource exInputResource = (ExperimentInputResource) exBasicData.create(ResourceType.EXPERIMENT_INPUT);
--//            String value = experimentInputs.get(inputKey);
--//            exInputResource.setExperimentKey(inputKey);
--//            exInputResource.setValue(value);
--//            exInputResource.setExperimentMetadataResource(exBasicData);
--//            exInputResource.save();
--//        }
--//        exConfigResource.save();
++        ExperimentResource experiment = gateway.getExperiment(expId);
++        ConfigDataResource resource = (ConfigDataResource)experiment.get(ResourceType.CONFIG_DATA, expId);
++        resource.setExperimentResource(experiment);
++        resource.setAiravataAutoSchedule(configData.isAiravataAutoSchedule());
++        resource.setOverrideManualParams(configData.isOverrideManualScheduledParams());
++        resource.setShareExp(configData.isShareExperimentPublicly());
++
++        ComputationalResourceScheduling resourceScheduling = configData.getComputationalResourceScheduling();
++        if (resourceScheduling != null) {
++            ComputationSchedulingResource cmsr = experiment.getComputationScheduling(expId);
++            cmsr.setExperimentResource(experiment);
++            cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
++            cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
++            cmsr.setNodeCount(resourceScheduling.getNodeCount());
++            cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
++            cmsr.setQueueName(resourceScheduling.getQueueName());
++            cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
++            cmsr.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
++            cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
++            cmsr.setProjectName(resourceScheduling.getComputationalProjectAccount());
++            cmsr.save();
++        }
++        AdvancedInputDataHandling inputDataHandling = configData.getAdvanceInputDataHandling();
++        if (inputDataHandling != null) {
++            AdvanceInputDataHandlingResource adidh = experiment.getInputDataHandling(expId);
++            adidh.setExperimentResource(experiment);
++            adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
++            adidh.setWorkingDirParent(inputDataHandling.getParentWorkingDirectory());
++            adidh.setStageInputFiles(inputDataHandling.isSetStageInputFilesToWorkingDir());
++            adidh.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
++            adidh.save();
++        }
++
++        AdvancedOutputDataHandling outputDataHandling = configData.getAdvanceOutputDataHandling();
++        if (outputDataHandling != null) {
++            AdvancedOutputDataHandlingResource adodh = experiment.getOutputDataHandling(expId);
++            adodh.setExperimentResource(experiment);
++            adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
++            adodh.setDataRegUrl(outputDataHandling.getDataRegistryURL());
++            adodh.setPersistOutputData(outputDataHandling.isPersistOutputData());
++            adodh.save();
++        }
++
++        QualityOfServiceParams qosParams = configData.getQosParams();
++        if (qosParams != null) {
++            QosParamResource qosr = experiment.getQOSparams(expId);
++            qosr.setExperimentResource(experiment);
++            qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
++            qosr.setExecuteBefore(qosParams.getExecuteBefore());
++            qosr.setNoOfRetries(qosParams.getNumberofRetries());
++            qosr.save();
++        }
++        resource.save();
      }
  
      public List<Experiment> getExperimentMetaDataList (String fieldName, Object value){
@@@ -532,9 -532,9 +557,8 @@@
          return new Timestamp(d.getTime());
      }
  
--    public Timestamp getTime(int time) {
--        long timeInMileseconds = time * 1000L;
--        Date date = new Date(timeInMileseconds);
++    public Timestamp getTime(long time) {
++        Date date = new Date(time);
          return new Timestamp(date.getTime());
      }
  }

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index d6f8e7b,d6f8e7b..b9ea761
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@@ -21,6 -21,6 +21,7 @@@
  
  package org.apache.airavata.persistance.registry.jpa.impl;
  
++import org.apache.airavata.model.workspace.experiment.DataObjectType;
  import org.apache.airavata.model.workspace.experiment.Experiment;
  import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
  import org.apache.airavata.registry.cpi.ChildDataType;
@@@ -47,10 -47,10 +48,10 @@@ public class RegistryImpl implements Re
       * @return return the identifier to identify the object
       */
      @Override
--    public Object add(ParentDataType dataType, Object newObjectToAdd) {
++    public Object add(ParentDataType dataType, Object newObjectToAdd) throws Exception{
          switch (dataType){
              case EXPERIMENT:
--                return experimentRegistry.add((Experiment) newObjectToAdd);
++                return experimentRegistry.addExperiment((Experiment) newObjectToAdd);
              default:
                  logger.error("Unsupported top level type..", new UnsupportedOperationException());
                  throw new UnsupportedOperationException();
@@@ -69,16 -69,16 +70,13 @@@
       *                            null
       */
      @Override
--    public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier) {
++    public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier) throws Exception{
          switch (dataType){
              case EXPERIMENT_CONFIGURATION_DATA:
--                experimentRegistry.add((UserConfigurationData)newObjectToAdd, (String)dependentIdentifier);
--                break;
--            case EXPERIMENT_INPUT:
--                // no thrift model yet
++                experimentRegistry.addUserConfigData((UserConfigurationData) newObjectToAdd, dependentIdentifier);
                  break;
              case EXPERIMENT_OUTPUT:
--                // no thrift model yet
++                experimentRegistry.addExpOuputs((List<DataObjectType>)newObjectToAdd, dependentIdentifier);
                  break;
              case TASK_DETAIL:
                  // no thrift model yet
@@@ -134,19 -134,19 +132,18 @@@
       *                       other fields that need to be updated.
       */
      @Override
--    public void update(DataType dataType, Object newObjectToUpdate, String identifier) {
++    public void update(DataType dataType, Object newObjectToUpdate, String identifier) throws Exception {
          switch (dataType){
              case EXPERIMENT:
--                experimentRegistry.update(newObjectToUpdate, identifier);
++                experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, identifier);
                  break;
              case EXPERIMENT_CONFIGURATION_DATA:
--                experimentRegistry.update(newObjectToUpdate, identifier);
++                experimentRegistry.updateUserConfigData((UserConfigurationData) newObjectToUpdate, identifier);
                  break;
              default:
                  logger.error("Unsupported data type...", new UnsupportedOperationException());
                  throw new UnsupportedOperationException();
          }
--
      }
  
      /**
@@@ -162,10 -162,10 +159,10 @@@
       *              updated by given value
       */
      @Override
--    public void update(DataType dataType, String identifier, String fieldName, Object value) {
++    public void update(DataType dataType, String identifier, String fieldName, Object value) throws Exception {
          switch (dataType){
              case EXPERIMENT:
--                experimentRegistry.updateExpBasicMetadataField(identifier, fieldName, value);
++                experimentRegistry.updateExperimentField(identifier, fieldName, value);
                  break;
              case EXPERIMENT_CONFIGURATION_DATA:
                  experimentRegistry.updateExpConfigDataField(identifier, fieldName, value);
@@@ -186,7 -186,7 +183,7 @@@
       * @return object according to the given identifier.
       */
      @Override
--    public Object get(DataType dataType, String identifier) {
++    public Object get(DataType dataType, String identifier) throws Exception {
  
          switch (dataType){
              case EXPERIMENT:
@@@ -209,7 -209,7 +206,7 @@@
       * @return List of objects according to the given criteria
       */
      @Override
--    public List<Object> get(DataType dataType, String fieldName, Object value) {
++    public List<Object> get(DataType dataType, String fieldName, Object value) throws Exception{
          List<Object> result = new ArrayList<Object>();
          switch (dataType){
              case EXPERIMENT:
@@@ -242,7 -242,7 +239,7 @@@
       *         given
       */
      @Override
--    public Object getValue(DataType dataType, String identifier, String field) {
++    public Object getValue(DataType dataType, String identifier, String field) throws Exception {
          switch (dataType){
              case EXPERIMENT:
                  return experimentRegistry.getBasicMetaData(identifier, field);
@@@ -266,7 -266,7 +263,7 @@@
       * @return id list according to the filtering criteria
       */
      @Override
--    public List<String> getIds(DataType dataType, String fieldName, Object value) {
++    public List<String> getIds(DataType dataType, String fieldName, Object value) throws Exception {
          switch (dataType){
              case EXPERIMENT:
                  return experimentRegistry.getExperimentIDs(fieldName, value);
@@@ -286,7 -286,7 +283,7 @@@
       *                   identifier will be generated experimentID
       */
      @Override
--    public void remove(DataType dataType, String identifier) {
++    public void remove(DataType dataType, String identifier) throws Exception {
          switch (dataType){
              case EXPERIMENT:
                  experimentRegistry.removeExperiment(identifier);
@@@ -308,7 -308,7 +305,7 @@@
       * @return whether the given data type exists or not
       */
      @Override
--    public boolean isExist(DataType dataType, String identifier) {
++    public boolean isExist(DataType dataType, String identifier) throws Exception {
          switch (dataType){
              case EXPERIMENT:
                  return experimentRegistry.isExperimentBasicDataExist(identifier);

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
index 8543c35,8543c35..1c8a2c9
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java
@@@ -24,10 -24,10 +24,11 @@@ package org.apache.airavata.persistance
  import org.apache.airavata.common.exception.ApplicationSettingsException;
  import org.apache.airavata.common.utils.ServerSettings;
  import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
++import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
  import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
  
  public class UserReg {
--    public WorkerResource getSysteUser () throws ApplicationSettingsException {
++    public WorkerResource getSystemUser() throws ApplicationSettingsException {
          WorkerResource worker = (WorkerResource)ResourceUtils.getWorker(ServerSettings.getSystemUserGateway(), ServerSettings.getSystemUser());
          return worker;
      }
@@@ -36,4 -36,4 +37,7 @@@
          WorkerResource worker = (WorkerResource)ResourceUtils.getWorker(gatewayName, userName);
          return worker;
      }
++
++
++
  }

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/DataTransferDetailResource.java
index f95ad0a,f95ad0a..76849e1
--- 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
@@@ -28,6 -28,6 +28,7 @@@ import org.apache.airavata.persistance.
  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.apache.airavata.registry.cpi.utils.StatusType;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -196,4 -196,4 +197,15 @@@ public class DataTransferDetailResourc
          em.getTransaction().commit();
          em.close();
      }
++
++    public StatusResource getDataTransferStatus (){
++        List<Resource> resources = get(ResourceType.STATUS);
++        for (Resource resource : resources) {
++            StatusResource dataTransferStatus = (StatusResource) resource;
++            if(dataTransferStatus.getStatusType().equals(StatusType.DATA_TRANSFER)){
++                return dataTransferStatus;
++            }
++        }
++        return null;
++    }
  }

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
index 246bb00,246bb00..3b7ab5a
--- 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
@@@ -99,10 -99,10 +99,6 @@@ public class GatewayResource extends Ab
                  ProjectResource projectResource = new ProjectResource();
                  projectResource.setGateway(this);
                  return projectResource;
--            case USER:
--                UserResource userResource = new UserResource();
--                userResource.setGatewayName(this.getGatewayName());
--                return userResource;
              case PUBLISHED_WORKFLOW:
                  PublishWorkflowResource publishWorkflowResource = new PublishWorkflowResource();
                  publishWorkflowResource.setGateway(this);
@@@ -744,5 -744,5 +740,9 @@@
          metadataResource.setExpID(experimentID);
          return metadataResource;
      }
++
++    public ExperimentResource getExperiment (String expId){
++        return (ExperimentResource)get(ResourceType.EXPERIMENT, expId);
++    }
  }
  

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
index 7fe82bb,7fe82bb..25871f5
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
@@@ -39,9 -39,9 +39,6 @@@ public class UserResource extends Abstr
      private final static Logger logger = LoggerFactory.getLogger(UserResource.class);
      private String userName;
      private String password;
--    private String gatewayName;
--    private ProjectResource projectResource;
--
      /**
       *
       */
@@@ -64,21 -64,21 +61,6 @@@
          return userName;
      }
  
--    /**
--     *
--     * @return gateway name
--     */
--    public String getGatewayName() {
--        return gatewayName;
--    }
--
--    /**
--     *
--     * @param gatewayName gateway name
--     */
--    public void setGatewayName(String gatewayName) {
--        this.gatewayName = gatewayName;
--    }
  
      /**
       * User is a hypothical data structure.
@@@ -172,22 -172,22 +154,6 @@@
  
      /**
       *
--     * @return project resource
--     */
--    public ProjectResource getProjectResource() {
--        return projectResource;
--    }
--
--    /**
--     *
--     * @param projectResource project resource
--     */
--    public void setProjectResource(ProjectResource projectResource) {
--        this.projectResource = projectResource;
--    }
--
--    /**
--     *
       * @return  password
       */
      public String getPassword() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index 9d837a3,9d837a3..9a85896
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@@ -53,9 -53,9 +53,9 @@@ public class ThriftDataModelConversion 
          List<StatusResource> changeList = experimentResource.getWorkflowNodeStatuses();
          experiment.setStateChangeList(getWorkflowNodeStatusList(changeList));
          List<WorkflowNodeDetailResource> workflowNodeDetails = experimentResource.getWorkflowNodeDetails();
--
--//        experiment.setWorkflowNodeDetailsList();
--
++        experiment.setWorkflowNodeDetailsList(getWfNodeList(workflowNodeDetails));
++        List<ErrorDetailResource> errorDetails = experimentResource.getErrorDetails();
++        experiment.setErrors(getErrorDetailList(errorDetails));
          return experiment;
      }
  
@@@ -190,6 -190,6 +190,13 @@@
          return jobStatus;
      }
  
++    public static TransferStatus getTransferStatus (StatusResource status){
++        TransferStatus transferStatus = new TransferStatus();
++        transferStatus.setTransferState(TransferState.valueOf(status.getState()));
++        transferStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
++        return transferStatus;
++    }
++
      public static ApplicationStatus getApplicationStatus (StatusResource status){
          ApplicationStatus applicationStatus = new ApplicationStatus();
          applicationStatus.setApplicationState(status.getState());
@@@ -215,13 -215,13 +222,21 @@@
          List<NodeOutputResource> nodeOutputs = nodeDetailResource.getNodeOutputs();
          wfNode.setNodeOutputs(getNodeOutputs(nodeOutputs));
          List<TaskDetailResource> taskDetails = nodeDetailResource.getTaskDetails();
--
--        //get taskdetails
--        //get workflownodestatus
--        //geterrordetails
++        wfNode.setTaskDetailsList(getTaskDetailsList(taskDetails));
++        wfNode.setWorkflowNodeStatus(getWorkflowNodeStatus(nodeDetailResource.getWorkflowNodeStatus()));
++        List<ErrorDetailResource> errorDetails = nodeDetailResource.getErrorDetails();
++        wfNode.setErrors(getErrorDetailList(errorDetails));
          return wfNode;
      }
  
++    public static List<WorkflowNodeDetails> getWfNodeList (List<WorkflowNodeDetailResource> resources){
++        List<WorkflowNodeDetails> workflowNodeDetailsList = new ArrayList<WorkflowNodeDetails>();
++        for (WorkflowNodeDetailResource resource : resources){
++            workflowNodeDetailsList.add(getWorkflowNodeDetails(resource));
++        }
++        return workflowNodeDetailsList;
++    }
++
      public static TaskDetails getTaskDetail (TaskDetailResource taskDetailResource){
          TaskDetails taskDetails = new TaskDetails();
          taskDetails.setTaskID(taskDetailResource.getTaskId());
@@@ -239,9 -239,9 +254,29 @@@
          taskDetails.setAdvancedOutputDataHandling(getAdvanceOutputDataHandling(outputDataHandling));
          taskDetails.setTaskStatus(getTaskStatus(taskDetailResource.getTaskStatus()));
          List<JobDetailResource> jobDetailList = taskDetailResource.getJobDetailList();
++        taskDetails.setJobDetailsList(getJobDetailsList(jobDetailList));
++        taskDetails.setErrors(getErrorDetailList(taskDetailResource.getErrorDetailList()));
++        taskDetails.setDataTransferDetailsList(getDataTransferlList(taskDetailResource.getDataTransferDetailList()));
          return taskDetails;
      }
  
++    public static List<TaskDetails> getTaskDetailsList (List<TaskDetailResource> resources){
++        List<TaskDetails> taskDetailsList = new ArrayList<TaskDetails>();
++        for (TaskDetailResource resource : resources){
++            taskDetailsList.add(getTaskDetail(resource));
++        }
++        return taskDetailsList;
++    }
++
++    public static List<JobDetails> getJobDetailsList(List<JobDetailResource> jobs){
++        List<JobDetails> jobDetailsList = new ArrayList<JobDetails>();
++        for (JobDetailResource resource : jobs){
++            jobDetailsList.add(getJobDetail(resource));
++        }
++        return jobDetailsList;
++    }
++
++
      public static JobDetails getJobDetail(JobDetailResource jobDetailResource){
          JobDetails jobDetails = new JobDetails();
          jobDetails.setJobID(jobDetailResource.getJobId());
@@@ -252,8 -252,8 +287,9 @@@
          StatusResource applicationStatus = jobDetailResource.getApplicationStatus();
          jobDetails.setApplicationStatus(getApplicationStatus(applicationStatus));
          List<ErrorDetailResource> errorDetails = jobDetailResource.getErrorDetails();
++        jobDetails.setErrors(getErrorDetailList(errorDetails));
++        jobDetails.setComputeResourceConsumed(jobDetailResource.getComputeResourceConsumed());
          return jobDetails;
--
      }
  
      public static ErrorDetails getErrorDetails (ErrorDetailResource resource){
@@@ -266,26 -266,26 +302,52 @@@
          errorDetails.setTransientOrPersistent(resource.isTransientPersistent());
          errorDetails.setCorrectiveAction(CorrectiveAction.valueOf(resource.getCorrectiveAction()));
          errorDetails.setActionableGroup(ActionableGroup.valueOf(resource.getActionableGroup()));
--//        errorDetails.setRootCauseErrorIdList();
          return errorDetails;
  
      }
  
++    public static List<ErrorDetails> getErrorDetailList (List<ErrorDetailResource> errorDetailResources){
++        List<ErrorDetails> errorDetailsList = new ArrayList<ErrorDetails>();
++        for (ErrorDetailResource errorDetailResource : errorDetailResources){
++            errorDetailsList.add(getErrorDetails(errorDetailResource));
++        }
++        return errorDetailsList;
++    }
++
++    public static DataTransferDetails getDataTransferDetail (DataTransferDetailResource resource){
++        DataTransferDetails details = new DataTransferDetails();
++        details.setTransferID(resource.getTransferId());
++        details.setCreationTime(resource.getCreationTime().getTime());
++        details.setTransferDescription(resource.getTransferDescription());
++        details.setTransferStatus(getTransferStatus(resource.getDataTransferStatus()));
++        return details;
++    }
++
++    public static List<DataTransferDetails> getDataTransferlList (List<DataTransferDetailResource> resources){
++        List<DataTransferDetails> transferDetailsList = new ArrayList<DataTransferDetails>();
++        for (DataTransferDetailResource resource : resources){
++            transferDetailsList.add(getDataTransferDetail(resource));
++        }
++        return transferDetailsList;
++    }
++
  
--//    public static ConfigurationData getConfigurationData (ExperimentConfigDataResource excd){
--//        ConfigurationData configData = new ConfigurationData();
--//        configData.setBasicMetadata(getExperiment(excd.getExMetadata()));
--//        configData.setApplicationId(excd.getApplicationID());
--//        configData.setApplicationVersion(excd.getApplicationVersion());
--//        configData.setWorkflowTemplateId(excd.getWorkflowTemplateId());
--//        configData.setWorklfowTemplateVersion(excd.getWorkflowTemplateVersion());
--//        configData.setExperimentInputs(getExperimentInputs(excd.getExMetadata()));
--//        configData.setAdvanceInputDataHandling(getAdvanceInputDataHandling(excd));
--//        configData.setAdvanceOutputDataHandling(getAdvanceOutputDataHandling(excd));
--//        configData.setComputationalResourceScheduling(getComputationalResourceScheduling(excd));
--//        configData.setQosParams(getQOSParams(excd));
--//        return configData;
--//    }
++    public static UserConfigurationData getUserConfigData (ConfigDataResource resource){
++        UserConfigurationData data = new UserConfigurationData();
++        data.setAiravataAutoSchedule(resource.isAiravataAutoSchedule());
++        data.setOverrideManualScheduledParams(resource.isOverrideManualParams());
++        data.setShareExperimentPublicly(resource.isShareExp());
++        ExperimentResource experimentResource = resource.getExperimentResource();
++        String expID = experimentResource.getExpID();
++        ComputationSchedulingResource computationScheduling = experimentResource.getComputationScheduling(expID);
++        AdvanceInputDataHandlingResource inputDataHandling = experimentResource.getInputDataHandling(expID);
++        AdvancedOutputDataHandlingResource outputDataHandling = experimentResource.getOutputDataHandling(expID);
++        data.setAdvanceInputDataHandling(getAdvanceInputDataHandling(inputDataHandling));
++        data.setAdvanceOutputDataHandling(getAdvanceOutputDataHandling(outputDataHandling));
++        data.setComputationalResourceScheduling(getComputationalResourceScheduling(computationScheduling));
++        data.setQosParams(getQOSParams(experimentResource.getQOSparams(expID)));
++        return data;
++    }
  
  
      public static ComputationalResourceScheduling getComputationalResourceScheduling (ComputationSchedulingResource csr){

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
----------------------------------------------------------------------
diff --cc modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
index 8c0ce32,ca419ec..0000000
deleted file mode 100644,100644
--- a/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ProjectResourceTest.java
+++ /dev/null
@@@ -1,81 -1,81 +1,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;
- 
- import org.apache.airavata.persistance.registry.jpa.resources.*;
- 
- import java.sql.Timestamp;
- import java.util.Calendar;
- 
- public class ProjectResourceTest extends AbstractResourceTest {
-     private GatewayResource gatewayResource;
-     private WorkerResource workerResource;
-     private ProjectResource projectResource;
-     private ExperimentMetadataResource experimentResource;
- 
-     @Override
-     public void setUp() throws Exception {
-         super.setUp();
-         gatewayResource = super.getGatewayResource();
-         workerResource = super.getWorkerResource();
-         projectResource = workerResource.createProject("testProject");
-         projectResource.setGateway(gatewayResource);
-         projectResource.setWorker(workerResource);
-         projectResource.save();
- 
-         experimentResource = projectResource.createExperiment("testExpID");
-         experimentResource.setGateway(gatewayResource);
-         experimentResource.setExperimentName("testExpID");
-         experimentResource.setExecutionUser(workerResource.getUser());
-         experimentResource.setSubmittedDate(getCurrentTimestamp());
-         experimentResource.setProject(projectResource);
-         experimentResource.save();
-     }
- 
-     public void testCreate() throws Exception {
-         assertNotNull("experiment resource created successfully", experimentResource);
-     }
- 
-     public void testGet() throws Exception {
-         ExperimentMetadataResource experiment = projectResource.getExperiment("testExpID");
-         assertNotNull("experiment resource retrieved successfully", experiment);
-     }
- 
-     public void testGetList() throws Exception {
-         assertNotNull("experiment resources retrieved successfully", projectResource.getExperiments());
-     }
- 
-     public void testSave() throws Exception {
-         assertTrue("Project saved successfully", workerResource.isProjectExists("testProject"));
-     }
- 
- 
- //    public void testRemove() throws Exception {
- //        projectResource.removeExperiment("testExpID");
- //        assertFalse("experiment removed successfully", projectResource.isExperimentExists("testExpID"));
- //    }
- 
-     @Override
-     public void tearDown() throws Exception {
-         super.tearDown();
-     }
- }
 -///*
 -//*
 -//* 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;
 -//
 -//import org.apache.airavata.persistance.registry.jpa.resources.*;
 -//
 -//import java.sql.Timestamp;
 -//import java.util.Calendar;
 -//
 -//public class ProjectResourceTest extends AbstractResourceTest {
 -//    private GatewayResource gatewayResource;
 -//    private WorkerResource workerResource;
 -//    private ProjectResource projectResource;
 -//    private ExperimentResource experimentResource;
 -//
 -//    @Override
 -//    public void setUp() throws Exception {
 -//        super.setUp();
 -//        gatewayResource = super.getGatewayResource();
 -//        workerResource = super.getWorkerResource();
 -//        projectResource = workerResource.createProject("testProject");
 -//        projectResource.setGateway(gatewayResource);
 -//        projectResource.setWorker(workerResource);
 -//        projectResource.save();
 -//
 -//        experimentResource = projectResource.createExperiment("testExpID");
 -//        experimentResource.setGateway(gatewayResource);
 -//        experimentResource.setExperimentName("testExpID");
 -//        experimentResource.setExecutionUser(workerResource.getUser());
 -//        experimentResource.setSubmittedDate(getCurrentTimestamp());
 -//        experimentResource.setProject(projectResource);
 -//        experimentResource.save();
 -//    }
 -//
 -//    public void testCreate() throws Exception {
 -//        assertNotNull("experiment resource created successfully", experimentResource);
 -//    }
 -//
 -//    public void testGet() throws Exception {
 -//        ExperimentMetadataResource experiment = projectResource.getExperiment("testExpID");
 -//        assertNotNull("experiment resource retrieved successfully", experiment);
 -//    }
 -//
 -//    public void testGetList() throws Exception {
 -//        assertNotNull("experiment resources retrieved successfully", projectResource.getExperiments());
 -//    }
 -//
 -//    public void testSave() throws Exception {
 -//        assertTrue("Project saved successfully", workerResource.isProjectExists("testProject"));
 -//    }
 -//
 -//
 -////    public void testRemove() throws Exception {
 -////        projectResource.removeExperiment("testExpID");
 -////        assertFalse("experiment removed successfully", projectResource.isExperimentExists("testExpID"));
 -////    }
 -//
 -//    @Override
 -//    public void tearDown() throws Exception {
 -//        super.tearDown();
 -//    }
 -//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
----------------------------------------------------------------------
diff --cc modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
index cf2ee91,cf2ee91..531f281
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
@@@ -16,7 -16,7 +16,7 @@@ public interface Registry 
       *                       etc
       * @return return the identifier to identify the object
       */
--    public Object add(ParentDataType dataType, Object newObjectToAdd);
++    public Object add(ParentDataType dataType, Object newObjectToAdd) throws Exception ;
  
      /**
       * This method is to add an object in to the registry
@@@ -29,7 -29,7 +29,7 @@@
       *                            level object in the data model. If it is a top level object, programmer can pass it as
       *                            null
       */
--    public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier);
++    public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier) throws Exception;
  
      /**
       * This method is to update the whole object in registry
@@@ -41,7 -41,7 +41,7 @@@
       *                       have to fill the whole object. He needs to only fill the mandatory fields and whatever the
       *                       other fields that need to be updated.
       */
--    public void update(DataType dataType, Object newObjectToUpdate, String identifier);
++    public void update(DataType dataType, Object newObjectToUpdate, String identifier) throws Exception;
  
  
      /**
@@@ -56,7 -56,7 +56,7 @@@
       * @param value Value by which the given field need to be updated. If the field is "description", that field will be
       *              updated by given value
       */
--    public void update(DataType dataType, String identifier, String fieldName, Object value);
++    public void update(DataType dataType, String identifier, String fieldName, Object value) throws Exception;
  
      /**
       * This method is to retrieve object according to the identifier. In the experiment basic data type, if you give the
@@@ -67,7 -67,7 +67,7 @@@
       *                   identifier will be generated experimentID
       * @return object according to the given identifier.
       */
--    public Object get(DataType dataType, String identifier);
++    public Object get(DataType dataType, String identifier) throws Exception;
  
      /**
       * This method is to retrieve list of objects according to a given criteria
@@@ -78,7 -78,7 +78,7 @@@
       * @param value value for the filtering field. In the experiment case, value for "userName" can be "admin"
       * @return List of objects according to the given criteria
       */
--    public List<Object> get(DataType dataType, String fieldName, Object value);
++    public List<Object> get(DataType dataType, String fieldName, Object value) throws Exception;
  
      /**
       * This method is to retrieve a specific value for a given field.
@@@ -91,7 -91,7 +91,7 @@@
       * @return return the value for the specific field where data model is identified by the unique identifier that has
       *         given
       */
--    public Object getValue (DataType dataType, String identifier, String field);
++    public Object getValue (DataType dataType, String identifier, String field) throws Exception;
  
      /**
       * This method is to retrieve all the identifiers according to given filtering criteria. For an example, if you want
@@@ -104,7 -104,7 +104,7 @@@
       * @param value value for the filtering field. In the experiment case, value for "userName" can be "admin"
       * @return id list according to the filtering criteria
       */
--    public List<String> getIds (DataType dataType, String fieldName, Object value);
++    public List<String> getIds (DataType dataType, String fieldName, Object value) throws Exception;
  
      /**
       * This method is to remove a item from the registry
@@@ -113,7 -113,7 +113,7 @@@
       * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type,
       *                   identifier will be generated experimentID
       */
--    public void remove (DataType dataType, String identifier);
++    public void remove (DataType dataType, String identifier) throws Exception;
  
      /**
       * This method will check whether a given data type which can be identified with the identifier exists or not
@@@ -123,7 -123,7 +123,7 @@@
       *                   identifier will be generated experimentID
       * @return whether the given data type exists or not
       */
--    public boolean isExist(DataType dataType, String identifier);
++    public boolean isExist(DataType dataType, String identifier) throws Exception;
  
  
  }

http://git-wip-us.apache.org/repos/asf/airavata/blob/64e2cc49/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
----------------------------------------------------------------------
diff --cc modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
index 4828e0f,4828e0f..a54f8f1
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/utils/Constants.java
@@@ -28,7 -28,7 +28,6 @@@ public class Constants 
              public static final String USER_NAME = "userName";
              public static final String GATEWAY = "gateway";
              public static final String EXPERIMENT_DESC = "experimentDescription";
--            public static final String SHARE_EXP_PUBLIC = "shareExperimentPublicly";
              public static final String PROJECT_NAME = "project";
              public static final String CREATION_TIME = "creationTime";
              public static final String APPLICATION_ID = "applicationId";


Mime
View raw message