Package org.apache.aiaravata.application.catalog.data.model

Examples of org.apache.aiaravata.application.catalog.data.model.GatewayProfile


            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GATEWAY_PROFILE);
            generator.setParameter(GatewayProfileConstants.GATEWAY_ID, identifier);
            Query q = generator.selectQuery(em);
            GatewayProfile gatewayProfile = (GatewayProfile) q.getSingleResult();
            GatewayProfileResource gatewayProfileResource =
                    (GatewayProfileResource) AppCatalogJPAUtils.getResource(
                            AppCatalogResourceType.GATEWAY_PROFILE, gatewayProfile);
            em.getTransaction().commit();
            em.close();
View Full Code Here


                generator.setParameter(GatewayProfileConstants.GATEWAY_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        GatewayProfileResource gatewayProfileResource =
                                (GatewayProfileResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GATEWAY_PROFILE, gatewayProfile);
                        gatewayProfileResources.add(gatewayProfileResource);
                    }
                }
            } else if (fieldName.equals(GatewayProfileConstants.GATEWAY_NAME)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        GatewayProfileResource gatewayProfileResource =
                                (GatewayProfileResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GATEWAY_PROFILE, gatewayProfile);
                        gatewayProfileResources.add(gatewayProfileResource);
                    }
                }
View Full Code Here

                generator.setParameter(GatewayProfileConstants.GATEWAY_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        gatewayProfileResourceIDs.add(gatewayProfile.getGatewayID());
                    }
                }
            } else if (fieldName.equals(GatewayProfileConstants.GATEWAY_NAME)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        gatewayProfileResourceIDs.add(gatewayProfile.getGatewayID());
                    }
                }
            } else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            GatewayProfile existingGatewayProfile = em.find(GatewayProfile.class, gatewayID);
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            if (existingGatewayProfile != null) {
                existingGatewayProfile.setGatewayDesc(gatewayDesc);
                existingGatewayProfile.setGatewayName(gatewayName);
                em.merge(existingGatewayProfile);
            } else {
                GatewayProfile gatewayProfile = new GatewayProfile();
                gatewayProfile.setGatewayID(gatewayID);
                gatewayProfile.setGatewayName(gatewayName);
                gatewayProfile.setGatewayDesc(gatewayDesc);
                em.persist(gatewayProfile);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

    public boolean isExists(Object identifier) throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            GatewayProfile gatewayProfile = em.find(GatewayProfile.class, identifier);
            em.close();
            return gatewayProfile != null;
        } catch (ApplicationSettingsException e) {
            logger.error(e.getMessage(), e);
            throw new AppCatalogException(e);
View Full Code Here

            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);
View Full Code Here

TOP

Related Classes of org.apache.aiaravata.application.catalog.data.model.GatewayProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.