Package org.apache.hadoop.eclipse.launch

Examples of org.apache.hadoop.eclipse.launch.SWTUserInfo


   */
  public Session createSession(int timeout) throws JSchException {
    if (tunnelHostName == null) {
      Session session =
          JSchUtilities.createJSch().getSession(userName, hostName, 22);
      session.setUserInfo(new SWTUserInfo() {
        @Override
        public String getPassword() {
          return HadoopServer.this.password;
        }

        @Override
        public void setPassword(String pass) {
          HadoopServer.this.password = pass;
        }

      });
      if (!session.isConnected()) {
        try {
          session.connect();
        } catch (JSchException jse) {
          // Reset password in case the authentication failed
          if (jse.getMessage().equals("Auth fail"))
            this.password = null;
          throw jse;
        }
      }

      return session;
    } else {
      createSshTunnel();

      Session session =
          JSchUtilities.createJSch().getSession(userName, "localhost",
              tunnelPort);
      session.setUserInfo(new SWTUserInfo() {
        @Override
        public String getPassword() {
          return HadoopServer.this.password;
        }

View Full Code Here


        JSchUtilities.createJSch().getSession(tunnelUserName,
            tunnelHostName, 22);
    tunnel.setTimeout(0);
    tunnel.setPortForwardingL(tunnelPort, hostName, port);

    tunnel.setUserInfo(new SWTUserInfo() {
      @Override
      public String getPassword() {
        return HadoopServer.this.tunnelPassword;
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.eclipse.launch.SWTUserInfo

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.