Package gri.gridp.tasks.ssh

Examples of gri.gridp.tasks.ssh.SshInfo


  }
 
  // ----------------------------------------------------------------- Utility
 
  protected TaskManager getTaskManager() {
    SshInfo sshInfo = getSshInfo();
   
    int mode = windowsMode ?
        GridpFactory.WINDOWS : GridpFactory.UNIX;
   
    GridpFactory factory = new GridpFactory(moduleFolder, mode);
View Full Code Here


      }

      System.out.print("Password: ");
      String password = in.readLine();
     
      return new SshInfo(computer, user, password);
    }
    catch(IOException e) {
      throw new RuntimeException("Unexpected IO Exception", e);
    }
   
View Full Code Here

    GridpFactory factory = new GridpFactory(moduleFolder, mode);
    return factory.getTaskManager();
  }
 
  protected static TaskManager getSSHProvider(File moduleFolder) {
    SshInfo info = new SshInfo("computer", "user", "password");

    int mode = windowsMode ?
        GridpFactory.WINDOWS : GridpFactory.UNIX;
   
    GridpFactory factory = new GridpFactory(moduleFolder, mode);
View Full Code Here

      passwordElem.setText(info.getPassword());
      elem.addContent(passwordElem);
    }
  }
  public SshInfo readSshInfo(Element elem) throws IOException {
    SshInfo info = new SshInfo();

    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("system"))
        info.setSystem(child.getText());
      else if (name.equals("user"))
        info.setUserName(child.getText());
      else if (name.equals("password"))
        info.setPassword(child.getText());
    }

    //validate:
    if (info.getSystem() == null)
      throw new MissingElementException("system", elem);

    return info;
  }
View Full Code Here

TOP

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

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.