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

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


      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(SSH_JOB_SUBMISSION);
      generator.setParameter(SshJobSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID, identifier);
      Query q = generator.selectQuery(em);
      SshJobSubmission sshJobSubmission = (SshJobSubmission) q.getSingleResult();
      SshJobSubmissionResource sshJobSubmissionResource = (SshJobSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SSH_JOB_SUBMISSION, sshJobSubmission);
      em.getTransaction().commit();
      em.close();
      return sshJobSubmissionResource;
    } catch (ApplicationSettingsException e) {
View Full Code Here


      if ((fieldName.equals(SshJobSubmissionConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(SshJobSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID)) || (fieldName.equals(SshJobSubmissionConstants.ALTERNATIVE_SSH_HOSTNAME)) || (fieldName.equals(SshJobSubmissionConstants.SECURITY_PROTOCOL)) || (fieldName.equals(SshJobSubmissionConstants.SSH_PORT))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          SshJobSubmission sshJobSubmission = (SshJobSubmission) result;
          SshJobSubmissionResource sshJobSubmissionResource = (SshJobSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SSH_JOB_SUBMISSION, sshJobSubmission);
          sshJobSubmissionResources.add(sshJobSubmissionResource);
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

      if ((fieldName.equals(SshJobSubmissionConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(SshJobSubmissionConstants.JOB_SUBMISSION_INTERFACE_ID)) || (fieldName.equals(SshJobSubmissionConstants.ALTERNATIVE_SSH_HOSTNAME)) || (fieldName.equals(SshJobSubmissionConstants.SECURITY_PROTOCOL)) || (fieldName.equals(SshJobSubmissionConstants.SSH_PORT))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          SshJobSubmission sshJobSubmission = (SshJobSubmission) result;
          SshJobSubmissionResource sshJobSubmissionResource = (SshJobSubmissionResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.SSH_JOB_SUBMISSION, sshJobSubmission);
          sshJobSubmissionResourceIDs.add(sshJobSubmissionResource.getJobSubmissionInterfaceId());
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

  @Override
  public void save() throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      SshJobSubmission existingSshJobSubmission = em.find(SshJobSubmission.class, jobSubmissionInterfaceId);
      em.close();
      SshJobSubmission sshJobSubmission;
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      if (existingSshJobSubmission == null) {
        sshJobSubmission = new SshJobSubmission();
      } else {
        sshJobSubmission = existingSshJobSubmission;
      }
      sshJobSubmission.setResourceJobManagerId(getResourceJobManagerId());
      ResourceJobManager resourceJobManager = em.find(ResourceJobManager.class, getResourceJobManagerId());
      sshJobSubmission.setResourceJobManager(resourceJobManager);
      sshJobSubmission.setJobSubmissionInterfaceId(getJobSubmissionInterfaceId());
      sshJobSubmission.setAlternativeSshHostname(getAlternativeSshHostname());
      sshJobSubmission.setSecurityProtocol(getSecurityProtocol());
      sshJobSubmission.setSshPort(getSshPort());
      if (existingSshJobSubmission == null) {
        em.persist(sshJobSubmission);
      } else {
        em.merge(sshJobSubmission);
      }
View Full Code Here

  @Override
  public boolean isExists(Object identifier) throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      SshJobSubmission sshJobSubmission = em.find(SshJobSubmission.class, identifier);
      em.close();
      return sshJobSubmission != 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.SshJobSubmission

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.