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

Examples of org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator


        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_POSTJOBCOMMAND);
            generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID,
                    ids.get(GSISSHPostJobCommandConstants.SUBMISSION_ID));
            generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, ids.get(GSISSHPostJobCommandConstants.COMMAND));
            Query q = generator.selectQuery(em);
            GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) q.getSingleResult();
            GSISSHPostJobCommandResource gsisshPostJobCommandResource =
                    (GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
                            AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
            em.getTransaction().commit();
View Full Code Here


        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_POSTJOBCOMMAND);
            List results;
            if (fieldName.equals(GSISSHPostJobCommandConstants.SUBMISSION_ID)) {
                generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        GSISSHPostJobCommandResource gsisshPostJobCommandResource =
                                (GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
                        gsiSSHPostJobCommandResources.add(gsisshPostJobCommandResource);
                    }
                }
            } else if (fieldName.equals(GSISSHPostJobCommandConstants.COMMAND)) {
                generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        GSISSHPostJobCommandResource gsisshPostJobCommandResource =
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_POSTJOBCOMMAND);
            List results;
            if (fieldName.equals(GSISSHPostJobCommandConstants.SUBMISSION_ID)) {
                generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        gsiSSHPostJobResourceIDs.add(gsisshPostJobCommand.getSubmissionID());
                    }
                }
            } else if (fieldName.equals(GSISSHPostJobCommandConstants.COMMAND)) {
                generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        gsiSSHPostJobResourceIDs.add(gsisshPostJobCommand.getSubmissionID());
View Full Code Here

    public void remove(Object identifier) throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            generator.setParameter(ApplicationDeploymentConstants.DEPLOYMENT_ID, identifier);
            Query q = generator.deleteQuery(em);
            q.executeUpdate();
            em.getTransaction().commit();
            em.close();
        } catch (ApplicationSettingsException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

    public Resource get(Object identifier) throws AppCatalogException {
        EntityManager em = null;
        try {
            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();
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            List results;
            if (fieldName.equals(ApplicationDeploymentConstants.APP_MODULE_ID)) {
                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 =
View Full Code Here

        List<Resource> appDeployments = new ArrayList<Resource>();
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            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 =
View Full Code Here

        List<String> appDeployments = new ArrayList<String>();
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            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());
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
            List results;
            if (fieldName.equals(ApplicationDeploymentConstants.APP_MODULE_ID)) {
                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());
View Full Code Here

  public void remove(Object identifier) throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(SCP_DATA_MOVEMENT);
      generator.setParameter(ScpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID, identifier);
      Query q = generator.deleteQuery(em);
      q.executeUpdate();
      em.getTransaction().commit();
      em.close();
    } catch (ApplicationSettingsException e) {
      logger.error(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator

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.