Ejemplo n.º 1
0
  public ShiwaPoolEngine(Connection connection) {
    this(null, null);

    service = ShiwaClientService.getInstance();
    // TODO remove setConnection from client service
    service.setConnection(connection);
  }
Ejemplo n.º 2
0
  /**
   * @param id workflow ID
   * @throws RemoteException
   * @throws ServiceException
   */
  @Override
  public void kill(String id) throws java.rmi.RemoteException, javax.xml.rpc.ServiceException {

    try {
      service.cancel(id);
    } catch (org.jivesoftware.smack.XMPPException ex) {
      logger.error(ex);
    }
  }
Ejemplo n.º 3
0
  /**
   * @param proxy proxy filename
   * @param dn user DN
   * @return
   * @throws RemoteException
   * @throws ServiceException
   */
  @Override
  public String launch(String proxy, String dn)
      throws java.rmi.RemoteException, javax.xml.rpc.ServiceException {

    String id = null;
    try {

      File bundle = File.createTempFile("bundle-", ".zip");
      bundle.deleteOnExit();
      File workflowFile = ShiwaPoolEngine.stringToFile("workflow", ".gwendia", workflow);
      File inputFile = ShiwaPoolEngine.stringToFile("input", ".xml", input);
      BundleHelpers.createGwendiaInputBundle(
          workflowFile, inputFile, bundle.getAbsolutePath(), settings);
      id = service.submit(bundle);
    } catch (org.jivesoftware.smack.XMPPException ex) {
      logger.error(ex);
    } catch (java.io.IOException ex) {
      logger.error(ex);
    }

    return id;
  }
Ejemplo n.º 4
0
  @Override
  public SimulationStatus getStatus(String workflowID)
      throws java.rmi.RemoteException, javax.xml.rpc.ServiceException {

    SimulationStatus status = SimulationStatus.Unknown;
    String workflowStatus = "UNKNOWN";
    try {

      workflowStatus = service.getStatus(workflowID);
    } catch (org.jivesoftware.smack.XMPPException ex) {
      logger.error(ex);
    }

    PoolStatus poolStatus = PoolStatus.valueOf(workflowStatus);
    switch (poolStatus) {
      case FINISHED:
        return SimulationStatus.Completed;

      case CANCELLED:
      case FAILED:
      case KILLED:
        return SimulationStatus.Killed;

      case SENDING:
      case SENT:
      case LAUNCHING:
      case RUNNING:
        return SimulationStatus.Running;

      case PENDING:
      case WAITING_INSTANCE:
      case QUEUED:
        return SimulationStatus.Queued;

      default:
        return SimulationStatus.Unknown;
    }
  }