Package gri.gridp.tasks.ssh

Examples of gri.gridp.tasks.ssh.SshScriptTask


   * over SSH.  The remote computer and login information are provided
   * by the SessionFactory.
   */
  public TaskManager getSshTaskManager(SessionFactory sessionFactory) {
    ModuleManager moduleManager = getModuleManager();
    SshScriptTask runScript = new SshScriptTask(sessionFactory, scriptFile, execCmd);
    return new GridpTaskManager(moduleManager, runScript);
  }
View Full Code Here


    elem.addContent(deleteWhenFreeElem);
    */
  }

  public SshScriptTask readTask(Element elem) throws IOException {
    SshScriptTask task = new SshScriptTask(null, null, null);

    List children = elem.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName();

      if (name.equals("ssh"))
        task.setSessionFactory(
            (SessionFactory)sshInfoSerializer.read(child)
        );

      else if (name.equals("scriptFile"))
        task.setScriptFileName(child.getText());
      else if (name.equals("execCommand"))
        task.setExecutionCommand(child.getText());

      /*
      else if (name.equals("localFolderFactory")) 
        task.setLocalFolderFactory(
            (JobFolderFactory)localFolderFactorySerializer.read(child)
        );
      else if (name.equals("remoteFolderFactory"))
        task.setRemoteFolderFactory(
            (RemoteFolderFactory)remoteFolderFactorySerializer.read(child)
        );
      else if (name.equals("deleteRemoteDirectory"))
        task.setDeleteRemoteDirectory(
            child.getText().toLowerCase().equals("true")
        );
      */
    }

    //validate:
    if (task.getSessionFactory() == null)
      throw new MissingElementException("ssh", elem);
    if (task.getScriptFileName() == null)
      throw new MissingElementException("scriptFile", elem);
    if (task.getExecutionCommand() == null)
      throw new MissingElementException("execCommand", elem);

    return task;
  }
View Full Code Here

TOP

Related Classes of gri.gridp.tasks.ssh.SshScriptTask

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.