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

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


            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_PROTOCOL);
            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE));
            generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, ids.get(DataMoveProtocolConstants.RESOURCE_ID));
            generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, ids.get(DataMoveProtocolConstants.DATA_MOVE_ID));
            Query q = generator.selectQuery(em);
            DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) q.getSingleResult();
            DataMovementProtocolResource dataMovementProtocolResource =
                    (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
            em.getTransaction().commit();
            em.close();
            return dataMovementProtocolResource;
View Full Code Here


                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        DataMovementProtocolResource dataMovementProtocolResource =
                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
                    }
                }
            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        DataMovementProtocolResource dataMovementProtocolResource =
                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
                    }
                }
            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_ID)) {
                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        DataMovementProtocolResource dataMovementProtocolResource =
                                (DataMovementProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_PROTOCOL, dataMovementProtocol);
                        dataMoveProtocolResourcesList.add(dataMovementProtocolResource);
                    }
                }
View Full Code Here

                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
                    }
                }
            } else if (fieldName.equals(DataMoveProtocolConstants.RESOURCE_ID)) {
                generator.setParameter(DataMoveProtocolConstants.RESOURCE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
                    }
                }
            } else if (fieldName.equals(DataMoveProtocolConstants.DATA_MOVE_TYPE)) {
                generator.setParameter(DataMoveProtocolConstants.DATA_MOVE_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        DataMovementProtocol dataMovementProtocol = (DataMovementProtocol) result;
                        dataMovementProtocolIDs.add(dataMovementProtocol.getDataMoveID());
                    }
                }
            } else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            DataMovementProtocol existingDataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(resourceID, dataMoveID, dataMoveType));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            if (existingDataMovementProtocol != null) {
                existingDataMovementProtocol.setDataMoveID(dataMoveType);
                existingDataMovementProtocol.setDataMoveID(dataMoveID);
                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
                existingDataMovementProtocol.setComputeResource(computeResource);
                existingDataMovementProtocol.setResourceID(resourceID);
                em.merge(existingDataMovementProtocol);
            } else {
                DataMovementProtocol dataMovementProtocol = new DataMovementProtocol();
                dataMovementProtocol.setDataMoveType(dataMoveType);
                dataMovementProtocol.setDataMoveID(dataMoveID);
                dataMovementProtocol.setResourceID(resourceID);
                ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
                dataMovementProtocol.setComputeResource(computeResource);
                em.persist(dataMovementProtocol);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

        }

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            DataMovementProtocol dataMovementProtocol = em.find(DataMovementProtocol.class, new DataMovementProtocolPK(
                    ids.get(DataMoveProtocolConstants.RESOURCE_ID),
                    ids.get(DataMoveProtocolConstants.DATA_MOVE_ID), ids.get(DataMoveProtocolConstants.DATA_MOVE_TYPE)));

            em.close();
            return dataMovementProtocol != null;
View Full Code Here

TOP

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

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.