airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [07/17] airavata git commit: Changing the registry model and resource packages to comply with the new data models
Date Thu, 18 Jun 2015 20:51:14 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/f366c384/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkflowNodeDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkflowNodeDetailResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkflowNodeDetailResource.java
deleted file mode 100644
index bce4229..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkflowNodeDetailResource.java
+++ /dev/null
@@ -1,515 +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.registry.core.experiment.catalog.resources;
-
-import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
-import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
-import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
-import org.apache.airavata.registry.core.experiment.catalog.model.*;
-import org.apache.airavata.registry.core.experiment.catalog.utils.QueryGenerator;
-import org.apache.airavata.registry.cpi.utils.StatusType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.airavata.registry.cpi.RegistryException;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-
-public class WorkflowNodeDetailResource extends AbstractExpCatResource {
-    private static final Logger logger = LoggerFactory.getLogger(WorkflowNodeDetailResource.class);
-    private String experimentId;
-    private String nodeInstanceId;
-    private Timestamp creationTime;
-    private String nodeName;
-    private String executionUnit;
-    private String executionUnitData;
-    private List<TaskDetailResource> taskDetailResourceList;
-    private List<NodeInputResource> nodeInputs;
-    private List<NodeOutputResource> nodeOutputs;
-    private StatusResource nodeStatus;
-    private List<ErrorDetailResource> erros;
-
-    public List<TaskDetailResource> getTaskDetailResourceList() {
-        return taskDetailResourceList;
-    }
-
-    public void setTaskDetailResourceList(List<TaskDetailResource> taskDetailResourceList)
{
-        this.taskDetailResourceList = taskDetailResourceList;
-    }
-
-    public void setNodeInputs(List<NodeInputResource> nodeInputs) {
-        this.nodeInputs = nodeInputs;
-    }
-
-    public void setNodeOutputs(List<NodeOutputResource> nodeOutputs) {
-        this.nodeOutputs = nodeOutputs;
-    }
-
-    public StatusResource getNodeStatus() {
-        return nodeStatus;
-    }
-
-    public void setNodeStatus(StatusResource nodeStatus) {
-        this.nodeStatus = nodeStatus;
-    }
-
-    public List<ErrorDetailResource> getErros() {
-        return erros;
-    }
-
-    public void setErros(List<ErrorDetailResource> erros) {
-        this.erros = erros;
-    }
-
-    public String getExperimentId() {
-        return experimentId;
-    }
-
-    public void setExperimentId(String experimentId) {
-        this.experimentId = experimentId;
-    }
-
-    public String getNodeInstanceId() {
-        return nodeInstanceId;
-    }
-
-    public void setNodeInstanceId(String nodeInstanceId) {
-        this.nodeInstanceId = nodeInstanceId;
-    }
-
-    public Timestamp getCreationTime() {
-        return creationTime;
-    }
-
-    public void setCreationTime(Timestamp creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public String getNodeName() {
-        return nodeName;
-    }
-
-    public void setNodeName(String nodeName) {
-        this.nodeName = nodeName;
-    }
-
-    public ExperimentCatResource create(ResourceType type) throws RegistryException{
-        switch (type){
-            case TASK_DETAIL:
-                TaskDetailResource taskDetailResource = new TaskDetailResource();
-                taskDetailResource.setNodeId(nodeInstanceId);
-                return taskDetailResource;
-            case ERROR_DETAIL:
-                ErrorDetailResource errorDetailResource = new ErrorDetailResource();
-                errorDetailResource.setNodeId(nodeInstanceId);;
-                return errorDetailResource;
-            case NODE_INPUT:
-                NodeInputResource nodeInputResource = new NodeInputResource();
-                nodeInputResource.setNodeId(nodeInstanceId);
-                return nodeInputResource;
-            case NODE_OUTPUT:
-                NodeOutputResource nodeOutputResource = new NodeOutputResource();
-                nodeOutputResource.setNodeId(nodeInstanceId);
-                return nodeOutputResource;
-            case STATUS:
-                StatusResource statusResource = new StatusResource();
-                statusResource.setNodeId(nodeInstanceId);
-                return statusResource;
-            default:
-                logger.error("Unsupported resource type for workflow node detail resource.",
new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported resource type for workflow
node detail resource.");
-        }
-    }
-
-    public void remove(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            switch (type) {
-                case TASK_DETAIL:
-                    generator = new QueryGenerator(TASK_DETAIL);
-                    generator.setParameter(TaskDetailConstants.TASK_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case NODE_INPUT:
-                    generator = new QueryGenerator(NODE_INPUT);
-                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case NODE_OUTPUT:
-                    generator = new QueryGenerator(NODE_OUTPUT);
-                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, name);
-                    q = generator.deleteQuery(em);
-                    q.executeUpdate();
-                    break;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.WORKFLOW_NODE.toString());
-                    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();
-            }
-        }
-    }
-
-    public ExperimentCatResource get(ResourceType type, Object name) throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            QueryGenerator generator;
-            Query q;
-            switch (type) {
-                case TASK_DETAIL:
-                    generator = new QueryGenerator(TASK_DETAIL);
-                    generator.setParameter(TaskDetailConstants.TASK_ID, name);
-                    q = generator.selectQuery(em);
-                    TaskDetail taskDetail = (TaskDetail) q.getSingleResult();
-                    TaskDetailResource taskDetailResource = (TaskDetailResource) Utils.getResource(ResourceType.TASK_DETAIL,
taskDetail);
-                    em.getTransaction().commit();
-                    em.close();
-                    return taskDetailResource;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_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 NODE_INPUT:
-                    generator = new QueryGenerator(NODE_INPUT);
-                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, name);
-                    q = generator.selectQuery(em);
-                    NodeInput nodeInput = (NodeInput) q.getSingleResult();
-                    NodeInputResource nodeInputResource = (NodeInputResource) Utils.getResource(ResourceType.NODE_INPUT,
nodeInput);
-                    em.getTransaction().commit();
-                    em.close();
-                    return nodeInputResource;
-                case NODE_OUTPUT:
-                    generator = new QueryGenerator(NODE_OUTPUT);
-                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, name);
-                    q = generator.selectQuery(em);
-                    NodeOutput nodeOutput = (NodeOutput) q.getSingleResult();
-                    NodeOutputResource nodeOutputResource = (NodeOutputResource) Utils.getResource(ResourceType.NODE_OUTPUT,
nodeOutput);
-                    em.getTransaction().commit();
-                    em.close();
-                    return nodeOutputResource;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, name);
-                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.WORKFLOW_NODE.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;
-                default:
-                    em.getTransaction().commit();
-                    em.close();
-                    logger.error("Unsupported resource type for workflow node resource.",
new IllegalArgumentException());
-                    throw new IllegalArgumentException("Unsupported resource type for workflow
node resource.");
-            }
-        } catch (Exception e) {
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public List<ExperimentCatResource> get(ResourceType type) throws RegistryException{
-        List<ExperimentCatResource> resourceList = new ArrayList<ExperimentCatResource>();
-        EntityManager em = null;
-        try {
-            em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            QueryGenerator generator;
-            List results;
-            switch (type) {
-                case TASK_DETAIL:
-                    generator = new QueryGenerator(TASK_DETAIL);
-                    generator.setParameter(TaskDetailConstants.NODE_INSTANCE_ID, nodeInstanceId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            TaskDetail taskDetail = (TaskDetail) result;
-                            TaskDetailResource taskDetailResource =
-                                    (TaskDetailResource) Utils.getResource(ResourceType.TASK_DETAIL,
taskDetail);
-                            resourceList.add(taskDetailResource);
-                        }
-                    }
-                    break;
-                case ERROR_DETAIL:
-                    generator = new QueryGenerator(ERROR_DETAIL);
-                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_ID, nodeInstanceId);
-                    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 NODE_INPUT:
-                    generator = new QueryGenerator(NODE_INPUT);
-                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, nodeInstanceId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            NodeInput nodeInput = (NodeInput) result;
-                            NodeInputResource nodeInputResource =
-                                    (NodeInputResource) Utils.getResource(ResourceType.NODE_INPUT,
nodeInput);
-                            resourceList.add(nodeInputResource);
-                        }
-                    }
-                    break;
-                case NODE_OUTPUT:
-                    generator = new QueryGenerator(NODE_OUTPUT);
-                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, nodeInstanceId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            NodeOutput nodeOutput = (NodeOutput) result;
-                            NodeOutputResource nodeOutputResource =
-                                    (NodeOutputResource) Utils.getResource(ResourceType.NODE_OUTPUT,
nodeOutput);
-                            resourceList.add(nodeOutputResource);
-                        }
-                    }
-                    break;
-                case STATUS:
-                    generator = new QueryGenerator(STATUS);
-                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, nodeInstanceId);
-                    q = generator.selectQuery(em);
-                    results = q.getResultList();
-                    if (results.size() != 0) {
-                        for (Object result : results) {
-                            Status status = (Status) result;
-                            StatusResource statusResource =
-                                    (StatusResource) Utils.getResource(ResourceType.STATUS,
status);
-                            resourceList.add(statusResource);
-                        }
-                    }
-                    break;
-                default:
-                    em.getTransaction().commit();
-                    em.close();
-                    logger.error("Unsupported resource type for workflow node details resource.",
new UnsupportedOperationException());
-                    throw new UnsupportedOperationException();
-            }
-            em.getTransaction().commit();
-            em.close();
-        } 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;
-    }
-
-    public void save() throws RegistryException{
-        EntityManager em = null;
-        try {
-            em = ExpCatResourceUtils.getEntityManager();
-            WorkflowNodeDetail existingNode = em.find(WorkflowNodeDetail.class, nodeInstanceId);
-            em.close();
-
-            em = ExpCatResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            WorkflowNodeDetail workflowNodeDetail = new WorkflowNodeDetail();
-            workflowNodeDetail.setNodeId(nodeInstanceId);
-            workflowNodeDetail.setExpId(experimentId);
-            workflowNodeDetail.setCreationTime(creationTime);
-            workflowNodeDetail.setNodeName(nodeName);
-            workflowNodeDetail.setExecutionUnit(getExecutionUnit());
-            workflowNodeDetail.setExecutionUnitData(getExecutionUnitData());
-
-            if (existingNode != null) {
-                existingNode.setExpId(experimentId);
-                existingNode.setCreationTime(creationTime);
-                existingNode.setNodeName(nodeName);
-                existingNode.setExecutionUnit(getExecutionUnit());
-                existingNode.setExecutionUnitData(getExecutionUnitData());
-                workflowNodeDetail = em.merge(existingNode);
-            } else {
-                em.persist(workflowNodeDetail);
-            }
-            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 List<NodeInputResource> getNodeInputs() {
-        return nodeInputs;
-    }
-
-    public List<NodeOutputResource> getNodeOutputs() {
-        return nodeOutputs;
-    }
-
-    public List<NodeInputResource> getNodeInputs1() throws RegistryException{
-        List<NodeInputResource> nodeInputResourceList = new ArrayList<NodeInputResource>();
-        List<ExperimentCatResource> resources = get(ResourceType.NODE_INPUT);
-        for (ExperimentCatResource resource : resources) {
-            NodeInputResource nodeInputResource = (NodeInputResource) resource;
-            nodeInputResourceList.add(nodeInputResource);
-        }
-        return nodeInputResourceList;
-    }
-
-    public List<NodeOutputResource> getNodeOutputs1() throws RegistryException{
-        List<NodeOutputResource> outputResources = new ArrayList<NodeOutputResource>();
-        List<ExperimentCatResource> resources = get(ResourceType.NODE_OUTPUT);
-        for (ExperimentCatResource resource : resources) {
-            NodeOutputResource nodeOutputResource = (NodeOutputResource) resource;
-            outputResources.add(nodeOutputResource);
-        }
-        return outputResources;
-    }
-
-    public StatusResource getWorkflowNodeStatus() throws RegistryException{
-        List<ExperimentCatResource> resources = get(ResourceType.STATUS);
-        for (ExperimentCatResource resource : resources) {
-            StatusResource nodeStatus = (StatusResource) resource;
-            if(nodeStatus.getStatusType().equals(StatusType.WORKFLOW_NODE.toString())){
-                if (nodeStatus.getState() == null || nodeStatus.getState().equals("") ){
-                    nodeStatus.setState("UNKNOWN");
-                }
-                return nodeStatus;
-            }
-        }
-        return null;
-    }
-
-    public StatusResource getTaskStatus(String taskId) throws RegistryException{
-        List<ExperimentCatResource> resources = get(ResourceType.STATUS);
-        for (ExperimentCatResource resource : resources) {
-            StatusResource taskStatus = (StatusResource) resource;
-            if(taskStatus.getStatusType().equals(StatusType.TASK.toString()) && taskStatus.getTaskId().equals(taskId)){
-                if (taskStatus.getState() == null || taskStatus.getState().equals("") ){
-                    taskStatus.setState("UNKNOWN");
-                }
-                return taskStatus;
-            }
-        }
-        return null;
-    }
-
-    public List<TaskDetailResource> getTaskDetails() throws RegistryException{
-        List<TaskDetailResource> taskDetailResources = new ArrayList<TaskDetailResource>();
-        List<ExperimentCatResource> resources = get(ResourceType.TASK_DETAIL);
-        for (ExperimentCatResource resource : resources) {
-            TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
-            taskDetailResources.add(taskDetailResource);
-        }
-        return taskDetailResources;
-    }
-
-    public List<ErrorDetailResource> getErrorDetails() throws RegistryException{
-        List<ErrorDetailResource> errorDetails = new ArrayList<ErrorDetailResource>();
-        List<ExperimentCatResource> resources = get(ResourceType.ERROR_DETAIL);
-        for (ExperimentCatResource resource : resources) {
-            ErrorDetailResource errorDetailResource = (ErrorDetailResource) resource;
-            errorDetails.add(errorDetailResource);
-        }
-        return errorDetails;
-    }
-
-    public TaskDetailResource getTaskDetail(String taskId) throws RegistryException{
-        return (TaskDetailResource)get(ResourceType.TASK_DETAIL, taskId);
-    }
-
-	public String getExecutionUnit() {
-		return executionUnit;
-	}
-
-	public void setExecutionUnit(String executionUnit) {
-		this.executionUnit = executionUnit;
-	}
-
-	public String getExecutionUnitData() {
-		return executionUnitData;
-	}
-
-	public void setExecutionUnitData(String executionUnitData) {
-		this.executionUnitData = executionUnitData;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/f366c384/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index 1fae606..6ee8ab6 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -37,6 +37,7 @@ import org.apache.airavata.model.experiment.*;
 import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
 import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
 import org.apache.airavata.registry.core.experiment.catalog.resources.*;
+import org.apache.airavata.registry.core.experiment.catalog.resources.ProjectUserResource;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -454,28 +455,28 @@ public class ThriftDataModelConversion {
 //        return workflowNodeDetailsList;
 //    }
 
-    public static ProcessModel getProcesModel (TaskDetailResource taskDetailResource) throws
RegistryException {
-        if (taskDetailResource != null){
+    public static ProcessModel getProcesModel (ProcessResource processResource) throws RegistryException
{
+        if (processResource != null){
             ProcessModel processModel = new ProcessModel();
-            String taskId = taskDetailResource.getTaskId();
+            String taskId = processResource.getTaskId();
             processModel.setProcessId(taskId);
-            processModel.setApplicationInterfaceId(taskDetailResource.getApplicationId());
-            List<ApplicationInputResource> applicationInputs = taskDetailResource.getApplicationInputs();
+            processModel.setApplicationInterfaceId(processResource.getApplicationId());
+            List<ApplicationInputResource> applicationInputs = processResource.getApplicationInputs();
             processModel.setProcessInputs(getApplicationInputs(applicationInputs));
-            List<ApplicationOutputResource> applicationOutputs = taskDetailResource.getApplicationOutputs();
+            List<ApplicationOutputResource> applicationOutputs = processResource.getApplicationOutputs();
             processModel.setProcessOutputs(getApplicationOutputs(applicationOutputs));
-            processModel.setEnableEmailNotification(taskDetailResource.isEnableEmailNotifications());
+            processModel.setEnableEmailNotification(processResource.isEnableEmailNotifications());
             if (processModel.isEnableEmailNotification()){
-                List<NotificationEmailResource> notificationEmails = taskDetailResource.getNotificationEmails();
+                List<NotificationEmailResource> notificationEmails = processResource.getNotificationEmails();
                 processModel.setEmailAddresses(getEmailAddresses(notificationEmails));
             }
-            processModel.setApplicationDeploymentId(taskDetailResource.getApplicationDeploymentId());
-            if (taskDetailResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING,
taskId)){
-                ComputationSchedulingResource computationScheduling = taskDetailResource.getComputationScheduling(taskId);
+            processModel.setApplicationDeploymentId(processResource.getApplicationDeploymentId());
+            if (processResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING,
taskId)){
+                ComputationSchedulingResource computationScheduling = processResource.getComputationScheduling(taskId);
                 processModel.setResourceSchedule(getComputationalResourceScheduling(computationScheduling));
             }
 
-            processModel.setProcessStatus(getProcessStatus(taskDetailResource.getTaskStatus()));
+            processModel.setProcessStatus(getProcessStatus(processResource.getTaskStatus()));
 //            List<JobDetailResource> jobDetailList = taskDetailResource.getJobDetailList();
 //            processModel.setJobDetailsList(getJobDetailsList(jobDetailList));
 //            processModel.setProcessError(getErrorDetails(taskDetailResource.getErrorDetailList().get(0)));
@@ -485,10 +486,10 @@ public class ThriftDataModelConversion {
         return null;
     }
 
-    public static List<TaskModel> getTaskDetailsList (List<TaskDetailResource>
resources) throws RegistryException {
+    public static List<TaskModel> getTaskDetailsList (List<ProcessResource> resources)
throws RegistryException {
         List<TaskModel> taskDetailsList = new ArrayList<TaskModel>();
         if (resources != null && !resources.isEmpty()){
-            for (TaskDetailResource resource : resources){
+            for (ProcessResource resource : resources){
                 taskDetailsList.add(getTaskModel(resource));
             }
         }
@@ -496,15 +497,15 @@ public class ThriftDataModelConversion {
     }
 
     //FIXME: should fill according to registry object
-    public static TaskModel getTaskModel (TaskDetailResource taskDetailResource){
+    public static TaskModel getTaskModel (ProcessResource processResource){
         TaskModel model = new TaskModel();
         return model;
     }
 
-    public static List<JobModel> getJobDetailsList(List<JobDetailResource> jobs)
throws RegistryException {
+    public static List<JobModel> getJobDetailsList(List<TaskResource> jobs) throws
RegistryException {
         List<JobModel> jobDetailsList = new ArrayList<JobModel>();
         if (jobs != null && !jobs.isEmpty()){
-            for (JobDetailResource resource : jobs){
+            for (TaskResource resource : jobs){
                 jobDetailsList.add(getJobDetail(resource));
             }
         }
@@ -512,19 +513,19 @@ public class ThriftDataModelConversion {
     }
 
 
-    public static JobModel getJobDetail(JobDetailResource jobDetailResource) throws RegistryException
{
-        if (jobDetailResource != null){
+    public static JobModel getJobDetail(TaskResource taskResource) throws RegistryException
{
+        if (taskResource != null){
             JobModel jobDetails = new JobModel();
-            jobDetails.setJobId(jobDetailResource.getJobId());
-            jobDetails.setJobDescription(jobDetailResource.getJobDescription());
-            jobDetails.setCreationTime(jobDetailResource.getCreationTime().getTime());
-            StatusResource jobStatus = jobDetailResource.getJobStatus();
+            jobDetails.setJobId(taskResource.getJobId());
+            jobDetails.setJobDescription(taskResource.getJobDescription());
+            jobDetails.setCreationTime(taskResource.getCreationTime().getTime());
+            StatusResource jobStatus = taskResource.getJobStatus();
             jobDetails.setJobStatus(getJobStatus(jobStatus));
-            jobDetails.setJobName(jobDetailResource.getJobName());
-            jobDetails.setWorkingDir(jobDetailResource.getWorkingDir());
-            StatusResource applicationStatus = jobDetailResource.getApplicationStatus();
+            jobDetails.setJobName(taskResource.getJobName());
+            jobDetails.setWorkingDir(taskResource.getWorkingDir());
+            StatusResource applicationStatus = taskResource.getApplicationStatus();
             jobDetails.setJobStatus(getJobStatus(applicationStatus));
-            jobDetails.setComputeResourceConsumed(jobDetailResource.getComputeResourceConsumed());
+            jobDetails.setComputeResourceConsumed(taskResource.getComputeResourceConsumed());
             return jobDetails;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f366c384/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
index 89ecd0e..29e5050 100644
--- a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
+++ b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
@@ -66,31 +66,27 @@
     </persistence-unit>
     <persistence-unit name="experiment_data">
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.Experiment</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentError</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentInput</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentOutput</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentStatus</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentSummary</class>
         <class>org.apache.airavata.registry.core.experiment.catalog.model.Gateway</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Configuration</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Users</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Gateway_Worker</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.GatewayWorker</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.Process</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessError</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessInput</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessOutput</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessResourceSchedule</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessStatus</class>
         <class>org.apache.airavata.registry.core.experiment.catalog.model.Project</class>
         <class>org.apache.airavata.registry.core.experiment.catalog.model.ProjectUser</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Experiment</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Notification_Email</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Experiment_Input</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Experiment_Output</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.WorkflowNodeDetail</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.TaskDetail</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.ErrorDetail</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.ApplicationInput</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.ApplicationOutput</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.NodeInput</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.NodeOutput</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.JobDetail</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.DataTransferDetail</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Status</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentConfigData</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.Computational_Resource_Scheduling</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.AdvancedInputDataHandling</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.AdvancedOutputDataHandling</class>
-        <class>org.apache.airavata.registry.core.experiment.catalog.model.QosParam</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.Task</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.TaskError</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.TaskStatus</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.User</class>
+        <class>org.apache.airavata.registry.core.experiment.catalog.model.UserConfigurationData</class>
         <exclude-unlisted-classes>true</exclude-unlisted-classes>
     </persistence-unit>
 </persistence>


Mime
View raw message