airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [24/30] airavata git commit: registry refactoring changes
Date Fri, 05 Jun 2015 16:26:14 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/4045c094/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/CloudSubmissionResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/CloudSubmissionResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/CloudSubmissionResource.java
new file mode 100644
index 0000000..d899a66
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/CloudSubmissionResource.java
@@ -0,0 +1,298 @@
+/*
+ *
+ * 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.app.catalog.resources;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.registry.core.app.catalog.model.CloudJobSubmission;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CloudSubmissionResource extends AppCatAbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(LocalSubmissionResource.class);
+    private String jobSubmissionInterfaceId;
+    private String securityProtocol;
+    private String nodeId;
+    private String executableType;
+    private String providerName;
+    private String userAccountName;
+
+    @Override
+    public void remove(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(CLOUD_JOB_SUBMISSION);
+            generator.setParameter(LocalSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID, identifier);
+            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();
+            }
+        }
+    }
+
+    @Override
+    public AppCatalogResource get(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(CLOUD_JOB_SUBMISSION);
+            generator.setParameter(LocalSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID, identifier);
+            Query q = generator.selectQuery(em);
+            CloudJobSubmission cloudJobSubmission = (CloudJobSubmission) q.getSingleResult();
+            CloudSubmissionResource localSubmissionResource = (CloudSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.ClOUD_SUBMISSION, cloudJobSubmission);
+            em.getTransaction().commit();
+            em.close();
+            return localSubmissionResource;
+        } 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();
+            }
+        }
+    }
+
+    @Override
+    public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
+        List<AppCatalogResource> localSubmissionResources = new ArrayList<AppCatalogResource>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(CLOUD_JOB_SUBMISSION);
+            Query q;
+            if ((fieldName.equals(LocalSubmissionConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(LocalSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID))) {
+                generator.setParameter(fieldName, value);
+                q = generator.selectQuery(em);
+                List<?> results = q.getResultList();
+                for (Object result : results) {
+                    CloudJobSubmission localSubmission = (CloudJobSubmission) result;
+                    CloudSubmissionResource localSubmissionResource = (CloudSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.ClOUD_SUBMISSION, localSubmission);
+                    localSubmissionResources.add(localSubmissionResource);
+                }
+            } else {
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported field name for Local Submission Resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported field name for Local Submission Resource.");
+            }
+            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();
+            }
+        }
+        return localSubmissionResources;
+    }
+
+    @Override
+    public List<AppCatalogResource> getAll() throws AppCatalogException {
+        return null;
+    }
+
+    @Override
+    public List<String> getAllIds() throws AppCatalogException {
+        return null;
+    }
+
+    @Override
+    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+        List<String> localSubmissionResourceIDs = new ArrayList<String>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(CLOUD_JOB_SUBMISSION);
+            Query q;
+            if ((fieldName.equals(LocalSubmissionConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(LocalSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID))) {
+                generator.setParameter(fieldName, value);
+                q = generator.selectQuery(em);
+                List<?> results = q.getResultList();
+                for (Object result : results) {
+                    CloudJobSubmission localSubmission = (CloudJobSubmission) result;
+                    LocalSubmissionResource localSubmissionResource = (LocalSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.ClOUD_SUBMISSION, localSubmission);
+                    localSubmissionResourceIDs.add(localSubmissionResource.getJobSubmissionInterfaceId());
+                }
+            } else {
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported field name for Local Submission Resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported field name for Local Submission Resource.");
+            }
+            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();
+            }
+        }
+        return localSubmissionResourceIDs;
+    }
+
+    @Override
+    public void save() throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            CloudJobSubmission existingLocalSubmission = em.find(CloudJobSubmission.class, jobSubmissionInterfaceId);
+            em.close();
+            CloudJobSubmission cloudJobSubmission;
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            if (existingLocalSubmission == null) {
+                cloudJobSubmission = new CloudJobSubmission();
+            } else {
+                cloudJobSubmission = existingLocalSubmission;
+            }
+            cloudJobSubmission.setExecutableType(getExecutableType());
+            cloudJobSubmission.setNodeId(getNodeId());
+            cloudJobSubmission.setJobSubmissionInterfaceId(getJobSubmissionInterfaceId());
+            cloudJobSubmission.setSecurityProtocol(getSecurityProtocol());
+            cloudJobSubmission.setJobSubmissionInterfaceId(getJobSubmissionInterfaceId());
+            cloudJobSubmission.setUserAccountName(getUserAccountName());
+            cloudJobSubmission.setProviderName(getProviderName());
+            if (existingLocalSubmission == null) {
+                em.persist(cloudJobSubmission);
+            } else {
+                em.merge(cloudJobSubmission);
+            }
+            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();
+            }
+        }
+    }
+
+    @Override
+    public boolean isExists(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            CloudJobSubmission localSubmission = em.find(CloudJobSubmission.class, identifier);
+            em.close();
+            return localSubmission != 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 getJobSubmissionInterfaceId() {
+        return jobSubmissionInterfaceId;
+    }
+
+    public String getSecurityProtocol() {
+        return securityProtocol;
+    }
+
+    public void setSecurityProtocol(String securityProtocol) {
+        this.securityProtocol = securityProtocol;
+    }
+
+    public String getNodeId() {
+        return nodeId;
+    }
+
+    public void setNodeId(String nodeId) {
+        this.nodeId = nodeId;
+    }
+
+    public String getExecutableType() {
+        return executableType;
+    }
+
+    public void setExecutableType(String executableType) {
+        this.executableType = executableType;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public void setProviderName(String providerName) {
+        this.providerName = providerName;
+    }
+
+    public String getUserAccountName() {
+        return userAccountName;
+    }
+
+    public void setUserAccountName(String userAccountName) {
+        this.userAccountName = userAccountName;
+    }
+
+    public void setJobSubmissionInterfaceId(String jobSubmissionInterfaceId) {
+        this.jobSubmissionInterfaceId=jobSubmissionInterfaceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/4045c094/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceAppCatalogResourceAppCat.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceAppCatalogResourceAppCat.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceAppCatalogResourceAppCat.java
deleted file mode 100644
index 80f03f7..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceAppCatalogResourceAppCat.java
+++ /dev/null
@@ -1,413 +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.app.catalog.resources;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResource;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResourcePreference;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResourcePreferencePK;
-import org.apache.airavata.registry.core.app.catalog.model.GatewayProfile;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
-import org.apache.airavata.registry.cpi.AppCatalogException;
-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 ComputeHostPreferenceAppCatalogResourceAppCat extends AppCatAbstractResource {
-    private final static Logger logger = LoggerFactory.getLogger(ComputeHostPreferenceAppCatalogResourceAppCat.class);
-    private String gatewayId;
-    private String resourceId;
-    private boolean overrideByAiravata;
-    private String preferredJobProtocol;
-    private String preferedDMProtocol;
-    private String batchQueue;
-    private String scratchLocation;
-    private String projectNumber;
-    private String loginUserName;
-
-    private GatewayProfileAppCatalogResourceAppCat gatewayProfile;
-    private ComputeResourceAppCatalogResourceAppCat computeHostResource;
-
-    public String getLoginUserName() {
-        return loginUserName;
-    }
-
-    public void setLoginUserName(String loginUserName) {
-        this.loginUserName = loginUserName;
-    }
-
-    public String getGatewayId() {
-        return gatewayId;
-    }
-
-    public void setGatewayId(String gatewayId) {
-        this.gatewayId = gatewayId;
-    }
-
-    public String getResourceId() {
-        return resourceId;
-    }
-
-    public void setResourceId(String resourceId) {
-        this.resourceId = resourceId;
-    }
-
-    public boolean getOverrideByAiravata() {
-        return overrideByAiravata;
-    }
-
-    public void setOverrideByAiravata(boolean overrideByAiravata) {
-        this.overrideByAiravata = overrideByAiravata;
-    }
-
-    public String getPreferredJobProtocol() {
-        return preferredJobProtocol;
-    }
-
-    public void setPreferredJobProtocol(String preferredJobProtocol) {
-        this.preferredJobProtocol = preferredJobProtocol;
-    }
-
-    public String getPreferedDMProtocol() {
-        return preferedDMProtocol;
-    }
-
-    public void setPreferedDMProtocol(String preferedDMProtocol) {
-        this.preferedDMProtocol = preferedDMProtocol;
-    }
-
-    public String getBatchQueue() {
-        return batchQueue;
-    }
-
-    public void setBatchQueue(String batchQueue) {
-        this.batchQueue = batchQueue;
-    }
-
-    public String getScratchLocation() {
-        return scratchLocation;
-    }
-
-    public void setScratchLocation(String scratchLocation) {
-        this.scratchLocation = scratchLocation;
-    }
-
-    public String getProjectNumber() {
-        return projectNumber;
-    }
-
-    public void setProjectNumber(String projectNumber) {
-        this.projectNumber = projectNumber;
-    }
-
-    public GatewayProfileAppCatalogResourceAppCat getGatewayProfile() {
-        return gatewayProfile;
-    }
-
-    public void setGatewayProfile(GatewayProfileAppCatalogResourceAppCat gatewayProfile) {
-        this.gatewayProfile = gatewayProfile;
-    }
-
-    public ComputeResourceAppCatalogResourceAppCat getComputeHostResource() {
-        return computeHostResource;
-    }
-
-    public void setComputeHostResource(ComputeResourceAppCatalogResourceAppCat computeHostResource) {
-        this.computeHostResource = computeHostResource;
-    }
-
-    @Override
-    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(COMPUTE_RESOURCE_PREFERENCE);
-            generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID));
-            generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, ids.get(ComputeResourcePreferenceConstants.GATEWAY_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();
-            }
-        }
-    }
-
-    @Override
-    public AppCatalogResource 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(COMPUTE_RESOURCE_PREFERENCE);
-            generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, ids.get(ComputeResourcePreferenceConstants.GATEWAY_ID));
-            generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID));
-            Query q = generator.selectQuery(em);
-            ComputeResourcePreference preference = (ComputeResourcePreference) q.getSingleResult();
-            ComputeHostPreferenceAppCatalogResourceAppCat preferenceResource =
-                    (ComputeHostPreferenceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE, preference);
-            em.getTransaction().commit();
-            em.close();
-            return preferenceResource;
-        } 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();
-            }
-        }
-    }
-
-    @Override
-    public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
-        List<AppCatalogResource> preferenceResourceList = new ArrayList<AppCatalogResource>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE_PREFERENCE);
-            List results;
-            if (fieldName.equals(ComputeResourcePreferenceConstants.RESOURCE_ID)) {
-                generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
-                        if (preference.getComputeHostResource()!=null) {
-							ComputeHostPreferenceAppCatalogResourceAppCat preferenceResource = (ComputeHostPreferenceAppCatalogResourceAppCat) AppCatalogJPAUtils
-									.getResource(
-											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
-											preference);
-							preferenceResourceList.add(preferenceResource);
-						}
-                    }
-                }
-            } else if (fieldName.equals(ComputeResourcePreferenceConstants.GATEWAY_ID)) {
-                generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
-                        if (preference.getComputeHostResource()!=null) {
-	                        ComputeHostPreferenceAppCatalogResourceAppCat preferenceResource =
-	                                (ComputeHostPreferenceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE, preference);
-	                        preferenceResourceList.add(preferenceResource);
-                        }
-                    }
-                }
-            } else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL)) {
-                generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
-                        if (preference.getComputeHostResource()!=null) {
-							ComputeHostPreferenceAppCatalogResourceAppCat preferenceResource = (ComputeHostPreferenceAppCatalogResourceAppCat) AppCatalogJPAUtils
-									.getResource(
-											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
-											preference);
-							preferenceResourceList.add(preferenceResource);
-						}
-                    }
-                }
-            } else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL)) {
-                generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL, value);
-                q = generator.selectQuery(em);
-                results = q.getResultList();
-                if (results.size() != 0) {
-                    for (Object result : results) {
-                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
-                        if (preference.getResourceId()!=null) {
-							ComputeHostPreferenceAppCatalogResourceAppCat preferenceResource = (ComputeHostPreferenceAppCatalogResourceAppCat) AppCatalogJPAUtils
-									.getResource(
-											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
-											preference);
-							preferenceResourceList.add(preferenceResource);
-						}
-                    }
-                }
-            } else {
-                em.getTransaction().commit();
-                em.close();
-                logger.error("Unsupported field name for Compute host preference Resource.", new IllegalArgumentException());
-                throw new IllegalArgumentException("Unsupported field name for Compute host preference 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 preferenceResourceList;
-    }
-
-    @Override
-    public List<AppCatalogResource> getAll() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-    public List<String> getAllIds() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
-        logger.error("Unsupported for objects with a composite identifier");
-        throw new AppCatalogException("Unsupported for objects with a composite identifier");
-    }
-
-    @Override
-    public void save() throws AppCatalogException {
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            ComputeResourcePreference existingPreference = em.find(ComputeResourcePreference.class, new ComputeResourcePreferencePK(gatewayId, resourceId));
-            em.close();
-
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            ComputeResource computeResource = em.find(ComputeResource.class, resourceId);
-            GatewayProfile gatewayProf = em.find(GatewayProfile.class, gatewayId);
-            if (existingPreference != null) {
-                existingPreference.setResourceId(resourceId);
-                existingPreference.setGatewayId(gatewayId);
-                existingPreference.setComputeHostResource(computeResource);
-                existingPreference.setGatewayProfile(gatewayProf);
-                existingPreference.setOverrideByAiravata(overrideByAiravata);
-                existingPreference.setPreferedJobSubmissionProtocol(preferredJobProtocol);
-                existingPreference.setPreferedDataMoveProtocol(preferedDMProtocol);
-                existingPreference.setScratchLocation(scratchLocation);
-                existingPreference.setProjectNumber(projectNumber);
-                existingPreference.setBatchQueue(batchQueue);
-                existingPreference.setLoginUserName(loginUserName);
-                em.merge(existingPreference);
-            } else {
-                ComputeResourcePreference resourcePreference = new ComputeResourcePreference();
-                resourcePreference.setResourceId(resourceId);
-                resourcePreference.setGatewayId(gatewayId);
-                resourcePreference.setComputeHostResource(computeResource);
-                resourcePreference.setGatewayProfile(gatewayProf);
-                resourcePreference.setOverrideByAiravata(overrideByAiravata);
-                resourcePreference.setPreferedJobSubmissionProtocol(preferredJobProtocol);
-                resourcePreference.setPreferedDataMoveProtocol(preferedDMProtocol);
-                resourcePreference.setScratchLocation(scratchLocation);
-                resourcePreference.setProjectNumber(projectNumber);
-                resourcePreference.setBatchQueue(batchQueue);
-                resourcePreference.setLoginUserName(loginUserName);
-                em.persist(resourcePreference);
-            }
-            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();
-            }
-        }
-    }
-
-    @Override
-    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();
-            ComputeResourcePreference existingPreference = em.find(ComputeResourcePreference.class,
-                    new ComputeResourcePreferencePK(ids.get(ComputeResourcePreferenceConstants.GATEWAY_ID),
-                            ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID)));
-            em.close();
-            return existingPreference != null;
-        }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();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/4045c094/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
new file mode 100644
index 0000000..46685c2
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
@@ -0,0 +1,413 @@
+/*
+ *
+ * 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.app.catalog.resources;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.registry.core.app.catalog.model.ComputeResource;
+import org.apache.airavata.registry.core.app.catalog.model.ComputeResourcePreference;
+import org.apache.airavata.registry.core.app.catalog.model.ComputeResourcePreferencePK;
+import org.apache.airavata.registry.core.app.catalog.model.GatewayProfile;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+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 ComputeHostPreferenceResource extends AppCatAbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(ComputeHostPreferenceResource.class);
+    private String gatewayId;
+    private String resourceId;
+    private boolean overrideByAiravata;
+    private String preferredJobProtocol;
+    private String preferedDMProtocol;
+    private String batchQueue;
+    private String scratchLocation;
+    private String projectNumber;
+    private String loginUserName;
+
+    private GatewayProfileResource gatewayProfile;
+    private ComputeResourceResource computeHostResource;
+
+    public String getLoginUserName() {
+        return loginUserName;
+    }
+
+    public void setLoginUserName(String loginUserName) {
+        this.loginUserName = loginUserName;
+    }
+
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    public String getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(String resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public boolean getOverrideByAiravata() {
+        return overrideByAiravata;
+    }
+
+    public void setOverrideByAiravata(boolean overrideByAiravata) {
+        this.overrideByAiravata = overrideByAiravata;
+    }
+
+    public String getPreferredJobProtocol() {
+        return preferredJobProtocol;
+    }
+
+    public void setPreferredJobProtocol(String preferredJobProtocol) {
+        this.preferredJobProtocol = preferredJobProtocol;
+    }
+
+    public String getPreferedDMProtocol() {
+        return preferedDMProtocol;
+    }
+
+    public void setPreferedDMProtocol(String preferedDMProtocol) {
+        this.preferedDMProtocol = preferedDMProtocol;
+    }
+
+    public String getBatchQueue() {
+        return batchQueue;
+    }
+
+    public void setBatchQueue(String batchQueue) {
+        this.batchQueue = batchQueue;
+    }
+
+    public String getScratchLocation() {
+        return scratchLocation;
+    }
+
+    public void setScratchLocation(String scratchLocation) {
+        this.scratchLocation = scratchLocation;
+    }
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public GatewayProfileResource getGatewayProfile() {
+        return gatewayProfile;
+    }
+
+    public void setGatewayProfile(GatewayProfileResource gatewayProfile) {
+        this.gatewayProfile = gatewayProfile;
+    }
+
+    public ComputeResourceResource getComputeHostResource() {
+        return computeHostResource;
+    }
+
+    public void setComputeHostResource(ComputeResourceResource computeHostResource) {
+        this.computeHostResource = computeHostResource;
+    }
+
+    @Override
+    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(COMPUTE_RESOURCE_PREFERENCE);
+            generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID));
+            generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, ids.get(ComputeResourcePreferenceConstants.GATEWAY_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();
+            }
+        }
+    }
+
+    @Override
+    public AppCatalogResource 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(COMPUTE_RESOURCE_PREFERENCE);
+            generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, ids.get(ComputeResourcePreferenceConstants.GATEWAY_ID));
+            generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID));
+            Query q = generator.selectQuery(em);
+            ComputeResourcePreference preference = (ComputeResourcePreference) q.getSingleResult();
+            ComputeHostPreferenceResource preferenceResource =
+                    (ComputeHostPreferenceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE, preference);
+            em.getTransaction().commit();
+            em.close();
+            return preferenceResource;
+        } 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();
+            }
+        }
+    }
+
+    @Override
+    public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
+        List<AppCatalogResource> preferenceResourceList = new ArrayList<AppCatalogResource>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            Query q;
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE_PREFERENCE);
+            List results;
+            if (fieldName.equals(ComputeResourcePreferenceConstants.RESOURCE_ID)) {
+                generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
+                        if (preference.getComputeHostResource()!=null) {
+							ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
+									.getResource(
+											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
+											preference);
+							preferenceResourceList.add(preferenceResource);
+						}
+                    }
+                }
+            } else if (fieldName.equals(ComputeResourcePreferenceConstants.GATEWAY_ID)) {
+                generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
+                        if (preference.getComputeHostResource()!=null) {
+	                        ComputeHostPreferenceResource preferenceResource =
+	                                (ComputeHostPreferenceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE, preference);
+	                        preferenceResourceList.add(preferenceResource);
+                        }
+                    }
+                }
+            } else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL)) {
+                generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
+                        if (preference.getComputeHostResource()!=null) {
+							ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
+									.getResource(
+											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
+											preference);
+							preferenceResourceList.add(preferenceResource);
+						}
+                    }
+                }
+            } else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL)) {
+                generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ComputeResourcePreference preference = (ComputeResourcePreference) result;
+                        if (preference.getResourceId()!=null) {
+							ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
+									.getResource(
+											AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
+											preference);
+							preferenceResourceList.add(preferenceResource);
+						}
+                    }
+                }
+            } else {
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported field name for Compute host preference Resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported field name for Compute host preference 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 preferenceResourceList;
+    }
+
+    @Override
+    public List<AppCatalogResource> getAll() throws AppCatalogException {
+        return null;
+    }
+
+    @Override
+    public List<String> getAllIds() throws AppCatalogException {
+        return null;
+    }
+
+    @Override
+    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+        logger.error("Unsupported for objects with a composite identifier");
+        throw new AppCatalogException("Unsupported for objects with a composite identifier");
+    }
+
+    @Override
+    public void save() throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            ComputeResourcePreference existingPreference = em.find(ComputeResourcePreference.class, new ComputeResourcePreferencePK(gatewayId, resourceId));
+            em.close();
+
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            ComputeResource computeResource = em.find(ComputeResource.class, resourceId);
+            GatewayProfile gatewayProf = em.find(GatewayProfile.class, gatewayId);
+            if (existingPreference != null) {
+                existingPreference.setResourceId(resourceId);
+                existingPreference.setGatewayId(gatewayId);
+                existingPreference.setComputeHostResource(computeResource);
+                existingPreference.setGatewayProfile(gatewayProf);
+                existingPreference.setOverrideByAiravata(overrideByAiravata);
+                existingPreference.setPreferedJobSubmissionProtocol(preferredJobProtocol);
+                existingPreference.setPreferedDataMoveProtocol(preferedDMProtocol);
+                existingPreference.setScratchLocation(scratchLocation);
+                existingPreference.setProjectNumber(projectNumber);
+                existingPreference.setBatchQueue(batchQueue);
+                existingPreference.setLoginUserName(loginUserName);
+                em.merge(existingPreference);
+            } else {
+                ComputeResourcePreference resourcePreference = new ComputeResourcePreference();
+                resourcePreference.setResourceId(resourceId);
+                resourcePreference.setGatewayId(gatewayId);
+                resourcePreference.setComputeHostResource(computeResource);
+                resourcePreference.setGatewayProfile(gatewayProf);
+                resourcePreference.setOverrideByAiravata(overrideByAiravata);
+                resourcePreference.setPreferedJobSubmissionProtocol(preferredJobProtocol);
+                resourcePreference.setPreferedDataMoveProtocol(preferedDMProtocol);
+                resourcePreference.setScratchLocation(scratchLocation);
+                resourcePreference.setProjectNumber(projectNumber);
+                resourcePreference.setBatchQueue(batchQueue);
+                resourcePreference.setLoginUserName(loginUserName);
+                em.persist(resourcePreference);
+            }
+            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();
+            }
+        }
+    }
+
+    @Override
+    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();
+            ComputeResourcePreference existingPreference = em.find(ComputeResourcePreference.class,
+                    new ComputeResourcePreferencePK(ids.get(ComputeResourcePreferenceConstants.GATEWAY_ID),
+                            ids.get(ComputeResourcePreferenceConstants.RESOURCE_ID)));
+            em.close();
+            return existingPreference != null;
+        }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();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/4045c094/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceAppCatalogResourceAppCat.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceAppCatalogResourceAppCat.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceAppCatalogResourceAppCat.java
deleted file mode 100644
index 38e6988..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceAppCatalogResourceAppCat.java
+++ /dev/null
@@ -1,351 +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.app.catalog.resources;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResource;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
-import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ComputeResourceAppCatalogResourceAppCat extends AppCatAbstractResource {
-	private final static Logger logger = LoggerFactory.getLogger(ComputeResourceAppCatalogResourceAppCat.class);
-	private String resourceDescription;
-	private String resourceId;
-	private String hostName;
-    private Timestamp createdTime;
-    private Timestamp updatedTime;
-    private int maxMemoryPerNode;
-
-    public int getMaxMemoryPerNode() {
-        return maxMemoryPerNode;
-    }
-
-    public void setMaxMemoryPerNode(int maxMemoryPerNode) {
-        this.maxMemoryPerNode = maxMemoryPerNode;
-    }
-
-    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 {
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-			generator.setParameter(ComputeResourceConstants.RESOURCE_ID, identifier);
-			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();
-			}
-		}
-	}
-	
-	@Override
-	public AppCatalogResource get(Object identifier) throws AppCatalogException {
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-			generator.setParameter(ComputeResourceConstants.RESOURCE_ID, identifier);
-			Query q = generator.selectQuery(em);
-			ComputeResource computeResource = (ComputeResource) q.getSingleResult();
-			ComputeResourceAppCatalogResourceAppCat computeResourceResource = (ComputeResourceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE, computeResource);
-			em.getTransaction().commit();
-			em.close();
-			return computeResourceResource;
-		} 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();
-			}
-		}
-	}
-	
-	@Override
-	public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
-		List<AppCatalogResource> computeResourceResources = new ArrayList<AppCatalogResource>();
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-			Query q;
-			if ((fieldName.equals(ComputeResourceConstants.RESOURCE_DESCRIPTION)) || (fieldName.equals(ComputeResourceConstants.RESOURCE_ID)) || (fieldName.equals(ComputeResourceConstants.HOST_NAME))) {
-				generator.setParameter(fieldName, value);
-				q = generator.selectQuery(em);
-				List<?> results = q.getResultList();
-				for (Object result : results) {
-					ComputeResource computeResource = (ComputeResource) result;
-					ComputeResourceAppCatalogResourceAppCat computeResourceResource = (ComputeResourceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE, computeResource);
-					computeResourceResources.add(computeResourceResource);
-				}
-			} else {
-				em.getTransaction().commit();
-					em.close();
-				logger.error("Unsupported field name for Compute Resource Resource.", new IllegalArgumentException());
-				throw new IllegalArgumentException("Unsupported field name for Compute Resource Resource.");
-			}
-			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();
-			}
-		}
-		return computeResourceResources;
-	}
-
-    @Override
-    public List<AppCatalogResource> getAll() throws AppCatalogException {
-        List<AppCatalogResource> computeResourceResources = new ArrayList<AppCatalogResource>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-            Query q = generator.selectQuery(em);
-            List<?> results = q.getResultList();
-            for (Object result : results) {
-                ComputeResource computeResource = (ComputeResource) result;
-                ComputeResourceAppCatalogResourceAppCat computeResourceResource = (ComputeResourceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE, computeResource);
-                computeResourceResources.add(computeResourceResource);
-            }
-            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();
-            }
-        }
-        return computeResourceResources;
-    }
-
-    @Override
-    public List<String> getAllIds() throws AppCatalogException {
-        List<String> computeResourceResources = new ArrayList<String>();
-        EntityManager em = null;
-        try {
-            em = AppCatalogJPAUtils.getEntityManager();
-            em.getTransaction().begin();
-            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-            Query q = generator.selectQuery(em);
-            List<?> results = q.getResultList();
-            for (Object result : results) {
-                ComputeResource computeResource = (ComputeResource) result;
-                computeResourceResources.add(computeResource.getResourceId());
-            }
-            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();
-            }
-        }
-        return computeResourceResources;
-    }
-
-    @Override
-	public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
-		List<String> computeResourceResourceIDs = new ArrayList<String>();
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE);
-			Query q;
-			if ((fieldName.equals(ComputeResourceConstants.RESOURCE_DESCRIPTION)) || (fieldName.equals(ComputeResourceConstants.RESOURCE_ID)) || (fieldName.equals(ComputeResourceConstants.HOST_NAME))) {
-				generator.setParameter(fieldName, value);
-				q = generator.selectQuery(em);
-				List<?> results = q.getResultList();
-				for (Object result : results) {
-					ComputeResource computeResource = (ComputeResource) result;
-					ComputeResourceAppCatalogResourceAppCat computeResourceResource = (ComputeResourceAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE, computeResource);
-					computeResourceResourceIDs.add(computeResourceResource.getResourceId());
-				}
-			} else {
-				em.getTransaction().commit();
-					em.close();
-				logger.error("Unsupported field name for Compute Resource Resource.", new IllegalArgumentException());
-				throw new IllegalArgumentException("Unsupported field name for Compute Resource Resource.");
-			}
-			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();
-			}
-		}
-		return computeResourceResourceIDs;
-	}
-	
-	@Override
-	public void save() throws AppCatalogException {
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			ComputeResource existingComputeResource = em.find(ComputeResource.class, resourceId);
-			em.close();
-			ComputeResource computeResource;
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			if (existingComputeResource == null) {
-				computeResource = new ComputeResource();
-                computeResource.setCreationTime(AiravataUtils.getCurrentTimestamp());
-			} else {
-				computeResource = existingComputeResource;
-                computeResource.setUpdateTime(AiravataUtils.getCurrentTimestamp());
-			}
-			computeResource.setResourceDescription(getResourceDescription());
-			computeResource.setResourceId(getResourceId());
-			computeResource.setHostName(getHostName());
-			computeResource.setMaxMemoryPerNode(getMaxMemoryPerNode());
-			if (existingComputeResource == null) {
-				em.persist(computeResource);
-			} else {
-				em.merge(computeResource);
-			}
-			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();
-			}
-		}
-	}
-	
-	@Override
-	public boolean isExists(Object identifier) throws AppCatalogException {
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			ComputeResource computeResource = em.find(ComputeResource.class, identifier);
-			em.close();
-			return computeResource != 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 getResourceDescription() {
-		return resourceDescription;
-	}
-	
-	public String getResourceId() {
-		return resourceId;
-	}
-	
-	public String getHostName() {
-		return hostName;
-	}
-	
-	public void setResourceDescription(String resourceDescription) {
-		this.resourceDescription=resourceDescription;
-	}
-	
-	public void setResourceId(String resourceId) {
-		this.resourceId=resourceId;
-	}
-	
-	public void setHostName(String hostName) {
-		this.hostName=hostName;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/4045c094/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceFileSystemAppCatalogResourceAppCat.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceFileSystemAppCatalogResourceAppCat.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceFileSystemAppCatalogResourceAppCat.java
deleted file mode 100644
index 5bf98e4..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeResourceFileSystemAppCatalogResourceAppCat.java
+++ /dev/null
@@ -1,307 +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.app.catalog.resources;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResource;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResourceFileSystem;
-import org.apache.airavata.registry.core.app.catalog.model.ComputeResourceFileSystem_PK;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
-import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ComputeResourceFileSystemAppCatalogResourceAppCat extends AppCatAbstractResource {
-	private final static Logger logger = LoggerFactory.getLogger(ComputeResourceFileSystemAppCatalogResourceAppCat.class);
-	private String computeResourceId;
-	private ComputeResourceAppCatalogResourceAppCat computeHostResource;
-	private String path;
-	private String fileSystem;
-	
-	@Override
-	public void remove(Object identifier) throws AppCatalogException {
-		HashMap<String, String> ids;
-		if (identifier instanceof Map) {
-			ids = (HashMap<String, String>) 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(COMPUTE_RESOURCE_FILE_SYSTEM);
-			generator.setParameter(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID, ids.get(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID));
-			generator.setParameter(ComputeResourceFileSystemConstants.FILE_SYSTEM, ids.get(ComputeResourceFileSystemConstants.FILE_SYSTEM));
-			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();
-			}
-		}
-	}
-	
-	@Override
-	public AppCatalogResource get(Object identifier) throws AppCatalogException {
-		HashMap<String, String> ids;
-		if (identifier instanceof Map) {
-			ids = (HashMap<String, String>) 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(COMPUTE_RESOURCE_FILE_SYSTEM);
-			generator.setParameter(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID, ids.get(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID));
-			generator.setParameter(ComputeResourceFileSystemConstants.FILE_SYSTEM, ids.get(ComputeResourceFileSystemConstants.FILE_SYSTEM));
-			Query q = generator.selectQuery(em);
-			ComputeResourceFileSystem computeResourceFileSystem = (ComputeResourceFileSystem) q.getSingleResult();
-			ComputeResourceFileSystemAppCatalogResourceAppCat computeResourceFileSystemResource = (ComputeResourceFileSystemAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_FILE_SYSTEM, computeResourceFileSystem);
-			em.getTransaction().commit();
-			em.close();
-			return computeResourceFileSystemResource;
-		} 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();
-			}
-		}
-	}
-	
-	@Override
-	public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
-		List<AppCatalogResource> computeResourceFileSystemResources = new ArrayList<AppCatalogResource>();
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE_FILE_SYSTEM);
-			Query q;
-			if ((fieldName.equals(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(ComputeResourceFileSystemConstants.PATH)) || (fieldName.equals(ComputeResourceFileSystemConstants.FILE_SYSTEM))) {
-				generator.setParameter(fieldName, value);
-				q = generator.selectQuery(em);
-				List<?> results = q.getResultList();
-				for (Object result : results) {
-					ComputeResourceFileSystem computeResourceFileSystem = (ComputeResourceFileSystem) result;
-					ComputeResourceFileSystemAppCatalogResourceAppCat computeResourceFileSystemResource = (ComputeResourceFileSystemAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_FILE_SYSTEM, computeResourceFileSystem);
-					computeResourceFileSystemResources.add(computeResourceFileSystemResource);
-				}
-			} else {
-				em.getTransaction().commit();
-					em.close();
-				logger.error("Unsupported field name for Compute Resource File System Resource.", new IllegalArgumentException());
-				throw new IllegalArgumentException("Unsupported field name for Compute Resource File System Resource.");
-			}
-			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();
-			}
-		}
-		return computeResourceFileSystemResources;
-	}
-
-    @Override
-    public List<AppCatalogResource> getAll() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-    public List<String> getAllIds() throws AppCatalogException {
-        return null;
-    }
-
-    @Override
-	public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
-		List<String> computeResourceFileSystemResourceIDs = new ArrayList<String>();
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(COMPUTE_RESOURCE_FILE_SYSTEM);
-			Query q;
-			if ((fieldName.equals(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(ComputeResourceFileSystemConstants.PATH)) || (fieldName.equals(ComputeResourceFileSystemConstants.FILE_SYSTEM))) {
-				generator.setParameter(fieldName, value);
-				q = generator.selectQuery(em);
-				List<?> results = q.getResultList();
-				for (Object result : results) {
-					ComputeResourceFileSystem computeResourceFileSystem = (ComputeResourceFileSystem) result;
-					ComputeResourceFileSystemAppCatalogResourceAppCat computeResourceFileSystemResource = (ComputeResourceFileSystemAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_FILE_SYSTEM, computeResourceFileSystem);
-					computeResourceFileSystemResourceIDs.add(computeResourceFileSystemResource.getComputeResourceId());
-				}
-			} else {
-				em.getTransaction().commit();
-					em.close();
-				logger.error("Unsupported field name for Compute Resource File System Resource.", new IllegalArgumentException());
-				throw new IllegalArgumentException("Unsupported field name for Compute Resource File System Resource.");
-			}
-			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();
-			}
-		}
-		return computeResourceFileSystemResourceIDs;
-	}
-	
-	@Override
-	public void save() throws AppCatalogException {
-		EntityManager em = null;
-		try {
-			em = AppCatalogJPAUtils.getEntityManager();
-			ComputeResourceFileSystem existingComputeResourceFileSystem = em.find(ComputeResourceFileSystem.class, new ComputeResourceFileSystem_PK(computeResourceId, fileSystem));
-			em.close();
-			ComputeResourceFileSystem computeResourceFileSystem;
-			em = AppCatalogJPAUtils.getEntityManager();
-			em.getTransaction().begin();
-			if (existingComputeResourceFileSystem == null) {
-				computeResourceFileSystem = new ComputeResourceFileSystem();
-			} else {
-				computeResourceFileSystem = existingComputeResourceFileSystem;
-			}
-			computeResourceFileSystem.setComputeResourceId(getComputeResourceId());
-			ComputeResource computeResource = em.find(ComputeResource.class, getComputeResourceId());
-			computeResourceFileSystem.setComputeResource(computeResource);
-			computeResourceFileSystem.setPath(getPath());
-			computeResourceFileSystem.setFileSystem(getFileSystem());
-			if (existingComputeResourceFileSystem == null) {
-				em.persist(computeResourceFileSystem);
-			} else {
-				em.merge(computeResourceFileSystem);
-			}
-			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();
-			}
-		}
-	}
-	
-	@Override
-	public boolean isExists(Object identifier) throws AppCatalogException {
-		HashMap<String, String> ids;
-		if (identifier instanceof Map) {
-			ids = (HashMap<String, String>) 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();
-			ComputeResourceFileSystem computeResourceFileSystem = em.find(ComputeResourceFileSystem.class, new ComputeResourceFileSystem_PK(ids.get(ComputeResourceFileSystemConstants.COMPUTE_RESOURCE_ID), ids.get(ComputeResourceFileSystemConstants.FILE_SYSTEM)));
-			em.close();
-			return computeResourceFileSystem != 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 getComputeResourceId() {
-		return computeResourceId;
-	}
-	
-	public ComputeResourceAppCatalogResourceAppCat getComputeHostResource() {
-		return computeHostResource;
-	}
-	
-	public String getPath() {
-		return path;
-	}
-	
-	public String getFileSystem() {
-		return fileSystem;
-	}
-	
-	public void setComputeResourceId(String computeResourceId) {
-		this.computeResourceId=computeResourceId;
-	}
-	
-	public void setComputeHostResource(ComputeResourceAppCatalogResourceAppCat computeHostResource) {
-		this.computeHostResource=computeHostResource;
-	}
-	
-	public void setPath(String path) {
-		this.path=path;
-	}
-	
-	public void setFileSystem(String fileSystem) {
-		this.fileSystem=fileSystem;
-	}
-}


Mime
View raw message