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

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


            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
            generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
            generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
            generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
            Query q = generator.selectQuery(em);
            JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) q.getSingleResult();
            JobSubmissionProtocolResource jobSubmissionProtocolResource =
                    (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
            em.getTransaction().commit();
            em.close();
            return jobSubmissionProtocolResource;
View Full Code Here


                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
                    }
                }
            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
                    }
                }
            } else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
                generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        JobSubmissionProtocolResource jobSubmissionProtocolResource =
                                (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
                        jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
                    }
                }
View Full Code Here

                generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
                    }
                }
            } else if (fieldName.equals(JobSubmissionProtocolConstants.RESOURCE_ID)) {
                generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
                    }
                }
            } else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
                generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
                        jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getSubmissionID());
                    }
                }
            } else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            JobSubmissionProtocol existingJobSubProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(resourceID, submissionID, jobType));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            ComputeResource computeResource = em.find(ComputeResource.class, resourceID);
            if (existingJobSubProtocol != null) {
                existingJobSubProtocol.setJobType(jobType);
                existingJobSubProtocol.setSubmissionID(submissionID);
                existingJobSubProtocol.setComputeResource(computeResource);
                existingJobSubProtocol.setResourceID(resourceID);
                em.merge(existingJobSubProtocol);
            } else {
                JobSubmissionProtocol jobSubmissionProtocol = new JobSubmissionProtocol();
                jobSubmissionProtocol.setJobType(jobType);
                jobSubmissionProtocol.setSubmissionID(submissionID);
                jobSubmissionProtocol.setResourceID(resourceID);
                jobSubmissionProtocol.setComputeResource(computeResource);
                em.persist(jobSubmissionProtocol);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

        }

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            JobSubmissionProtocol jobSubmissionProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(ids.get(JobSubmissionProtocolConstants.RESOURCE_ID),
                    ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID), ids.get(JobSubmissionProtocolConstants.JOB_TYPE)));

            em.close();
            return jobSubmissionProtocol != null;
        } catch (ApplicationSettingsException e) {
View Full Code Here

TOP

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

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.