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

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


      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_MANAGER_COMMAND);
      generator.setParameter(JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID, ids.get(JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID));
      generator.setParameter(JobManagerCommandConstants.COMMAND_TYPE, ids.get(JobManagerCommandConstants.COMMAND_TYPE));
      Query q = generator.selectQuery(em);
      JobManagerCommand jobManagerCommand = (JobManagerCommand) q.getSingleResult();
      JobManagerCommandResource jobManagerCommandResource = (JobManagerCommandResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_MANAGER_COMMAND, jobManagerCommand);
      em.getTransaction().commit();
      em.close();
      return jobManagerCommandResource;
    } catch (ApplicationSettingsException e) {
View Full Code Here


      if ((fieldName.equals(JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(JobManagerCommandConstants.COMMAND_TYPE)) || (fieldName.equals(JobManagerCommandConstants.COMMAND))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          JobManagerCommand jobManagerCommand = (JobManagerCommand) result;
          JobManagerCommandResource jobManagerCommandResource = (JobManagerCommandResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_MANAGER_COMMAND, jobManagerCommand);
          jobManagerCommandResources.add(jobManagerCommandResource);
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

      if ((fieldName.equals(JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID)) || (fieldName.equals(JobManagerCommandConstants.COMMAND_TYPE)) || (fieldName.equals(JobManagerCommandConstants.COMMAND))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          JobManagerCommand jobManagerCommand = (JobManagerCommand) result;
          JobManagerCommandResource jobManagerCommandResource = (JobManagerCommandResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_MANAGER_COMMAND, jobManagerCommand);
          jobManagerCommandResourceIDs.add(jobManagerCommandResource.getResourceJobManagerId());
        }
      } else {
        em.getTransaction().commit();
View Full Code Here

  @Override
  public void save() throws AppCatalogException {
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      JobManagerCommand existingJobManagerCommand = em.find(JobManagerCommand.class, new JobManagerCommand_PK(resourceJobManagerId, commandType));
      em.close();
      JobManagerCommand jobManagerCommand;
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      if (existingJobManagerCommand == null) {
        jobManagerCommand = new JobManagerCommand();
      } else {
        jobManagerCommand = existingJobManagerCommand;
      }
      jobManagerCommand.setResourceJobManagerId(getResourceJobManagerId());
      ResourceJobManager resourceJobManager = em.find(ResourceJobManager.class, getResourceJobManagerId());
      jobManagerCommand.setResourceJobManager(resourceJobManager);
      jobManagerCommand.setCommandType(getCommandType());
      jobManagerCommand.setCommand(getCommand());
      if (existingJobManagerCommand == null) {
        em.persist(jobManagerCommand);
      } else {
        em.merge(jobManagerCommand);
      }
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();
      JobManagerCommand jobManagerCommand = em.find(JobManagerCommand.class, new JobManagerCommand_PK(ids.get(JobManagerCommandConstants.RESOURCE_JOB_MANAGER_ID), ids.get(JobManagerCommandConstants.COMMAND_TYPE)));
      em.close();
      return jobManagerCommand != 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.JobManagerCommand

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.