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

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


            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            generator.setParameter(ApplicationDeploymentConstants.DEPLOYMENT_ID, identifier);
            Query q = generator.selectQuery(em);
            ApplicationDeployment deployment = (ApplicationDeployment) q.getSingleResult();
            AppDeploymentResource deploymentResource =
                    (AppDeploymentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
            em.getTransaction().commit();
            em.close();
            return deploymentResource;
View Full Code Here


                generator.setParameter(ApplicationDeploymentConstants.APP_MODULE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationDeployment deployment = (ApplicationDeployment) result;
                        AppDeploymentResource deploymentResource =
                                (AppDeploymentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
                        appDeployments.add(deploymentResource);
                    }
                }
            } else if (fieldName.equals(ApplicationDeploymentConstants.COMPUTE_HOST_ID)) {
                generator.setParameter(ApplicationDeploymentConstants.COMPUTE_HOST_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationDeployment deployment = (ApplicationDeployment) result;
                        AppDeploymentResource deploymentResource =
                                (AppDeploymentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
                        appDeployments.add(deploymentResource);
                    }
                }
View Full Code Here

            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            Query q = generator.selectQuery(em);
            List results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationDeployment deployment = (ApplicationDeployment) result;
                        AppDeploymentResource deploymentResource =
                                (AppDeploymentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
                        appDeployments.add(deploymentResource);
                    }
                }
View Full Code Here

            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            Query q = generator.selectQuery(em);
            List results = q.getResultList();
            if (results.size() != 0) {
                for (Object result : results) {
                    ApplicationDeployment deployment = (ApplicationDeployment) result;
                    appDeployments.add(deployment.getDeploymentID());
                }
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

                generator.setParameter(ApplicationDeploymentConstants.APP_MODULE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationDeployment deployment = (ApplicationDeployment) result;
                        appDeployments.add(deployment.getDeploymentID());
                    }
                }
            } else if (fieldName.equals(ApplicationDeploymentConstants.COMPUTE_HOST_ID)) {
                generator.setParameter(ApplicationDeploymentConstants.COMPUTE_HOST_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationDeployment deployment = (ApplicationDeployment) result;
                        appDeployments.add(deployment.getDeploymentID());
                    }
                }
            }else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    @Override
    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            ApplicationDeployment existingDeployment = em.find(ApplicationDeployment.class, deploymentId);
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            ApplicationModule applicationModule = em.find(ApplicationModule.class, appModuleId);
            ComputeResource computeHost = em.find(ComputeResource.class, hostId);
            if (existingDeployment !=  null){
                existingDeployment.setDeploymentID(deploymentId);
                existingDeployment.setApplicationDesc(appDes);
                existingDeployment.setAppModuleID(appModuleId);
                existingDeployment.setApplicationModule(applicationModule);
                existingDeployment.setComputeResource(computeHost);
                existingDeployment.setHostID(hostId);
                existingDeployment.setExecutablePath(executablePath);
                existingDeployment.setParallelism(parallelism);
                em.merge(existingDeployment);
            }else {
                ApplicationDeployment deployment  = new ApplicationDeployment();
                deployment.setApplicationDesc(appDes);
                deployment.setDeploymentID(deploymentId);
                deployment.setAppModuleID(appModuleId);
                deployment.setHostID(hostId);
                deployment.setApplicationModule(applicationModule);
                deployment.setComputeResource(computeHost);
                deployment.setExecutablePath(executablePath);
                deployment.setParallelism(parallelism);
                em.persist(deployment);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

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

            LibraryPrepandPath existigPrepPath = em.find(LibraryPrepandPath.class, new LibraryPrepandPath_PK(deploymentId, name));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            ApplicationDeployment deployment = em.find(ApplicationDeployment.class, deploymentId);
            if (existigPrepPath !=  null){
                existigPrepPath.setValue(value);
                existigPrepPath.setApplicationDeployment(deployment);
                em.merge(existigPrepPath);
            }else {
View Full Code Here

            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();

            ApplicationDeployment deployment = em.find(ApplicationDeployment.class, deploymentId);
            if (existigApendPath !=  null){
                existigApendPath.setValue(value);
                existigApendPath.setApplicationDeployment(deployment);
                em.merge(existigApendPath);
            }else {
View Full Code Here

            } else {
                moduleLoadCmd = existingModuleLoadCmd;
            }
            moduleLoadCmd.setCmd(getCmd());
            moduleLoadCmd.setAppDeploymentId(getAppDeploymentId());
            ApplicationDeployment applicationDeployment = em.find(ApplicationDeployment.class, getAppDeploymentId());
            moduleLoadCmd.setApplicationDeployment(applicationDeployment);
            if (existingModuleLoadCmd == null) {
                em.persist(moduleLoadCmd);
            } else {
                em.merge(moduleLoadCmd);
View Full Code Here

TOP

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

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.