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

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


  public Resource get(Object identifier) throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LOCAL_SUBMISSION);
      generator.setParameter(LocalSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID, identifier);
      Query q = generator.selectQuery(em);
      LocalSubmission localSubmission = (LocalSubmission) q.getSingleResult();
      LocalSubmissionResource localSubmissionResource = (LocalSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LOCAL_SUBMISSION, localSubmission);
      em.getTransaction().commit();
      em.close();
      return localSubmissionResource;
View Full Code Here


    List<Resource> localSubmissionResources = new ArrayList<Resource>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LOCAL_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) {
          LocalSubmission localSubmission = (LocalSubmission) result;
          LocalSubmissionResource localSubmissionResource = (LocalSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LOCAL_SUBMISSION, localSubmission);
          localSubmissionResources.add(localSubmissionResource);
View Full Code Here

    List<String> localSubmissionResourceIDs = new ArrayList<String>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LOCAL_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) {
          LocalSubmission localSubmission = (LocalSubmission) result;
          LocalSubmissionResource localSubmissionResource = (LocalSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LOCAL_SUBMISSION, localSubmission);
          localSubmissionResourceIDs.add(localSubmissionResource.getJobSubmissionInterfaceId());
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_MODULE);
            generator.setParameter(ApplicationModuleConstants.MODULE_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_MODULE);
            generator.setParameter(ApplicationModuleConstants.MODULE_ID, identifier);
            Query q = generator.selectQuery(em);
            ApplicationModule applicationModule = (ApplicationModule) q.getSingleResult();
            AppModuleResource appModuleResource =
                    (AppModuleResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_MODULE, applicationModule);
            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_MODULE);
            List results;
            if (fieldName.equals(ApplicationModuleConstants.MODULE_NAME)) {
                generator.setParameter(ApplicationModuleConstants.MODULE_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationModule applicationModule = (ApplicationModule) result;
                        AppModuleResource moduleResource =
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_MODULE);
            List results;
            if (fieldName.equals(ApplicationModuleConstants.MODULE_NAME)) {
                generator.setParameter(ApplicationModuleConstants.MODULE_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationModule applicationModule = (ApplicationModule) result;
                        moduleResources.add(applicationModule.getModuleID());
View Full Code Here

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

    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;
          ComputeResourceResource computeResourceResource = (ComputeResourceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE, computeResource);
          computeResourceResourceIDs.add(computeResourceResource.getResourceId());
View Full Code Here

        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.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.