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(SCP_DATA_MOVEMENT);
      generator.setParameter(ScpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID, identifier);
      Query q = generator.selectQuery(em);
      ScpDataMovement scpDataMovement = (ScpDataMovement) q.getSingleResult();
      ScpDataMovementResource scpDataMovementResource = (ScpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SCP_DATA_MOVEMENT, scpDataMovement);
      em.getTransaction().commit();
      em.close();
      return scpDataMovementResource;
View Full Code Here


    List<Resource> scpDataMovementResources = new ArrayList<Resource>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(SCP_DATA_MOVEMENT);
      Query q;
      if ((fieldName.equals(ScpDataMovementConstants.QUEUE_DESCRIPTION)) || (fieldName.equals(ScpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(ScpDataMovementConstants.SECURITY_PROTOCOL)) || (fieldName.equals(ScpDataMovementConstants.ALTERNATIVE_SCP_HOSTNAME)) || (fieldName.equals(ScpDataMovementConstants.SSH_PORT))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          ScpDataMovement scpDataMovement = (ScpDataMovement) result;
          ScpDataMovementResource scpDataMovementResource = (ScpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SCP_DATA_MOVEMENT, scpDataMovement);
          scpDataMovementResources.add(scpDataMovementResource);
View Full Code Here

    List<String> scpDataMovementResourceIDs = new ArrayList<String>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(SCP_DATA_MOVEMENT);
      Query q;
      if ((fieldName.equals(ScpDataMovementConstants.QUEUE_DESCRIPTION)) || (fieldName.equals(ScpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(ScpDataMovementConstants.SECURITY_PROTOCOL)) || (fieldName.equals(ScpDataMovementConstants.ALTERNATIVE_SCP_HOSTNAME)) || (fieldName.equals(ScpDataMovementConstants.SSH_PORT))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          ScpDataMovement scpDataMovement = (ScpDataMovement) result;
          ScpDataMovementResource scpDataMovementResource = (ScpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SCP_DATA_MOVEMENT, scpDataMovement);
          scpDataMovementResourceIDs.add(scpDataMovementResource.getDataMovementInterfaceId());
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(APP_MODULE_MAPPING);
            generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, ids.get(AppModuleMappingConstants.INTERFACE_ID));
            generator.setParameter(AppModuleMappingConstants.MODULE_ID, ids.get(AppModuleMappingConstants.MODULE_ID));
            Query q = generator.deleteQuery(em);
            q.executeUpdate();
            em.getTransaction().commit();
            em.close();
        } catch (ApplicationSettingsException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APP_MODULE_MAPPING);
            generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, ids.get(AppModuleMappingConstants.INTERFACE_ID));
            generator.setParameter(AppModuleMappingConstants.MODULE_ID, ids.get(AppModuleMappingConstants.MODULE_ID));
            Query q = generator.selectQuery(em);
            AppModuleMapping result = (AppModuleMapping) q.getSingleResult();
            AppModuleMappingResource resource =
                    (AppModuleMappingResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_MODULE_MAPPING, result);
            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(APP_MODULE_MAPPING);
            List results;
            if (fieldName.equals(AppModuleMappingConstants.INTERFACE_ID)) {
                generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppModuleMapping moduleMapping = (AppModuleMapping) result;
                        AppModuleMappingResource resource =
                                (AppModuleMappingResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_MODULE_MAPPING, moduleMapping);
                        resourceList.add(resource);
                    }
                }
            } else if (fieldName.equals(AppModuleMappingConstants.MODULE_ID)) {
                generator.setParameter(AppModuleMappingConstants.MODULE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppModuleMapping moduleMapping = (AppModuleMapping) result;
                        AppModuleMappingResource resource =
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(LIBRARY_PREPAND_PATH);
            generator.setParameter(LibraryPrepandPathConstants.DEPLOYMENT_ID, ids.get(LibraryPrepandPathConstants.DEPLOYMENT_ID));
            generator.setParameter(LibraryPrepandPathConstants.NAME, ids.get(LibraryPrepandPathConstants.NAME));
            Query q = generator.deleteQuery(em);
            q.executeUpdate();
            em.getTransaction().commit();
            em.close();
        } catch (ApplicationSettingsException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LIBRARY_PREPAND_PATH);
            generator.setParameter(LibraryPrepandPathConstants.DEPLOYMENT_ID, ids.get(LibraryPrepandPathConstants.DEPLOYMENT_ID));
            generator.setParameter(LibraryPrepandPathConstants.NAME, ids.get(LibraryPrepandPathConstants.NAME));
            Query q = generator.selectQuery(em);
            LibraryPrepandPath libraryPrepandPath = (LibraryPrepandPath) q.getSingleResult();
            LibraryPrepandPathResource resource =
                    (LibraryPrepandPathResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LIBRARY_PREPAND_PATH, libraryPrepandPath);
            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(LIBRARY_PREPAND_PATH);
            List results;
            if (fieldName.equals(LibraryPrepandPathConstants.DEPLOYMENT_ID)) {
                generator.setParameter(LibraryPrepandPathConstants.DEPLOYMENT_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        LibraryPrepandPath prepandPath = (LibraryPrepandPath) result;
                        LibraryPrepandPathResource resource =
                                (LibraryPrepandPathResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LIBRARY_PREPAND_PATH, prepandPath);
                        libPrepPathList.add(resource);
                    }
                }
            } else if (fieldName.equals(LibraryPrepandPathConstants.NAME)) {
                generator.setParameter(LibraryPrepandPathConstants.NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        LibraryPrepandPath prepandPath = (LibraryPrepandPath) result;
                        LibraryPrepandPathResource resource =
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_INPUT);
            generator.setParameter(AppInputConstants.INTERFACE_ID, ids.get(AppInputConstants.INTERFACE_ID));
            generator.setParameter(AppInputConstants.INPUT_KEY, ids.get(AppInputConstants.INPUT_KEY));
            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.