airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [34/44] airavata git commit: Mongo Registry WIP
Date Sun, 07 Jun 2015 17:01:15 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
deleted file mode 100644
index ab9d924..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-package org.apache.airavata.persistance.registry.jpa.resources;
-
-import org.apache.airavata.persistance.registry.jpa.Resource;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.*;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.utils.StatusType;
-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 ExperimentResource extends AbstractResource {
-    private static final Logger logger = LoggerFactory.getLogger(ExperimentResource.class);
-//    private WorkerResource worker;
-    private String executionUser;
-    private String expID;
-    private Timestamp creationTime;
-    private GatewayResource gateway;
-    private ProjectResource project;
-    private String expName;
-    private String description;
-    private String applicationId;
-    private String applicationVersion;
-    private String workflowTemplateId;
-    private String workflowTemplateVersion;
-    private String workflowExecutionId;
-    private boolean enableEmailNotifications;
-    private String gatewayExecutionId;
-
-    /**
-     *
-     * @return  experiment ID
-     */
-    public String getExpID() {
-        return expID;
-    }
-
-    public Timestamp getCreationTime() {
-        return creationTime;
-    }
-
-    public void setCreationTime(Timestamp creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public String getExpName() {
-        return expName;
-    }
-
-    public void setExpName(String expName) {
-        this.expName = expName;
-    }
-
-    public String getApplicationId() {
-        return applicationId;
-    }
-
-    public void setApplicationId(String applicationId) {
-        this.applicationId = applicationId;
-    }
-
-    public String getApplicationVersion() {
-        return applicationVersion;
-    }
-
-    public void setApplicationVersion(String applicationVersion) {
-        this.applicationVersion = applicationVersion;
-    }
-
-    public String getWorkflowTemplateId() {
-        return workflowTemplateId;
-    }
-
-    public void setWorkflowTemplateId(String workflowTemplateId) {
-        this.workflowTemplateId = workflowTemplateId;
-    }
-
-    public String getWorkflowTemplateVersion() {
-        return workflowTemplateVersion;
-    }
-
-    public void setWorkflowTemplateVersion(String workflowTemplateVersion) {
-        this.workflowTemplateVersion = workflowTemplateVersion;
-    }
-
-    public String getWorkflowExecutionId() {
-        return workflowExecutionId;
-    }
-
-    public void setWorkflowExecutionId(String workflowExecutionId) {
-        this.workflowExecutionId = workflowExecutionId;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public boolean isEnableEmailNotifications() {
-        return enableEmailNotifications;
-    }
-
-    public void setEnableEmailNotifications(boolean enableEmailNotifications) {
-        this.enableEmailNotifications = enableEmailNotifications;
-    }
-
-    public String getGatewayExecutionId() {
-        return gatewayExecutionId;
-    }
-
-    public void setGatewayExecutionId(String gatewayExecutionId) {
-        this.gatewayExecutionId = gatewayExecutionId;
-    }
-
-    /**
-     * Since experiments are at the leaf level, this method is not
-     * valid for an experiment
-     * @param type  child resource types
-     * @return UnsupportedOperationException
-     */
-    public Resource create(ResourceType type) throws RegistryException {
-    	switch (type){
-	        case EXPERIMENT_INPUT:
-	        	ExperimentInputResource inputResource = new ExperimentInputResource();
-	            inputResource.setExperimentResource(this);
-	            return inputResource;
-            case EXPERIMENT_OUTPUT:
-                ExperimentOutputResource experimentOutputResource = new ExperimentOutputResource();
-                experimentOutputResource.setExperimentResource(this);
-                return experimentOutputResource;
-            case NOTIFICATION_EMAIL:
-                NotificationEmailResource emailResource = new NotificationEmailResource();
-                emailResource.setExperimentResource(this);
-                return emailResource;
-            case WORKFLOW_NODE_DETAIL:
-                WorkflowNodeDetailResource nodeDetailResource = new WorkflowNodeDetailResource();
-                nodeDetailResource.setExperimentResource(this);
-                return nodeDetailResource;
-            case ERROR_DETAIL:
-                ErrorDetailResource errorDetailResource = new ErrorDetailResource();
-                errorDetailResource.setExperimentResource(this);
-                return errorDetailResource;
-            case STATUS:
-                StatusResource statusResource = new StatusResource();
-                statusResource.setExperimentResource(this);
-                return statusResource;
-            case CONFIG_DATA:
-                ConfigDataResource configDataResource = new ConfigDataResource();
-                configDataResource.setExperimentResource(this);
-                return configDataResource;
-            case COMPUTATIONAL_RESOURCE_SCHEDULING:
-                ComputationSchedulingResource schedulingResource = new ComputationSchedulingResource();
-                schedulingResource.setExperimentResource(this);
-                return schedulingResource;
-            case ADVANCE_INPUT_DATA_HANDLING:
-                AdvanceInputDataHandlingResource dataHandlingResource = new AdvanceInputDataHandlingResource();
-                dataHandlingResource.setExperimentResource(this);
-                return dataHandlingResource;
-            case ADVANCE_OUTPUT_DATA_HANDLING:
-                AdvancedOutputDataHandlingResource outputDataHandlingResource = new AdvancedOutputDataHandlingResource();
-                outputDataHandlingResource.setExperimentResource(this);
-                return outputDataHandlingResource;
-            case QOS_PARAM:
-                QosParamResource qosParamResource = new QosParamResource();
-                qosParamResource.setExperimentResource(this);
-                return qosParamResource;
-	        default:
-                logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
-	            throw new IllegalArgumentException("Unsupported resource type for experiment resource.");
-	    }
-    }
-
-    /**
-     *
-     * @param type  child resource types
-     * @param name name of the child resource
-     * @return UnsupportedOperationException
-     */
-    public void remove(ResourceType type, Object name) throws RegistryException {
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            switch (type) {
-                case EXPERIMENT_INPUT:
-                    generator = new QueryGenerator(EXPERIMENT_INPUT);
-                    generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case EXPERIMENT_OUTPUT:
-                    generator = new QueryGenerator(EXPERIMENT_OUTPUT);
-                    generator.setParameter(ExperimentOutputConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case NOTIFICATION_EMAIL:
-                    generator = new QueryGenerator(NOTIFICATION_EMAIL);
-                    generator.setParameter(NotificationEmailConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case WORKFLOW_NODE_DETAIL:
-                    generator = new QueryGenerator(WORKFLOW_NODE_DETAIL);
-                    generator.setParameter(WorkflowNodeDetailsConstants.NODE_INSTANCE_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.EXPERIMENT.toString());
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case CONFIG_DATA:
-                    generator = new QueryGenerator(CONFIG_DATA);
-                    generator.setParameter(ExperimentConfigurationDataConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case COMPUTATIONAL_RESOURCE_SCHEDULING:
-                    generator = new QueryGenerator(COMPUTATIONAL_RESOURCE_SCHEDULING);
-                    generator.setParameter(ComputationalResourceSchedulingConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case ADVANCE_INPUT_DATA_HANDLING:
-                    generator = new QueryGenerator(ADVANCE_INPUT_DATA_HANDLING);
-                    generator.setParameter(AdvancedInputDataHandlingConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case ADVANCE_OUTPUT_DATA_HANDLING:
-                    generator = new QueryGenerator(ADVANCE_OUTPUT_DATA_HANDLING);
-                    generator.setParameter(AdvancedOutputDataHandlingConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case QOS_PARAM:
-                    generator = new QueryGenerator(QOS_PARAMS);
-                    generator.setParameter(QosParamsConstants.EXPERIMENT_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                default:
-                    logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
-                    break;
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     *
-     * @param type  child resource types
-     * @param name name of the child resource
-     * @return UnsupportedOperationException
-     */
-    public Resource get(ResourceType type, Object name) throws RegistryException {
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator;
-            Query q;
-            switch (type) {
-                case EXPERIMENT_INPUT:
-                    generator = new QueryGenerator(EXPERIMENT_INPUT);
-                    generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, name);
-                    q = generator.selectQuery(em);
-                    Experiment_Input experimentInput = (Experiment_Input) q.getSingleResult();
-                    ExperimentInputResource inputResource = (ExperimentInputResource) Utils.getResource(ResourceType.EXPERIMENT_INPUT, experimentInput);
-                    em.getTransaction().commit();
-                    em.close();
-                    return inputResource;
-                case EXPERIMENT_OUTPUT:
-                    generator = new QueryGenerator(EXPERIMENT_OUTPUT);
-                    generator.setParameter(ExperimentOutputConstants.EXPERIMENT_ID, name);
-                    q = generator.selectQuery(em);
-                    Experiment_Output experimentOutput = (Experiment_Output) q.getSingleResult();
-                    ExperimentOutputResource outputResource = (ExperimentOutputResource) Utils.getResource(ResourceType.EXPERIMENT_OUTPUT, experimentOutput);
-                    em.getTransaction().commit();
-                    em.close();
-                    return outputResource;
-                case NOTIFICATION_EMAIL:
-                    generator = new QueryGenerator(NOTIFICATION_EMAIL);
-                    generator.setParameter(NotificationEmailConstants.EXPERIMENT_ID, name);
-                    q = generator.selectQuery(em);
-                    Notification_Email notificationEmail = (Notification_Email) q.getSingleResult();
-                    NotificationEmailResource notificationEmailResource = (NotificationEmailResource) Utils.getResource(ResourceType.NOTIFICATION_EMAIL, notificationEmail);
-                    em.getTransaction().commit();
-                    em.close();
-                    return notificationEmailResource;
-                case WORKFLOW_NODE_DETAIL:
-                    generator = new QueryGenerator(WORKFLOW_NODE_DETAIL);
-                    generator.setParameter(WorkflowNodeDetailsConstants.NODE_INSTANCE_ID, name);
-                    q = generator.selectQuery(em);
-                    WorkflowNodeDetail workflowNodeDetail = (WorkflowNodeDetail) q.getSingleResult();
-                    WorkflowNodeDetailResource nodeDetailResource = (WorkflowNodeDetailResource) Utils.getResource(ResourceType.WORKFLOW_NODE_DETAIL, workflowNodeDetail);
-                    em.getTransaction().commit();
-                    em.close();
-                    return nodeDetailResource;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.EXPERIMENT_ID, name);
-                    q = generator.selectQuery(em);
-                    ErrorDetail errorDetail = (ErrorDetail) q.getSingleResult();
-                    ErrorDetailResource errorDetailResource = (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
-                    em.getTransaction().commit();
-                    em.close();
-                    return errorDetailResource;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.EXPERIMENT.toString());
-                    q = generator.selectQuery(em);
-                    Status status = (Status) q.getSingleResult();
-                    StatusResource statusResource = (StatusResource) Utils.getResource(ResourceType.STATUS, status);
-                    em.getTransaction().commit();
-                    em.close();
-                    return statusResource;
-                case CONFIG_DATA:
-                    generator = new QueryGenerator(CONFIG_DATA);
-                    generator.setParameter(ExperimentConfigurationDataConstants.EXPERIMENT_ID, name);
-                    q = generator.selectQuery(em);
-                    ExperimentConfigData configData = (ExperimentConfigData) q.getSingleResult();
-                    ConfigDataResource configDataResource = (ConfigDataResource) Utils.getResource(ResourceType.CONFIG_DATA, configData);
-                    em.getTransaction().commit();
-                    em.close();
-                    return configDataResource;
-                case COMPUTATIONAL_RESOURCE_SCHEDULING:
-                    generator = new QueryGenerator(COMPUTATIONAL_RESOURCE_SCHEDULING);
-                    generator.setParameter(ComputationalResourceSchedulingConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(ComputationalResourceSchedulingConstants.TASK_ID, null);
-                    q = generator.selectQuery(em);
-                    Computational_Resource_Scheduling scheduling = (Computational_Resource_Scheduling) q.getSingleResult();
-                    ComputationSchedulingResource schedulingResource = (ComputationSchedulingResource) Utils.getResource(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, scheduling);
-                    em.getTransaction().commit();
-                    em.close();
-                    return schedulingResource;
-                case ADVANCE_INPUT_DATA_HANDLING:
-                    generator = new QueryGenerator(ADVANCE_INPUT_DATA_HANDLING);
-                    generator.setParameter(AdvancedInputDataHandlingConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(AdvancedInputDataHandlingConstants.TASK_ID, null);
-                    q = generator.selectQuery(em);
-                    AdvancedInputDataHandling inputDataHandling = (AdvancedInputDataHandling) q.getSingleResult();
-                    AdvanceInputDataHandlingResource dataHandlingResource = (AdvanceInputDataHandlingResource) Utils.getResource(ResourceType.ADVANCE_INPUT_DATA_HANDLING, inputDataHandling);
-                    em.getTransaction().commit();
-                    em.close();
-                    return dataHandlingResource;
-                case ADVANCE_OUTPUT_DATA_HANDLING:
-                    generator = new QueryGenerator(ADVANCE_OUTPUT_DATA_HANDLING);
-                    generator.setParameter(AdvancedOutputDataHandlingConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(AdvancedOutputDataHandlingConstants.TASK_ID, null);
-                    q = generator.selectQuery(em);
-                    AdvancedOutputDataHandling outputDataHandling = (AdvancedOutputDataHandling) q.getSingleResult();
-                    AdvancedOutputDataHandlingResource outputDataHandlingResource = (AdvancedOutputDataHandlingResource) Utils.getResource(ResourceType.ADVANCE_OUTPUT_DATA_HANDLING, outputDataHandling);
-                    em.getTransaction().commit();
-                    em.close();
-                    return outputDataHandlingResource;
-                case QOS_PARAM:
-                    generator = new QueryGenerator(QOS_PARAMS);
-                    generator.setParameter(QosParamsConstants.EXPERIMENT_ID, name);
-                    generator.setParameter(QosParamsConstants.TASK_ID, null);
-                    q = generator.selectQuery(em);
-                    QosParam qosParam = (QosParam) q.getSingleResult();
-                    QosParamResource qosParamResource = (QosParamResource) Utils.getResource(ResourceType.QOS_PARAM, qosParam);
-                    em.getTransaction().commit();
-                    em.close();
-                    return qosParamResource;
-                default:
-                    em.getTransaction().commit();
-                    em.close();
-                    logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
-                    throw new IllegalArgumentException("Unsupported resource type for experiment data resource.");
-            }
-        } catch (Exception e) {
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-    }
-
-    /**
-     *
-     * @param type  child resource types
-     * @return UnsupportedOperationException
-     */
-    public List<Resource> get(ResourceType type)  throws RegistryException{
-        List<Resource> resourceList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            List results;
-            switch (type) {
-                case EXPERIMENT_INPUT:
-                    generator = new QueryGenerator(EXPERIMENT_INPUT);
-                    generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, expID);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Experiment_Input exInput = (Experiment_Input) result;
-                            ExperimentInputResource inputResource =
-                                    (ExperimentInputResource) Utils.getResource(ResourceType.EXPERIMENT_INPUT, exInput);
-                            resourceList.add(inputResource);
-                        }
-                    }
-                    break;
-                case EXPERIMENT_OUTPUT:
-                    generator = new QueryGenerator(EXPERIMENT_OUTPUT);
-                    generator.setParameter(ExperimentOutputConstants.EXPERIMENT_ID, expID);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Experiment_Output output = (Experiment_Output) result;
-                            ExperimentOutputResource outputResource =
-                                    (ExperimentOutputResource) Utils.getResource(ResourceType.EXPERIMENT_OUTPUT, output);
-                            resourceList.add(outputResource);
-                        }
-                    }
-                    break;
-                case NOTIFICATION_EMAIL:
-                    generator = new QueryGenerator(NOTIFICATION_EMAIL);
-                    generator.setParameter(NotificationEmailConstants.EXPERIMENT_ID, expID);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Notification_Email notificationEmail = (Notification_Email) result;
-                            NotificationEmailResource emailResource =
-                                    (NotificationEmailResource) Utils.getResource(ResourceType.NOTIFICATION_EMAIL, notificationEmail);
-                            resourceList.add(emailResource);
-                        }
-                    }
-                    break;
-                case WORKFLOW_NODE_DETAIL:
-                    generator = new QueryGenerator(WORKFLOW_NODE_DETAIL);
-                    generator.setParameter(WorkflowNodeDetailsConstants.EXPERIMENT_ID, expID);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            WorkflowNodeDetail nodeDetail = (WorkflowNodeDetail) result;
-                            WorkflowNodeDetailResource nodeDetailResource =
-                                    (WorkflowNodeDetailResource) Utils.getResource(ResourceType.WORKFLOW_NODE_DETAIL, nodeDetail);
-                            resourceList.add(nodeDetailResource);
-                        }
-                    }
-                    break;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.EXPERIMENT_ID, expID);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            ErrorDetail errorDetail = (ErrorDetail) result;
-                            ErrorDetailResource errorDetailResource =
-                                    (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
-                            resourceList.add(errorDetailResource);
-                        }
-                    }
-                    break;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.EXPERIMENT_ID, expID);
-                    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 experiment resource.", new UnsupportedOperationException());
-                    throw new UnsupportedOperationException();
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return resourceList;
-    }
-
-    /**
-     * saveExperiment experiment
-     */
-    public void save() throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            Experiment existingExp = em.find(Experiment.class, expID);
-            em.close();
-
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Experiment experiment = new Experiment();
-            Project projectmodel = em.find(Project.class, project.getId());
-            experiment.setProject(projectmodel);
-            experiment.setProjectId(projectmodel.getProject_id());
-            Gateway gateway = em.find(Gateway.class, getGateway().getGatewayId());
-            experiment.setExpId(expID);
-            experiment.setExecutionUser(executionUser);
-            Users userModel = em.find(Users.class, executionUser);
-            experiment.setUser(userModel);
-            experiment.setExecutionUser(userModel.getUser_name());
-            experiment.setGateway(gateway);
-            experiment.setGatewayId(gateway.getGateway_id());
-            experiment.setCreationTime(creationTime);
-            experiment.setExpName(expName);
-            experiment.setExpDesc(description);
-            experiment.setApplicationId(applicationId);
-            experiment.setAppVersion(applicationVersion);
-            experiment.setWorkflowExecutionId(workflowExecutionId);
-            experiment.setWorkflowTemplateVersion(workflowTemplateVersion);
-            experiment.setWorkflowExecutionId(workflowExecutionId);
-            experiment.setAllowNotification(enableEmailNotifications);
-            experiment.setGatewayExecutionId(gatewayExecutionId);
-            if (existingExp != null) {
-                existingExp.setGateway(gateway);
-                existingExp.setGatewayId(gateway.getGateway_id());
-                existingExp.setProject(projectmodel);
-                existingExp.setExecutionUser(executionUser);
-                existingExp.setUser(userModel);
-                existingExp.setProjectId(projectmodel.getProject_id());
-                existingExp.setCreationTime(creationTime);
-                existingExp.setExpName(expName);
-                existingExp.setExpDesc(description);
-                existingExp.setApplicationId(applicationId);
-                existingExp.setAppVersion(applicationVersion);
-                existingExp.setWorkflowExecutionId(workflowExecutionId);
-                existingExp.setWorkflowTemplateVersion(workflowTemplateVersion);
-                existingExp.setWorkflowExecutionId(workflowExecutionId);
-                existingExp.setAllowNotification(enableEmailNotifications);
-                existingExp.setGatewayExecutionId(gatewayExecutionId);
-                experiment = em.merge(existingExp);
-            } else {
-                em.persist(experiment);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     *
-     * @param expID experiment ID
-     */
-    public void setExpID(String expID) {
-		this.expID = expID;
-	}
-
-    /**
-     *
-     * @return gatewayResource
-     */
-    public GatewayResource getGateway() {
-		return gateway;
-	}
-
-    /**
-     *
-     * @param gateway gateway
-     */
-    public void setGateway(GatewayResource gateway) {
-		this.gateway = gateway;
-	}
-
-    public String getExecutionUser() {
-        return executionUser;
-    }
-
-    public void setExecutionUser(String executionUser) {
-        this.executionUser = executionUser;
-    }
-
-    /**
-     *
-     * @return project
-     */
-    public ProjectResource getProject() {
-		return project;
-	}
-
-    /**
-     *
-     * @param project  project
-     */
-    public void setProject(ProjectResource project) {
-		this.project = project;
-	}
-
-    public List<NotificationEmailResource> getNotificationEmails () throws RegistryException{
-        List<NotificationEmailResource> emailResources = new ArrayList<NotificationEmailResource>();
-        List<Resource> resources = get(ResourceType.NOTIFICATION_EMAIL);
-        for (Resource resource : resources) {
-            emailResources.add((NotificationEmailResource) resource);
-        }
-        return emailResources;
-    }
-
-    public List<ExperimentInputResource> getExperimentInputs () throws RegistryException{
-        List<ExperimentInputResource> expInputs = new ArrayList<ExperimentInputResource>();
-        List<Resource> resources = get(ResourceType.EXPERIMENT_INPUT);
-        for (Resource resource : resources) {
-            expInputs.add((ExperimentInputResource) resource);
-        }
-        return expInputs;
-    }
-
-    public List<ExperimentOutputResource> getExperimentOutputs () throws RegistryException{
-        List<ExperimentOutputResource> expOutputs = new ArrayList<ExperimentOutputResource>();
-        List<Resource> resources = get(ResourceType.EXPERIMENT_OUTPUT);
-        for (Resource resource : resources) {
-            expOutputs.add((ExperimentOutputResource) resource);
-        }
-        return expOutputs;
-    }
-
-    public StatusResource getExperimentStatus() throws RegistryException{
-        List<Resource> resources = get(ResourceType.STATUS);
-        for (Resource resource : resources) {
-            StatusResource expStatus = (StatusResource) resource;
-            if(expStatus.getStatusType().equals(StatusType.EXPERIMENT.toString())){
-                if (expStatus.getState() == null || expStatus.getState().equals("") ){
-                    expStatus.setState("UNKNOWN");
-                }
-                return expStatus;
-            }
-        }
-        return null;
-    }
-
-    public List<StatusResource> getWorkflowNodeStatuses() throws RegistryException{
-        List<StatusResource> statuses = new ArrayList<StatusResource>();
-        List<Resource> resources = get(ResourceType.STATUS);
-        for (Resource resource : resources) {
-            StatusResource workflowNodeStatus = (StatusResource) resource;
-            if(workflowNodeStatus.getStatusType().equals(StatusType.WORKFLOW_NODE.toString())){
-                if (workflowNodeStatus.getState() == null || workflowNodeStatus.getState().equals("")){
-                    workflowNodeStatus.setState("UNKNOWN");
-                }
-                statuses.add(workflowNodeStatus);
-            }
-        }
-        return statuses;
-    }
-
-    public List<WorkflowNodeDetailResource> getWorkflowNodeDetails () throws RegistryException{
-        List<WorkflowNodeDetailResource> workflowNodeDetailResourceList = new ArrayList<WorkflowNodeDetailResource>();
-        List<Resource> resources = get(ResourceType.WORKFLOW_NODE_DETAIL);
-        for (Resource resource : resources) {
-            WorkflowNodeDetailResource nodeDetailResource = (WorkflowNodeDetailResource) resource;
-            workflowNodeDetailResourceList.add(nodeDetailResource);
-        }
-        return workflowNodeDetailResourceList;
-    }
-
-    public List<ErrorDetailResource> getErrorDetails () throws RegistryException{
-        List<ErrorDetailResource> errorDetailResources = new ArrayList<ErrorDetailResource>();
-        List<Resource> resources = get(ResourceType.ERROR_DETAIL);
-        for (Resource resource : resources) {
-            ErrorDetailResource errorDetailResource = (ErrorDetailResource) resource;
-            errorDetailResources.add(errorDetailResource);
-        }
-        return errorDetailResources;
-    }
-
-    public ComputationSchedulingResource getComputationScheduling (String expId) throws RegistryException{
-        return  (ComputationSchedulingResource)get(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, expId);
-    }
-
-    public AdvanceInputDataHandlingResource getInputDataHandling (String expId) throws RegistryException{
-        return  (AdvanceInputDataHandlingResource)get(ResourceType.ADVANCE_INPUT_DATA_HANDLING, expId);
-    }
-
-    public AdvancedOutputDataHandlingResource getOutputDataHandling (String expId) throws RegistryException{
-        return  (AdvancedOutputDataHandlingResource)get(ResourceType.ADVANCE_OUTPUT_DATA_HANDLING, expId);
-    }
-
-    public QosParamResource getQOSparams (String expId) throws RegistryException{
-        return  (QosParamResource)get(ResourceType.QOS_PARAM, expId);
-    }
-
-    public ConfigDataResource getUserConfigData(String expID) throws RegistryException{
-        return (ConfigDataResource)get(ResourceType.CONFIG_DATA, expID);
-    }
-    public WorkflowNodeDetailResource getWorkflowNode (String nodeId) throws RegistryException{
-        return (WorkflowNodeDetailResource)get(ResourceType.WORKFLOW_NODE_DETAIL, nodeId);
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
deleted file mode 100644
index d33fb05..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.persistance.registry.jpa.resources;
-
-import org.apache.airavata.persistance.registry.jpa.Resource;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.*;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.List;
-
-public class GatewayResource extends AbstractResource {
-    private final static Logger logger = LoggerFactory.getLogger(GatewayResource.class);
-
-    private String gatewayId;
-    private String gatewayName;
-    private String domain;
-    private String emailAddress;
-
-    public String getGatewayId() {
-        return gatewayId;
-    }
-
-    public void setGatewayId(String gatewayId) {
-        this.gatewayId = gatewayId;
-    }
-
-    public String getEmailAddress() {
-        return emailAddress;
-    }
-
-    public void setEmailAddress(String emailAddress) {
-        this.emailAddress = emailAddress;
-    }
-
-    /**
-     *
-     * @param gatewayId gateway name
-     */
-    public GatewayResource(String gatewayId) {
-    	setGatewayId(gatewayId);
-	}
-
-    /**
-     *
-     */
-    public GatewayResource() {
-	}
-
-    /**
-     *
-     * @return gateway name
-     */
-    public String getGatewayName() {
-        return gatewayName;
-    }
-
-    /**
-     *
-     * @param gatewayName
-     */
-    public void setGatewayName(String gatewayName) {
-        this.gatewayName = gatewayName;
-    }
-
-    /**
-     *
-     * @return domain of the gateway
-     */
-    public String getDomain() {
-        return domain;
-    }
-
-    /**
-     *
-     * @param domain domain of the gateway
-     */
-    public void setDomain(String domain) {
-        this.domain = domain;
-    }
-
-
-    /**
-     * Gateway is at the root level.  So it can populate his child resources.
-     * Project, User, Published Workflows, User workflows, Host descriptors,
-     * Service Descriptors, Application descriptors and Experiments are all
-     * its children
-     * @param type resource type of the children
-     * @return specific child resource type
-     */
-    public Resource create(ResourceType type) throws RegistryException {
-        switch (type) {
-            case PROJECT:
-                ProjectResource projectResource = new ProjectResource();
-                projectResource.setGateway(this);
-                return projectResource;
-            case EXPERIMENT:
-                ExperimentResource experimentResource =new ExperimentResource();
-                experimentResource.setGateway(this);
-                return experimentResource;
-            case GATEWAY_WORKER:
-                WorkerResource workerResource = new WorkerResource();
-                workerResource.setGateway(this);
-                return workerResource;
-            default:
-                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
-        }
-    }
-
-    /**
-     * Child resources can be removed from a gateway
-     * @param type child resource type
-     * @param name child resource name
-     */
-    public void remove(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            switch (type) {
-                case USER:
-                    generator = new QueryGenerator(USERS);
-                    generator.setParameter(UserConstants.USERNAME, name);
-                    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 gateway resource.", new IllegalArgumentException());
-                    break;
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     * Gateway can getExperiment information of his children
-     * @param type child resource type
-     * @param name child resource name
-     * @return specific child resource type
-     */
-    public Resource get(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator;
-            Query q;
-            switch (type) {
-                case GATEWAY_WORKER:
-                    generator = new QueryGenerator(GATEWAY_WORKER);
-                    generator.setParameter(GatewayWorkerConstants.USERNAME, name);
-                    generator.setParameter(GatewayWorkerConstants.GATEWAY_ID, gatewayId);
-                    q = generator.selectQuery(em);
-                    Gateway_Worker worker = (Gateway_Worker) q.getSingleResult();
-                    WorkerResource workerResource =
-                            (WorkerResource) Utils.getResource(ResourceType.GATEWAY_WORKER, worker);
-                    em.getTransaction().commit();
-                    em.close();
-                    return workerResource;
-                case USER:
-                    generator = new QueryGenerator(USERS);
-                    generator.setParameter(UserConstants.USERNAME, name);
-                    q = generator.selectQuery(em);
-                    Users user = (Users) q.getSingleResult();
-                    UserResource userResource =
-                            (UserResource) Utils.getResource(ResourceType.USER, user);
-                    em.getTransaction().commit();
-                    em.close();
-                    return userResource;
-                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;
-                default:
-                    em.getTransaction().commit();
-                    em.close();
-                    logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
-                    throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    /**
-     *
-     * @param type child resource type
-     * @return list of child resources
-     */
-    public List<Resource> get(ResourceType type) throws RegistryException{
-        List<Resource> resourceList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            List results;
-            switch (type) {
-                case PROJECT:
-                    generator = new QueryGenerator(PROJECT);
-                    Gateway gatewayModel = em.find(Gateway.class, gatewayId);
-                    generator.setParameter("gateway", gatewayModel);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Project project = (Project) result;
-                            ProjectResource projectResource =
-                                    (ProjectResource) Utils.getResource(ResourceType.PROJECT, project);
-                            resourceList.add(projectResource);
-                        }
-                    }
-                    break;
-                case GATEWAY_WORKER:
-                    generator = new QueryGenerator(GATEWAY_WORKER);
-                    generator.setParameter(GatewayWorkerConstants.GATEWAY_ID, gatewayId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Gateway_Worker gatewayWorker = (Gateway_Worker) result;
-                            WorkerResource workerResource =
-                                    (WorkerResource) Utils.getResource(ResourceType.GATEWAY_WORKER, gatewayWorker);
-                            resourceList.add(workerResource);
-                        }
-                    }
-                    break;
-                case EXPERIMENT:
-                    generator = new QueryGenerator(EXPERIMENT);
-                    generator.setParameter(ExperimentConstants.GATEWAY_ID, gatewayId);
-                    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);
-                    for (Object o : q.getResultList()) {
-                        Users user = (Users) o;
-                        UserResource userResource =
-                                (UserResource) Utils.getResource(ResourceType.USER, user);
-                        resourceList.add(userResource);
-                    }
-                    break;
-                default:
-                    em.getTransaction().commit();
-                    em.close();
-                    logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
-                    throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return resourceList;
-    }
-
-    /**
-     * saveExperiment the gateway to the database
-     */
-    public void save() throws RegistryException {
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            Gateway existingGateway = em.find(Gateway.class, gatewayId);
-            em.close();
-
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Gateway gateway = new Gateway();
-            gateway.setGateway_name(gatewayName);
-            gateway.setGateway_id(gatewayId);
-            gateway.setDomain(domain);
-            gateway.setEmailAddress(emailAddress);
-            if (existingGateway != null) {
-                existingGateway.setDomain(domain);
-                existingGateway.setGateway_name(gatewayName);
-                existingGateway.setEmailAddress(emailAddress);
-                gateway = em.merge(existingGateway);
-            } else {
-                em.persist(gateway);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-    }
-
-    /**
-     * check whether child resource already exist in the database
-     * @param type child resource type
-     * @param name name of the child resource
-     * @return true or false
-     */
-    public boolean isExists(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            switch (type) {
-                case GATEWAY_WORKER:
-                    em = ResourceUtils.getEntityManager();
-                    Gateway_Worker existingWorker = em.find(Gateway_Worker.class, new Gateway_Worker_PK(gatewayId, name.toString()));
-                    em.close();
-                    return existingWorker != null;
-                case USER:
-                    em = ResourceUtils.getEntityManager();
-                    Users existingUser = em.find(Users.class, name);
-                    em.close();
-                    return existingUser != 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.");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public ExperimentResource createExperiment (String experimentID) throws RegistryException{
-        ExperimentResource metadataResource = (ExperimentResource)create(ResourceType.EXPERIMENT);
-        metadataResource.setExpID(experimentID);
-        return metadataResource;
-    }
-
-    public ExperimentResource getExperiment (String expId) throws RegistryException{
-        return (ExperimentResource)get(ResourceType.EXPERIMENT, expId);
-    }
-
-    public List<ExperimentResource> getExperiments () throws RegistryException{
-        List<ExperimentResource> experiments = new ArrayList<ExperimentResource>();
-        List<Resource> resources = get(ResourceType.EXPERIMENT);
-        for (Resource resource : resources){
-            experiments.add((ExperimentResource)resource);
-        }
-        return experiments;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
deleted file mode 100644
index 6e6d2ee..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.persistance.registry.jpa.resources;
-
-import org.apache.airavata.persistance.registry.jpa.Resource;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.model.*;
-import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.utils.StatusType;
-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;
-    private Timestamp creationTime;
-    private String computeResourceConsumed;
-    private String jobName;
-    private String workingDir;
-
-    public String getJobName() {
-        return jobName;
-    }
-
-    public void setJobName(String jobName) {
-        this.jobName = jobName;
-    }
-
-    public String getWorkingDir() {
-        return workingDir;
-    }
-
-    public void setWorkingDir(String workingDir) {
-        this.workingDir = workingDir;
-    }
-
-    public String getJobId() {
-        return jobId;
-    }
-
-    public void setJobId(String jobId) {
-        this.jobId = jobId;
-    }
-
-    public TaskDetailResource getTaskDetailResource() {
-        return taskDetailResource;
-    }
-
-    public void setTaskDetailResource(TaskDetailResource taskDetailResource) {
-        this.taskDetailResource = taskDetailResource;
-    }
-
-    public String getJobDescription() {
-        return jobDescription;
-    }
-
-    public void setJobDescription(String jobDescription) {
-        this.jobDescription = jobDescription;
-    }
-
-    public Timestamp getCreationTime() {
-        return creationTime;
-    }
-
-    public void setCreationTime(Timestamp creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public String getComputeResourceConsumed() {
-        return computeResourceConsumed;
-    }
-
-    public void setComputeResourceConsumed(String computeResourceConsumed) {
-        this.computeResourceConsumed = computeResourceConsumed;
-    }
-
-    
-    public Resource create(ResourceType type) throws RegistryException {
-        switch (type){
-            case STATUS:
-                StatusResource statusResource = new StatusResource();
-                statusResource.setJobId(jobId);
-                return statusResource;
-            case ERROR_DETAIL:
-                ErrorDetailResource errorDetailResource = new ErrorDetailResource();
-                errorDetailResource.setJobId(jobId);
-                return errorDetailResource;
-            default:
-                logger.error("Unsupported resource type for job details data resource.", new UnsupportedOperationException());
-                throw new UnsupportedOperationException();
-        }
-    }
-
-    
-    public void remove(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            switch (type) {
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.JOB_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.JOB.toString());
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(ErrorDetailConstants.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();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    
-    public Resource get(ResourceType type, Object name) throws RegistryException {
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator;
-            Query q;
-            switch (type) {
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.JOB_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.JOB.toString());
-                    q = generator.selectQuery(em);
-                    Status status = (Status) q.getSingleResult();
-                    StatusResource statusResource = (StatusResource) Utils.getResource(ResourceType.STATUS, status);
-                    em.getTransaction().commit();
-                    em.close();
-                    return statusResource;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.JOB_ID, name);
-                    q = generator.selectQuery(em);
-                    ErrorDetail errorDetail = (ErrorDetail) q.getSingleResult();
-                    ErrorDetailResource errorDetailResource = (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
-                    em.getTransaction().commit();
-                    em.close();
-                    return errorDetailResource;
-                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.");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    
-    public List<Resource> get(ResourceType type) throws RegistryException{
-        List<Resource> resourceList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            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;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.JOB_ID, jobId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            ErrorDetail errorDetail = (ErrorDetail) result;
-                            ErrorDetailResource errorDetailResource =
-                                    (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
-                            resourceList.add(errorDetailResource);
-                        }
-                    }
-                    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();
-        } catch (Exception e) {
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return resourceList;
-    }
-
-    
-    public void save()  throws RegistryException{
-        EntityManager em = null;
-        try {
-            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.setJobName(jobName);
-            jobDetail.setWorkingDir(workingDir);
-            if (jobDescription != null) {
-                jobDetail.setJobDescription(jobDescription.toCharArray());
-            }
-            jobDetail.setComputeResourceConsumed(computeResourceConsumed);
-            if (existingJobDetail != null) {
-                existingJobDetail.setJobId(jobId);
-                existingJobDetail.setTask(taskDetail);
-                existingJobDetail.setTaskId(taskDetailResource.getTaskId());
-                existingJobDetail.setCreationTime(creationTime);
-                if (jobDescription != null) {
-                    existingJobDetail.setJobDescription(jobDescription.toCharArray());
-                }
-                existingJobDetail.setComputeResourceConsumed(computeResourceConsumed);
-                existingJobDetail.setJobName(jobName);
-                existingJobDetail.setWorkingDir(workingDir);
-                jobDetail = em.merge(existingJobDetail);
-            } else {
-                em.persist(jobDetail);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public StatusResource getJobStatus() throws RegistryException{
-        List<Resource> resources = get(ResourceType.STATUS);
-        for (Resource resource : resources) {
-            StatusResource jobStatus = (StatusResource) resource;
-            if(jobStatus.getStatusType().equals(StatusType.JOB.toString())){
-                if (jobStatus.getState() == null || jobStatus.getState().equals("") ){
-                    jobStatus.setState("UNKNOWN");
-                }
-                return jobStatus;
-            }
-        }
-        return null;
-    }
-
-    public StatusResource getApplicationStatus() throws RegistryException{
-        List<Resource> resources = get(ResourceType.STATUS);
-        for (Resource resource : resources) {
-            StatusResource appStatus = (StatusResource) resource;
-            if(appStatus.getStatusType().equals(StatusType.APPLICATION.toString())){
-                if (appStatus.getState() == null || appStatus.getState().equals("") ){
-                    appStatus.setState("UNKNOWN");
-                }
-                return appStatus;
-            }
-        }
-        return null;
-    }
-
-    public List<ErrorDetailResource> getErrorDetails () throws RegistryException{
-        List<ErrorDetailResource> errorDetailResources = new ArrayList<ErrorDetailResource>();
-        List<Resource> resources = get(ResourceType.ERROR_DETAIL);
-        for(Resource resource : resources){
-            errorDetailResources.add((ErrorDetailResource)resource);
-        }
-        return errorDetailResources;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeInputResource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeInputResource.java
deleted file mode 100644
index 4efb8a4..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeInputResource.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.persistance.registry.jpa.resources;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-
-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.NodeInput;
-import org.apache.airavata.persistance.registry.jpa.model.NodeInput_PK;
-import org.apache.airavata.persistance.registry.jpa.model.WorkflowNodeDetail;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeInputResource extends AbstractResource {
-	private static final Logger logger = LoggerFactory.getLogger(NodeInputResource.class);
-
-    private WorkflowNodeDetailResource nodeDetailResource;
-    private String inputKey;
-    private String dataType;
-    private String metadata;
-    private String value;
-    private String appArgument;
-    private boolean standardInput;
-    private String userFriendlyDesc;
-    private int inputOrder;
-    private boolean isRequired;
-    private boolean requiredToCMD;
-    private boolean dataStaged;
-
-    public boolean getRequired() {
-        return isRequired;
-    }
-
-    public void setRequired(boolean required) {
-        this.isRequired = required;
-    }
-
-    public boolean getRequiredToCMD() {
-        return requiredToCMD;
-    }
-
-    public void setRequiredToCMD(boolean requiredToCMD) {
-        this.requiredToCMD = requiredToCMD;
-    }
-
-    public boolean isDataStaged() {
-        return dataStaged;
-    }
-
-    public void setDataStaged(boolean dataStaged) {
-        this.dataStaged = dataStaged;
-    }
-
-    public String getAppArgument() {
-        return appArgument;
-    }
-
-    public void setAppArgument(String appArgument) {
-        this.appArgument = appArgument;
-    }
-
-    public boolean isStandardInput() {
-        return standardInput;
-    }
-
-    public void setStandardInput(boolean standardInput) {
-        this.standardInput = standardInput;
-    }
-
-    public String getUserFriendlyDesc() {
-        return userFriendlyDesc;
-    }
-
-    public void setUserFriendlyDesc(String userFriendlyDesc) {
-        this.userFriendlyDesc = userFriendlyDesc;
-    }
-
-    public WorkflowNodeDetailResource getNodeDetailResource() {
-        return nodeDetailResource;
-    }
-
-    public void setNodeDetailResource(WorkflowNodeDetailResource nodeDetailResource) {
-        this.nodeDetailResource = nodeDetailResource;
-    }
-
-    public String getInputKey() {
-        return inputKey;
-    }
-
-    public void setInputKey(String inputKey) {
-        this.inputKey = inputKey;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getMetadata() {
-        return metadata;
-    }
-
-    public void setMetadata(String metadata) {
-        this.metadata = metadata;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public int getInputOrder() {
-        return inputOrder;
-    }
-
-    public void setInputOrder(int inputOrder) {
-        this.inputOrder = inputOrder;
-    }
-
-    public Resource create(ResourceType type) throws RegistryException {
-        logger.error("Unsupported resource type for node input data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public void remove(ResourceType type, Object name) throws RegistryException{
-        logger.error("Unsupported resource type for node input data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public Resource get(ResourceType type, Object name) throws RegistryException {
-        logger.error("Unsupported resource type for node input data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public List<Resource> get(ResourceType type) throws RegistryException {
-        logger.error("Unsupported resource type for node input data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public void save() throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            NodeInput existingInput = em.find(NodeInput.class, new NodeInput_PK(inputKey, nodeDetailResource.getNodeInstanceId()));
-            em.close();
-
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            NodeInput nodeInput = new NodeInput();
-            WorkflowNodeDetail nodeDetail = em.find(WorkflowNodeDetail.class, nodeDetailResource.getNodeInstanceId());
-            nodeInput.setNodeDetails(nodeDetail);
-            nodeInput.setNodeId(nodeDetail.getNodeId());
-            nodeInput.setInputKey(inputKey);
-            nodeInput.setDataType(dataType);
-            nodeInput.setValue(value);
-            nodeInput.setMetadata(metadata);
-            nodeInput.setAppArgument(appArgument);
-            nodeInput.setStandardInput(standardInput);
-            nodeInput.setUserFriendlyDesc(userFriendlyDesc);
-            nodeInput.setInputOrder(inputOrder);
-            nodeInput.setRequiredToCMD(requiredToCMD);
-            nodeInput.setIsRequired(isRequired);
-            nodeInput.setDataStaged(dataStaged);
-
-            if (existingInput != null){
-                existingInput.setNodeDetails(nodeDetail);
-                existingInput.setNodeId(nodeDetail.getNodeId());
-                existingInput.setInputKey(inputKey);
-                existingInput.setDataType(dataType);
-                existingInput.setValue(value);
-                existingInput.setMetadata(metadata);
-                existingInput.setAppArgument(appArgument);
-                existingInput.setStandardInput(standardInput);
-                existingInput.setUserFriendlyDesc(userFriendlyDesc);
-                existingInput.setInputOrder(inputOrder);
-                existingInput.setRequiredToCMD(requiredToCMD);
-                existingInput.setIsRequired(isRequired);
-                existingInput.setDataStaged(dataStaged);
-                nodeInput = em.merge(existingInput);
-            }else {
-                em.persist(nodeInput);
-            }
-            em.getTransaction().commit();
-            em.close();
-        }catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        }finally {
-            if (em != null && em.isOpen()){
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeOutputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeOutputResource.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeOutputResource.java
deleted file mode 100644
index ceb323b..0000000
--- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeOutputResource.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.persistance.registry.jpa.resources;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-
-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.NodeOutput;
-import org.apache.airavata.persistance.registry.jpa.model.NodeOutput_PK;
-import org.apache.airavata.persistance.registry.jpa.model.WorkflowNodeDetail;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeOutputResource extends AbstractResource {
-	private static final Logger logger = LoggerFactory.getLogger(NodeOutputResource.class);
-	
-    private WorkflowNodeDetailResource nodeDetailResource;
-    private String outputKey;
-    private String dataType;
-    private String value;
-    private boolean isRequired;
-    private boolean dataMovement;
-    private String dataNameLocation;
-    private boolean requiredToCMD;
-    private String searchQuery;
-    private String appArgument;
-
-    public String getSearchQuery() {
-        return searchQuery;
-    }
-
-    public void setSearchQuery(String searchQuery) {
-        this.searchQuery = searchQuery;
-    }
-
-    public String getAppArgument() {
-        return appArgument;
-    }
-
-    public void setAppArgument(String appArgument) {
-        this.appArgument = appArgument;
-    }
-
-
-    public boolean getRequiredToCMD() {
-        return requiredToCMD;
-    }
-
-    public void setRequiredToCMD(boolean requiredToCMD) {
-        this.requiredToCMD = requiredToCMD;
-    }
-
-    public boolean getRequired() {
-        return isRequired;
-    }
-
-    public void setRequired(boolean required) {
-        this.isRequired = required;
-    }
-
-    public boolean isDataMovement() {
-        return dataMovement;
-    }
-
-    public void setDataMovement(boolean dataMovement) {
-        this.dataMovement = dataMovement;
-    }
-
-    public String getDataNameLocation() {
-        return dataNameLocation;
-    }
-
-    public void setDataNameLocation(String dataNameLocation) {
-        this.dataNameLocation = dataNameLocation;
-    }
-
-    public WorkflowNodeDetailResource getNodeDetailResource() {
-        return nodeDetailResource;
-    }
-
-    public void setNodeDetailResource(WorkflowNodeDetailResource nodeDetailResource) {
-        this.nodeDetailResource = nodeDetailResource;
-    }
-
-    public String getOutputKey() {
-        return outputKey;
-    }
-
-    public void setOutputKey(String outputKey) {
-        this.outputKey = outputKey;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    
-    public Resource create(ResourceType type) throws RegistryException {
-        logger.error("Unsupported resource type for node output data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public void remove(ResourceType type, Object name) throws RegistryException{
-        logger.error("Unsupported resource type for node output data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public Resource get(ResourceType type, Object name) throws RegistryException{
-        logger.error("Unsupported resource type for node output data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public List<Resource> get(ResourceType type) throws RegistryException{
-        logger.error("Unsupported resource type for node output data resource.", new UnsupportedOperationException());
-        throw new UnsupportedOperationException();
-    }
-
-    
-    public void save() throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ResourceUtils.getEntityManager();
-            NodeOutput existingOutput = em.find(NodeOutput.class, new NodeOutput_PK(outputKey, nodeDetailResource.getNodeInstanceId()));
-            em.close();
-
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            NodeOutput nodeOutput = new NodeOutput();
-            WorkflowNodeDetail nodeDetail = em.find(WorkflowNodeDetail.class, nodeDetailResource.getNodeInstanceId());
-            nodeOutput.setNode(nodeDetail);
-            nodeOutput.setNodeId(nodeDetail.getNodeId());
-            nodeOutput.setOutputKey(outputKey);
-            nodeOutput.setDataType(dataType);
-            nodeOutput.setValue(value);
-            nodeOutput.setRequired(isRequired);
-            nodeOutput.setRequiredToCMD(requiredToCMD);
-            nodeOutput.setDataMovement(dataMovement);
-            nodeOutput.setDataNameLocation(dataNameLocation);
-            nodeOutput.setApplicationArgument(appArgument);
-            nodeOutput.setSearchQuery(searchQuery);
-
-            if (existingOutput != null) {
-                existingOutput.setNode(nodeDetail);
-                existingOutput.setNodeId(nodeDetail.getNodeId());
-                existingOutput.setOutputKey(outputKey);
-                existingOutput.setDataType(dataType);
-                existingOutput.setValue(value);
-                existingOutput.setRequired(isRequired);
-                existingOutput.setRequiredToCMD(requiredToCMD);
-                existingOutput.setDataMovement(dataMovement);
-                existingOutput.setDataNameLocation(dataNameLocation);
-                existingOutput.setApplicationArgument(appArgument);
-                existingOutput.setSearchQuery(searchQuery);
-                nodeOutput = em.merge(existingOutput);
-            } else {
-                em.persist(nodeOutput);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-}


Mime
View raw message