airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [2/3] adding created time and update time to app catalog
Date Thu, 14 Aug 2014 20:24:36 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
index db7080d..6a5b88e 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
@@ -1,360 +1,360 @@
-/**
- * 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.aiaravata.application.catalog.data.resources;
-
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
-import org.apache.aiaravata.application.catalog.data.model.DataMovementProtocol;
-import org.apache.aiaravata.application.catalog.data.model.DataMovementProtocolPK;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DataMovementProtocolResource extends AbstractResource {
-
-    private final static Logger logger = LoggerFactory.getLogger(DataMovementProtocolResource.class);
-
-    private String resourceID;
-    private String dataMoveID;
-    private String dataMoveType;
-    private ComputeResourceResource computeHostResource;
-
-    public void remove(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
-            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE));
-            generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, ids.get(DataMoveProtocolConstants.RESOURCE_ID));
-            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, ids.get(DataMoveProtocolConstants.DATA_MOVE_ID));
-            Query q = generator.deleteQuery(em);
-            q.executeUpdate();
-            em.getTransaction().commit();
-            em.close();
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public Resource get(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
-            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE));
-            generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, ids.get(DataMoveProtocolConstants.RESOURCE_ID));
-            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, ids.get(DataMoveProtocolConstants.DATA_MOVE_ID));
-            Query q = generator.selectQuery(em);
-            DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) q.getSingleResult();
-            DataMovementProtocolResource dataMovementProtocolResource =
-                    (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
-            em.getTransaction().commit();
-            em.close();
-            return dataMovementProtocolResource;
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public List<Resource> get(String fieldName, Object value) throws AppCatalogException {
-        List<Resource> dataMoveProtocolResourcesList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
-            List results;
-            if (fieldName.equals(DataMoveProtocolConstants.RESOURCE_ID)) {
-                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        DataMovementProtocolResource dataMovementProtocolResource =
-                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
-                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
-                    }
-                }
-            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
-                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        DataMovementProtocolResource dataMovementProtocolResource =
-                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
-                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
-                    }
-                }
-            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_ID)) {
-                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        DataMovementProtocolResource dataMovementProtocolResource =
-                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
-                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
-                    }
-                }
-            } else {
-                em.getTransaction().commit();
-                em.close();
-                logger.error("Unsupported field name for Data Movement Protocol Resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported field name for Data Movement Protocol Resource.");
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return dataMoveProtocolResourcesList;
-    }
-
-    @Override
-    public List<Resource> getAll() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-    public List<String> getAllIds() throws AppCatalogException {
-        return null;
-    }
-
-    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
-        List<String> dataMovementProtocolIDs = new ArrayList<String>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
-            List results;
-            if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_ID)) {
-                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
-                    }
-                }
-            } else if (fieldName.equals(DataMoveProtocolConstants.RESOURCE_ID)) {
-                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
-                    }
-                }
-            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
-                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
-                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
-                    }
-                }
-            } else {
-                em.getTransaction().commit();
-                em.close();
-                logger.error("Unsupported field name for Data Move Protocol resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported field name for Data Move Protocol Resource.");
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return dataMovementProtocolIDs;
-    }
-
-    public void save() throws AppCatalogException {
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            DataMovementProtocol existingDataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(resourceID, dataMoveID, dataMoveType));
-            em.close();
-
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            if (existingDataMovementProtocol != null) {
-                existingDataMovementProtocol.setDataMoveID(dataMoveType);
-                existingDataMovementProtocol.setDataMoveID(dataMoveID);
-                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
-                existingDataMovementProtocol.setComputeResource(computeResource);
-                existingDataMovementProtocol.setResourceID(resourceID);
-                em.merge(existingDataMovementProtocol);
-            } else {
-                DataMovementProtocol dataMovementProtocol = new DataMovementProtocol();
-                dataMovementProtocol.setDataMoveType(dataMoveType);
-                dataMovementProtocol.setDataMoveID(dataMoveID);
-                dataMovementProtocol.setResourceID(resourceID);
-                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
-                dataMovementProtocol.setComputeResource(computeResource);
-                em.persist(dataMovementProtocol);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public boolean isExists(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            DataMovementProtocol dataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(
-                    ids.get(DataMoveProtocolConstants.RESOURCE_ID),
-                    ids.get(DataMoveProtocolConstants.DATA_MOVE_ID), ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE)));
-
-            em.close();
-            return dataMovementProtocol != null;
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public String getResourceID() {
-        return resourceID;
-    }
-
-    public void setResourceID(String resourceID) {
-        this.resourceID = resourceID;
-    }
-
-    public String getDataMoveID() {
-        return dataMoveID;
-    }
-
-    public void setDataMoveID(String dataMoveID) {
-        this.dataMoveID = dataMoveID;
-    }
-
-    public String getDataMoveType() {
-        return dataMoveType;
-    }
-
-    public void setDataMoveType(String dataMoveType) {
-        this.dataMoveType = dataMoveType;
-    }
-
-    public ComputeResourceResource getComputeHostResource() {
-        return computeHostResource;
-    }
-
-    public void setComputeHostResource(ComputeResourceResource computeHostResource) {
-        this.computeHostResource = computeHostResource;
-    }
-}
+///**
+// * 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.aiaravata.application.catalog.data.resources;
+//
+//import org.airavata.appcatalog.cpi.AppCatalogException;
+//import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
+//import org.apache.aiaravata.application.catalog.data.model.DataMovementProtocol;
+//import org.apache.aiaravata.application.catalog.data.model.DataMovementProtocolPK;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
+//import org.apache.airavata.common.exception.ApplicationSettingsException;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import javax.persistence.EntityManager;
+//import javax.persistence.Query;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//public class DataMovementProtocolResource extends AbstractResource {
+//
+//    private final static Logger logger = LoggerFactory.getLogger(DataMovementProtocolResource.class);
+//
+//    private String resourceID;
+//    private String dataMoveID;
+//    private String dataMoveType;
+//    private ComputeResourceResource computeHostResource;
+//
+//    public void remove(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
+//            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE));
+//            generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, ids.get(DataMoveProtocolConstants.RESOURCE_ID));
+//            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, ids.get(DataMoveProtocolConstants.DATA_MOVE_ID));
+//            Query q = generator.deleteQuery(em);
+//            q.executeUpdate();
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public Resource get(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
+//            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE));
+//            generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, ids.get(DataMoveProtocolConstants.RESOURCE_ID));
+//            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, ids.get(DataMoveProtocolConstants.DATA_MOVE_ID));
+//            Query q = generator.selectQuery(em);
+//            DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) q.getSingleResult();
+//            DataMovementProtocolResource dataMovementProtocolResource =
+//                    (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
+//            em.getTransaction().commit();
+//            em.close();
+//            return dataMovementProtocolResource;
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+//        List<Resource> dataMoveProtocolResourcesList = new ArrayList<Resource>();
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            Query q;
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
+//            List results;
+//            if (fieldName.equals(DataMoveProtocolConstants.RESOURCE_ID)) {
+//                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        DataMovementProtocolResource dataMovementProtocolResource =
+//                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
+//                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
+//                    }
+//                }
+//            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
+//                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        DataMovementProtocolResource dataMovementProtocolResource =
+//                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
+//                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
+//                    }
+//                }
+//            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_ID)) {
+//                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        DataMovementProtocolResource dataMovementProtocolResource =
+//                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
+//                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
+//                    }
+//                }
+//            } else {
+//                em.getTransaction().commit();
+//                em.close();
+//                logger.error("Unsupported field name for Data Movement Protocol Resource.", new IllegalArgumentException());
+//                throw new IllegalArgumentException("Unsupported field name for Data Movement Protocol Resource.");
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//        return dataMoveProtocolResourcesList;
+//    }
+//
+//    @Override
+//    public List<Resource> getAll() throws AppCatalogException {
+//        return null;
+//    }
+//
+//    @Override
+//    public List<String> getAllIds() throws AppCatalogException {
+//        return null;
+//    }
+//
+//    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+//        List<String> dataMovementProtocolIDs = new ArrayList<String>();
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            Query q;
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
+//            List results;
+//            if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_ID)) {
+//                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
+//                    }
+//                }
+//            } else if (fieldName.equals(DataMoveProtocolConstants.RESOURCE_ID)) {
+//                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
+//                    }
+//                }
+//            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
+//                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
+//                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
+//                    }
+//                }
+//            } else {
+//                em.getTransaction().commit();
+//                em.close();
+//                logger.error("Unsupported field name for Data Move Protocol resource.", new IllegalArgumentException());
+//                throw new IllegalArgumentException("Unsupported field name for Data Move Protocol Resource.");
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//        return dataMovementProtocolIDs;
+//    }
+//
+//    public void save() throws AppCatalogException {
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            DataMovementProtocol existingDataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(resourceID, dataMoveID, dataMoveType));
+//            em.close();
+//
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            if (existingDataMovementProtocol != null) {
+//                existingDataMovementProtocol.setDataMoveID(dataMoveType);
+//                existingDataMovementProtocol.setDataMoveID(dataMoveID);
+//                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
+//                existingDataMovementProtocol.setComputeResource(computeResource);
+//                existingDataMovementProtocol.setResourceID(resourceID);
+//                em.merge(existingDataMovementProtocol);
+//            } else {
+//                DataMovementProtocol dataMovementProtocol = new DataMovementProtocol();
+//                dataMovementProtocol.setDataMoveType(dataMoveType);
+//                dataMovementProtocol.setDataMoveID(dataMoveID);
+//                dataMovementProtocol.setResourceID(resourceID);
+//                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
+//                dataMovementProtocol.setComputeResource(computeResource);
+//                em.persist(dataMovementProtocol);
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public boolean isExists(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            DataMovementProtocol dataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(
+//                    ids.get(DataMoveProtocolConstants.RESOURCE_ID),
+//                    ids.get(DataMoveProtocolConstants.DATA_MOVE_ID), ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE)));
+//
+//            em.close();
+//            return dataMovementProtocol != null;
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public String getResourceID() {
+//        return resourceID;
+//    }
+//
+//    public void setResourceID(String resourceID) {
+//        this.resourceID = resourceID;
+//    }
+//
+//    public String getDataMoveID() {
+//        return dataMoveID;
+//    }
+//
+//    public void setDataMoveID(String dataMoveID) {
+//        this.dataMoveID = dataMoveID;
+//    }
+//
+//    public String getDataMoveType() {
+//        return dataMoveType;
+//    }
+//
+//    public void setDataMoveType(String dataMoveType) {
+//        this.dataMoveType = dataMoveType;
+//    }
+//
+//    public ComputeResourceResource getComputeHostResource() {
+//        return computeHostResource;
+//    }
+//
+//    public void setComputeHostResource(ComputeResourceResource computeHostResource) {
+//        this.computeHostResource = computeHostResource;
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GatewayProfileResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GatewayProfileResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GatewayProfileResource.java
index 47c1c8a..3fe339a 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GatewayProfileResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GatewayProfileResource.java
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,6 +40,24 @@ public class GatewayProfileResource extends AbstractResource {
     private String gatewayID;
     private String gatewayName;
     private String gatewayDesc;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 
     public void remove(Object identifier) throws AppCatalogException {
         EntityManager em = null;
@@ -220,12 +239,14 @@ public class GatewayProfileResource extends AbstractResource {
             if (existingGatewayProfile != null) {
                 existingGatewayProfile.setGatewayDesc(gatewayDesc);
                 existingGatewayProfile.setGatewayName(gatewayName);
+                existingGatewayProfile.setUpdateTime(updatedTime);
                 em.merge(existingGatewayProfile);
             } else {
                 GatewayProfile gatewayProfile = new GatewayProfile();
                 gatewayProfile.setGatewayID(gatewayID);
                 gatewayProfile.setGatewayName(gatewayName);
                 gatewayProfile.setGatewayDesc(gatewayDesc);
+                gatewayProfile.setCreationTime(createdTime);
                 em.persist(gatewayProfile);
             }
             em.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
index 2b350c9..70b9af9 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
@@ -19,6 +19,7 @@
 
 package org.apache.aiaravata.application.catalog.data.resources;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -38,6 +39,24 @@ public class GridftpDataMovementResource extends AbstractResource {
 	private final static Logger logger = LoggerFactory.getLogger(GridftpDataMovementResource.class);
 	private String dataMovementInterfaceId;
 	private String securityProtocol;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -193,8 +212,10 @@ public class GridftpDataMovementResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingGridftpDataMovement == null) {
 				gridftpDataMovement = new GridftpDataMovement();
+                gridftpDataMovement.setCreationTime(createdTime);
 			} else {
 				gridftpDataMovement = existingGridftpDataMovement;
+                gridftpDataMovement.setUpdateTime(updatedTime);
 			}
 			gridftpDataMovement.setDataMovementInterfaceId(getDataMovementInterfaceId());
 			gridftpDataMovement.setSecurityProtocol(getSecurityProtocol());

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpEndpointResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpEndpointResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpEndpointResource.java
index d325fdf..8364711 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpEndpointResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpEndpointResource.java
@@ -19,6 +19,7 @@
 
 package org.apache.aiaravata.application.catalog.data.resources;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -43,6 +44,24 @@ public class GridftpEndpointResource extends AbstractResource {
 	private String endpoint;
 	private String dataMovementInterfaceId;
 	private GridftpDataMovementResource gridftpDataMovementResource;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -214,8 +233,10 @@ public class GridftpEndpointResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingGridftpEndpoint == null) {
 				gridftpEndpoint = new GridftpEndpoint();
+                gridftpEndpoint.setCreationTime(createdTime);
 			} else {
 				gridftpEndpoint = existingGridftpEndpoint;
+                gridftpEndpoint.setUpdateTime(updatedTime);
 			}
 			gridftpEndpoint.setEndpoint(getEndpoint());
 			gridftpEndpoint.setDataMovementInterfaceId(getDataMovementInterfaceId());

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionInterfaceResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionInterfaceResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionInterfaceResource.java
index 745dd93..8654789 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionInterfaceResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionInterfaceResource.java
@@ -21,6 +21,7 @@
 
 package org.apache.aiaravata.application.catalog.data.resources;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -47,6 +48,24 @@ public class JobSubmissionInterfaceResource extends AbstractResource {
 	private ComputeResourceResource computeHostResource;
 	private String jobSubmissionProtocol;
 	private int priorityOrder;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -218,8 +237,10 @@ public class JobSubmissionInterfaceResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingJobSubmissionInterface == null) {
 				jobSubmissionInterface = new JobSubmissionInterface();
+                jobSubmissionInterface.setCreationTime(createdTime);
 			} else {
 				jobSubmissionInterface = existingJobSubmissionInterface;
+                jobSubmissionInterface.setUpdateTime(updatedTime);
 			}
 			jobSubmissionInterface.setJobSubmissionInterfaceId(getJobSubmissionInterfaceId());
 			jobSubmissionInterface.setComputeResourceId(getComputeResourceId());

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
index 6c965a2..d6134af 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
@@ -1,359 +1,359 @@
-/**
- * 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.aiaravata.application.catalog.data.resources;
-
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
-import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocol;
-import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocolPK;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
-import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class JobSubmissionProtocolResource extends AbstractResource {
-
-    private final static Logger logger = LoggerFactory.getLogger(JobSubmissionProtocolResource.class);
-
-    private String resourceID;
-    private String submissionID;
-    private String jobType;
-    private ComputeResourceResource computeHostResource;
-
-    public void remove(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
-            generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
-            generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
-            generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
-            Query q = generator.deleteQuery(em);
-            q.executeUpdate();
-            em.getTransaction().commit();
-            em.close();
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public Resource get(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
-            generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
-            generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
-            generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
-            Query q = generator.selectQuery(em);
-            JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) q.getSingleResult();
-            JobSubmissionProtocolResource jobSubmissionProtocolResource =
-                    (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
-            em.getTransaction().commit();
-            em.close();
-            return jobSubmissionProtocolResource;
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public List<Resource> get(String fieldName, Object value) throws AppCatalogException {
-        List<Resource> jobSubmissionProtocolResourceList = new ArrayList<Resource>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
-            List results;
-            if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
-                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
-                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
-                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
-                    }
-                }
-            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
-                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
-                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
-                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
-                    }
-                }
-            } else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
-                generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
-                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
-                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
-                    }
-                }
-            } else {
-                em.getTransaction().commit();
-                em.close();
-                logger.error("Unsupported field name for Job Submission Protocol Resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol Resource.");
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return jobSubmissionProtocolResourceList;
-    }
-
-    @Override
-    public List<Resource> getAll() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-    public List<String> getAllIds() throws AppCatalogException {
-        return null;
-    }
-
-    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
-        List<String> jobSubmissionProtocolIDs = new ArrayList<String>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
-            List results;
-            if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
-                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
-                    }
-                }
-            } else if (fieldName.equals(JobSubmissionProtocolConstants.RESOURCE_ID)) {
-                generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
-                    }
-                }
-            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
-                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
-                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
-                    }
-                }
-            } else {
-                em.getTransaction().commit();
-                em.close();
-                logger.error("Unsupported field name for Job Submission Protocol resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol Resource.");
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return jobSubmissionProtocolIDs;
-    }
-
-    public void save() throws AppCatalogException {
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            JobSubmissionProtocol existingJobSubProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(resourceID, submissionID, jobType));
-            em.close();
-
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
-            if (existingJobSubProtocol != null) {
-                existingJobSubProtocol.setJobType(jobType);
-                existingJobSubProtocol.setSubmissionID(submissionID);
-                existingJobSubProtocol.setComputeResource(computeResource);
-                existingJobSubProtocol.setResourceID(resourceID);
-                em.merge(existingJobSubProtocol);
-            } else {
-                JobSubmissionProtocol jobSubmissionProtocol = new JobSubmissionProtocol();
-                jobSubmissionProtocol.setJobType(jobType);
-                jobSubmissionProtocol.setSubmissionID(submissionID);
-                jobSubmissionProtocol.setResourceID(resourceID);
-                jobSubmissionProtocol.setComputeResource(computeResource);
-                em.persist(jobSubmissionProtocol);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-
-    }
-
-    public boolean isExists(Object identifier) throws AppCatalogException {
-        HashMap<String, String> ids;
-        if (identifier instanceof Map) {
-            ids = (HashMap) identifier;
-        } else {
-            logger.error("Identifier should be a map with the field name and it's value");
-            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
-        }
-
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            JobSubmissionProtocol jobSubmissionProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(ids.get(JobSubmissionProtocolConstants.RESOURCE_ID),
-                    ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID), ids.get(JobSubmissionProtocolConstants.JOB_TYPE)));
-
-            em.close();
-            return jobSubmissionProtocol != null;
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage(), e);
-            throw new AppCatalogException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()) {
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-    }
-
-    public String getResourceID() {
-        return resourceID;
-    }
-
-    public void setResourceID(String resourceID) {
-        this.resourceID = resourceID;
-    }
-
-    public String getSubmissionID() {
-        return submissionID;
-    }
-
-    public void setSubmissionID(String submissionID) {
-        this.submissionID = submissionID;
-    }
-
-    public String getJobType() {
-        return jobType;
-    }
-
-    public void setJobType(String jobType) {
-        this.jobType = jobType;
-    }
-
-    public ComputeResourceResource getComputeHostResource() {
-        return computeHostResource;
-    }
-
-    public void setComputeHostResource(ComputeResourceResource computeHostResource) {
-        this.computeHostResource = computeHostResource;
-    }
-}
+///**
+// * 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.aiaravata.application.catalog.data.resources;
+//
+//import org.airavata.appcatalog.cpi.AppCatalogException;
+//import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
+//import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocol;
+//import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocolPK;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
+//import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
+//import org.apache.airavata.common.exception.ApplicationSettingsException;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import javax.persistence.EntityManager;
+//import javax.persistence.Query;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//public class JobSubmissionProtocolResource extends AbstractResource {
+//
+//    private final static Logger logger = LoggerFactory.getLogger(JobSubmissionProtocolResource.class);
+//
+//    private String resourceID;
+//    private String submissionID;
+//    private String jobType;
+//    private ComputeResourceResource computeHostResource;
+//
+//    public void remove(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+//            generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
+//            generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
+//            generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
+//            Query q = generator.deleteQuery(em);
+//            q.executeUpdate();
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public Resource get(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+//            generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
+//            generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
+//            generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
+//            Query q = generator.selectQuery(em);
+//            JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) q.getSingleResult();
+//            JobSubmissionProtocolResource jobSubmissionProtocolResource =
+//                    (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+//            em.getTransaction().commit();
+//            em.close();
+//            return jobSubmissionProtocolResource;
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+//        List<Resource> jobSubmissionProtocolResourceList = new ArrayList<Resource>();
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            Query q;
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+//            List results;
+//            if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
+//                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
+//                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+//                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+//                    }
+//                }
+//            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
+//                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
+//                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+//                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+//                    }
+//                }
+//            } else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
+//                generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
+//                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+//                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+//                    }
+//                }
+//            } else {
+//                em.getTransaction().commit();
+//                em.close();
+//                logger.error("Unsupported field name for Job Submission Protocol Resource.", new IllegalArgumentException());
+//                throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol Resource.");
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//        return jobSubmissionProtocolResourceList;
+//    }
+//
+//    @Override
+//    public List<Resource> getAll() throws AppCatalogException {
+//        return null;
+//    }
+//
+//    @Override
+//    public List<String> getAllIds() throws AppCatalogException {
+//        return null;
+//    }
+//
+//    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+//        List<String> jobSubmissionProtocolIDs = new ArrayList<String>();
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            Query q;
+//            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+//            List results;
+//            if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
+//                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
+//                    }
+//                }
+//            } else if (fieldName.equals(JobSubmissionProtocolConstants.RESOURCE_ID)) {
+//                generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
+//                    }
+//                }
+//            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
+//                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
+//                q = generator.selectQuery(em);
+//                results = q.getResultList();
+//                if (results.size() != 0) {
+//                    for (Object result : results) {
+//                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+//                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
+//                    }
+//                }
+//            } else {
+//                em.getTransaction().commit();
+//                em.close();
+//                logger.error("Unsupported field name for Job Submission Protocol resource.", new IllegalArgumentException());
+//                throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol Resource.");
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//        return jobSubmissionProtocolIDs;
+//    }
+//
+//    public void save() throws AppCatalogException {
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            JobSubmissionProtocol existingJobSubProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(resourceID, submissionID, jobType));
+//            em.close();
+//
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            em.getTransaction().begin();
+//            ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
+//            if (existingJobSubProtocol != null) {
+//                existingJobSubProtocol.setJobType(jobType);
+//                existingJobSubProtocol.setSubmissionID(submissionID);
+//                existingJobSubProtocol.setComputeResource(computeResource);
+//                existingJobSubProtocol.setResourceID(resourceID);
+//                em.merge(existingJobSubProtocol);
+//            } else {
+//                JobSubmissionProtocol jobSubmissionProtocol = new JobSubmissionProtocol();
+//                jobSubmissionProtocol.setJobType(jobType);
+//                jobSubmissionProtocol.setSubmissionID(submissionID);
+//                jobSubmissionProtocol.setResourceID(resourceID);
+//                jobSubmissionProtocol.setComputeResource(computeResource);
+//                em.persist(jobSubmissionProtocol);
+//            }
+//            em.getTransaction().commit();
+//            em.close();
+//        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//
+//    }
+//
+//    public boolean isExists(Object identifier) throws AppCatalogException {
+//        HashMap<String, String> ids;
+//        if (identifier instanceof Map) {
+//            ids = (HashMap) identifier;
+//        } else {
+//            logger.error("Identifier should be a map with the field name and it's value");
+//            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+//        }
+//
+//        EntityManager em = null;
+//        try {
+//            em = AppCatalogJPAUtils.getEntityManager();
+//            JobSubmissionProtocol jobSubmissionProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(ids.get(JobSubmissionProtocolConstants.RESOURCE_ID),
+//                    ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID), ids.get(JobSubmissionProtocolConstants.JOB_TYPE)));
+//
+//            em.close();
+//            return jobSubmissionProtocol != null;
+//        } catch (ApplicationSettingsException e) {
+//            logger.error(e.getMessage(), e);
+//            throw new AppCatalogException(e);
+//        } finally {
+//            if (em != null && em.isOpen()) {
+//                if (em.getTransaction().isActive()) {
+//                    em.getTransaction().rollback();
+//                }
+//                em.close();
+//            }
+//        }
+//    }
+//
+//    public String getResourceID() {
+//        return resourceID;
+//    }
+//
+//    public void setResourceID(String resourceID) {
+//        this.resourceID = resourceID;
+//    }
+//
+//    public String getSubmissionID() {
+//        return submissionID;
+//    }
+//
+//    public void setSubmissionID(String submissionID) {
+//        this.submissionID = submissionID;
+//    }
+//
+//    public String getJobType() {
+//        return jobType;
+//    }
+//
+//    public void setJobType(String jobType) {
+//        this.jobType = jobType;
+//    }
+//
+//    public ComputeResourceResource getComputeHostResource() {
+//        return computeHostResource;
+//    }
+//
+//    public void setComputeHostResource(ComputeResourceResource computeHostResource) {
+//        this.computeHostResource = computeHostResource;
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/LocalSubmissionResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/LocalSubmissionResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/LocalSubmissionResource.java
index 6774b04..e954fae 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/LocalSubmissionResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/LocalSubmissionResource.java
@@ -21,6 +21,7 @@
 
 package org.apache.aiaravata.application.catalog.data.resources;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,6 +43,24 @@ public class LocalSubmissionResource extends AbstractResource {
 	private String resourceJobManagerId;
 	private ResourceJobManagerResource resourceJobManagerResource;
 	private String jobSubmissionInterfaceId;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -197,8 +216,10 @@ public class LocalSubmissionResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingLocalSubmission == null) {
 				localSubmission = new LocalSubmission();
+                localSubmission.setCreationTime(createdTime);
 			} else {
 				localSubmission = existingLocalSubmission;
+                localSubmission.setUpdateTime(updatedTime);
 			}
 			localSubmission.setResourceJobManagerId(getResourceJobManagerId());
 			ResourceJobManager resourceJobManager = em.find(ResourceJobManager.class, getResourceJobManagerId());

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ResourceJobManagerResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ResourceJobManagerResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ResourceJobManagerResource.java
index 7ba0141..3addb71 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ResourceJobManagerResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ResourceJobManagerResource.java
@@ -21,6 +21,7 @@
 
 package org.apache.aiaravata.application.catalog.data.resources;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,6 +43,24 @@ public class ResourceJobManagerResource extends AbstractResource {
 	private String pushMonitoringEndpoint;
 	private String jobManagerBinPath;
 	private String resourceJobManagerType;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -197,8 +216,10 @@ public class ResourceJobManagerResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingResourceJobManager == null) {
 				resourceJobManager = new ResourceJobManager();
+                resourceJobManager.setCreationTime(createdTime);
 			} else {
 				resourceJobManager = existingResourceJobManager;
+                resourceJobManager.setUpdateTime(updatedTime);
 			}
 			resourceJobManager.setResourceJobManagerId(getResourceJobManagerId());
 			resourceJobManager.setPushMonitoringEndpoint(getPushMonitoringEndpoint());

http://git-wip-us.apache.org/repos/asf/airavata/blob/404913ac/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ScpDataMovementResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ScpDataMovementResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ScpDataMovementResource.java
index b1fccfe..8c995b6 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ScpDataMovementResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/ScpDataMovementResource.java
@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -40,6 +41,24 @@ public class ScpDataMovementResource extends AbstractResource {
 	private String securityProtocol;
 	private String alternativeScpHostname;
 	private int sshPort;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
 	
 	@Override
 	public void remove(Object identifier) throws AppCatalogException {
@@ -195,8 +214,10 @@ public class ScpDataMovementResource extends AbstractResource {
 			em.getTransaction().begin();
 			if (existingScpDataMovement == null) {
 				scpDataMovement = new ScpDataMovement();
+                scpDataMovement.setCreationTime(createdTime);
 			} else {
 				scpDataMovement = existingScpDataMovement;
+                scpDataMovement.setUpdateTime(updatedTime);
 			}
 			scpDataMovement.setQueueDescription(getQueueDescription());
 			scpDataMovement.setDataMovementInterfaceId(getDataMovementInterfaceId());


Mime
View raw message