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

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


      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_INTERFACE);
      generator.setParameter(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID, ids.get(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID));
      generator.setParameter(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID, ids.get(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID));
      Query q = generator.selectQuery(em);
      DataMovementInterface dataMovementInterface = (DataMovementInterface) q.getSingleResult();
      DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
      em.getTransaction().commit();
      em.close();
      return dataMovementInterfaceResource;
    } catch (ApplicationSettingsException e) {
View Full Code Here


      if ((fieldName.equals(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_PROTOCOL)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          DataMovementInterface dataMovementInterface = (DataMovementInterface) result;
          DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
          dataMovementInterfaceResources.add(dataMovementInterfaceResource);
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

      if ((fieldName.equals(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_PROTOCOL)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          DataMovementInterface dataMovementInterface = (DataMovementInterface) result;
          DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
          dataMovementInterfaceResourceIDs.add(dataMovementInterfaceResource.getComputeResourceId());
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

  @Override
  public void save() throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      DataMovementInterface existingDataMovementInterface = em.find(DataMovementInterface.class, new DataMovementInterface_PK(computeResourceId, dataMovementInterfaceId));
      em.close();
      DataMovementInterface dataMovementInterface;
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      if (existingDataMovementInterface == null) {
        dataMovementInterface = new DataMovementInterface();
      } else {
        dataMovementInterface = existingDataMovementInterface;
      }
      dataMovementInterface.setComputeResourceId(getComputeResourceId());
      ComputeResource computeResource = em.find(ComputeResource.class, getComputeResourceId());
      dataMovementInterface.setComputeResource(computeResource);
      dataMovementInterface.setDataMovementProtocol(getDataMovementProtocol());
      dataMovementInterface.setDataMovementInterfaceId(getDataMovementInterfaceId());
      dataMovementInterface.setPriorityOrder(getPriorityOrder());
      if (existingDataMovementInterface == null) {
        em.persist(dataMovementInterface);
      } else {
        em.merge(dataMovementInterface);
      }
View Full Code Here

      throw new AppCatalogException("Identifier should be a map with the field name and it's value");
    }
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      DataMovementInterface dataMovementInterface = em.find(DataMovementInterface.class, new DataMovementInterface_PK(ids.get(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID), ids.get(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID)));
      em.close();
      return dataMovementInterface != null;
    } catch (ApplicationSettingsException e) {
      logger.error(e.getMessage(), e);
      throw new AppCatalogException(e);
View Full Code Here

TOP

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

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.