com.jcraft.jsch
Class Session

java.lang.Object
  extended by com.jcraft.jsch.Session
All Implemented Interfaces:
java.lang.Runnable

public class Session
extends java.lang.Object
implements java.lang.Runnable


Field Summary
(package private)  Buffer buf
           
(package private)  java.lang.String host
           
(package private)  java.io.InputStream in
           
(package private)  JSch jsch
           
(package private)  java.io.OutputStream out
           
(package private)  Packet packet
           
(package private)  java.lang.String password
           
(package private)  int port
           
(package private) static Random random
           
(package private)  SocketFactory socket_factory
           
(package private) static int SSH_MSG_CHANNEL_CLOSE
           
(package private) static int SSH_MSG_CHANNEL_DATA
           
(package private) static int SSH_MSG_CHANNEL_EOF
           
(package private) static int SSH_MSG_CHANNEL_EXTENDED_DATA
           
(package private) static int SSH_MSG_CHANNEL_FAILURE
           
(package private) static int SSH_MSG_CHANNEL_OPEN
           
(package private) static int SSH_MSG_CHANNEL_OPEN_CONFIRMATION
           
(package private) static int SSH_MSG_CHANNEL_OPEN_FAILURE
           
(package private) static int SSH_MSG_CHANNEL_REQUEST
           
(package private) static int SSH_MSG_CHANNEL_SUCCESS
           
(package private) static int SSH_MSG_CHANNEL_WINDOW_ADJUST
           
(package private) static int SSH_MSG_DEBUG
           
(package private) static int SSH_MSG_DISCONNECT
           
(package private) static int SSH_MSG_GLOBAL_REQUEST
           
(package private) static int SSH_MSG_IGNORE
           
(package private) static int SSH_MSG_KEXDH_INIT
           
(package private) static int SSH_MSG_KEXDH_REPLY
           
(package private) static int SSH_MSG_KEXINIT
           
(package private) static int SSH_MSG_NEWKEYS
           
(package private) static int SSH_MSG_REQUEST_FAILURE
           
(package private) static int SSH_MSG_REQUEST_SUCCESS
           
(package private) static int SSH_MSG_SERVICE_ACCEPT
           
(package private) static int SSH_MSG_SERVICE_REQUEST
           
(package private) static int SSH_MSG_UNIMPLEMENTED
           
(package private) static int SSH_MSG_USERAUTH_BANNER
           
(package private) static int SSH_MSG_USERAUTH_FAILURE
           
(package private) static int SSH_MSG_USERAUTH_INFO_REQUEST
           
(package private) static int SSH_MSG_USERAUTH_INFO_RESPONSE
           
(package private) static int SSH_MSG_USERAUTH_PK_OK
           
(package private) static int SSH_MSG_USERAUTH_REQUEST
           
(package private) static int SSH_MSG_USERAUTH_SUCCESS
           
(package private)  java.lang.Runnable thread
           
(package private)  int[] uncompress_len
           
(package private)  java.lang.String username
           
(package private)  boolean x11_forwarding
           
 
Constructor Summary
Session(JSch jsch)
           
 
Method Summary
(package private)  void addChannel(Channel channel)
           
 void connect()
           
 void connect(int connectTimeout)
           
 void delPortForwardingL(int lport)
           
 void delPortForwardingL(java.lang.String boundaddress, int lport)
           
 void delPortForwardingR(int rport)
           
 void disconnect()
           
 void encode(Packet packet)
           
 java.lang.String getClientVersion()
           
 java.lang.String getConfig(java.lang.String name)
           
 java.lang.String getHost()
           
 HostKey getHostKey()
           
 int getPort()
           
 java.lang.String[] getPortForwardingL()
           
 java.lang.String getServerVersion()
           
(package private)  byte[] getSessionId()
           
 int getTimeout()
           
 java.lang.String getUserName()
           
 boolean isConnected()
           
 Channel openChannel(java.lang.String type)
           
 Buffer read(Buffer buf)
           
 void rekey()
           
 void run()
           
 void sendIgnore()
           
 void setClientVersion(java.lang.String cv)
           
 void setConfig(java.util.Hashtable foo)
           
 void setConfig(java.util.Properties foo)
           
 void setHost(java.lang.String host)
           
 void setInputStream(java.io.InputStream in)
           
 void setOutputStream(java.io.OutputStream out)
           
 void setPassword(java.lang.String foo)
           
 void setPort(int port)
           
 void setPortForwardingL(int lport, java.lang.String host, int rport)
           
 void setPortForwardingL(java.lang.String boundaddress, int lport, java.lang.String host, int rport)
           
 void setPortForwardingL(java.lang.String boundaddress, int lport, java.lang.String host, int rport, ServerSocketFactory ssf)
           
 void setPortForwardingR(int rport, java.lang.String daemon)
           
 void setPortForwardingR(int rport, java.lang.String host, int lport)
           
 void setPortForwardingR(int rport, java.lang.String host, int lport, SocketFactory sf)
           
 void setPortForwardingR(int rport, java.lang.String daemon, java.lang.Object[] arg)
           
 void setProxy(Proxy proxy)
           
 void setSocketFactory(SocketFactory foo)
           
 void setTimeout(int foo)
           
 void setUserInfo(UserInfo userinfo)
           
(package private)  void setUserName(java.lang.String foo)
           
 void setX11Cookie(java.lang.String cookie)
           
 void setX11Host(java.lang.String host)
           
 void setX11Port(int port)
           
 void write(Packet packet)
           
(package private)  void write(Packet packet, Channel c, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSH_MSG_DISCONNECT

static final int SSH_MSG_DISCONNECT
See Also:
Constant Field Values

SSH_MSG_IGNORE

static final int SSH_MSG_IGNORE
See Also:
Constant Field Values

SSH_MSG_UNIMPLEMENTED

static final int SSH_MSG_UNIMPLEMENTED
See Also:
Constant Field Values

SSH_MSG_DEBUG

static final int SSH_MSG_DEBUG
See Also:
Constant Field Values

SSH_MSG_SERVICE_REQUEST

static final int SSH_MSG_SERVICE_REQUEST
See Also:
Constant Field Values

SSH_MSG_SERVICE_ACCEPT

static final int SSH_MSG_SERVICE_ACCEPT
See Also:
Constant Field Values

SSH_MSG_KEXINIT

static final int SSH_MSG_KEXINIT
See Also:
Constant Field Values

SSH_MSG_NEWKEYS

static final int SSH_MSG_NEWKEYS
See Also:
Constant Field Values

SSH_MSG_KEXDH_INIT

static final int SSH_MSG_KEXDH_INIT
See Also:
Constant Field Values

SSH_MSG_KEXDH_REPLY

static final int SSH_MSG_KEXDH_REPLY
See Also:
Constant Field Values

SSH_MSG_USERAUTH_REQUEST

static final int SSH_MSG_USERAUTH_REQUEST
See Also:
Constant Field Values

SSH_MSG_USERAUTH_FAILURE

static final int SSH_MSG_USERAUTH_FAILURE
See Also:
Constant Field Values

SSH_MSG_USERAUTH_SUCCESS

static final int SSH_MSG_USERAUTH_SUCCESS
See Also:
Constant Field Values

SSH_MSG_USERAUTH_BANNER

static final int SSH_MSG_USERAUTH_BANNER
See Also:
Constant Field Values

SSH_MSG_USERAUTH_INFO_REQUEST

static final int SSH_MSG_USERAUTH_INFO_REQUEST
See Also:
Constant Field Values

SSH_MSG_USERAUTH_INFO_RESPONSE

static final int SSH_MSG_USERAUTH_INFO_RESPONSE
See Also:
Constant Field Values

SSH_MSG_USERAUTH_PK_OK

static final int SSH_MSG_USERAUTH_PK_OK
See Also:
Constant Field Values

SSH_MSG_GLOBAL_REQUEST

static final int SSH_MSG_GLOBAL_REQUEST
See Also:
Constant Field Values

SSH_MSG_REQUEST_SUCCESS

static final int SSH_MSG_REQUEST_SUCCESS
See Also:
Constant Field Values

SSH_MSG_REQUEST_FAILURE

static final int SSH_MSG_REQUEST_FAILURE
See Also:
Constant Field Values

SSH_MSG_CHANNEL_OPEN

static final int SSH_MSG_CHANNEL_OPEN
See Also:
Constant Field Values

SSH_MSG_CHANNEL_OPEN_CONFIRMATION

static final int SSH_MSG_CHANNEL_OPEN_CONFIRMATION
See Also:
Constant Field Values

SSH_MSG_CHANNEL_OPEN_FAILURE

static final int SSH_MSG_CHANNEL_OPEN_FAILURE
See Also:
Constant Field Values

SSH_MSG_CHANNEL_WINDOW_ADJUST

static final int SSH_MSG_CHANNEL_WINDOW_ADJUST
See Also:
Constant Field Values

SSH_MSG_CHANNEL_DATA

static final int SSH_MSG_CHANNEL_DATA
See Also:
Constant Field Values

SSH_MSG_CHANNEL_EXTENDED_DATA

static final int SSH_MSG_CHANNEL_EXTENDED_DATA
See Also:
Constant Field Values

SSH_MSG_CHANNEL_EOF

static final int SSH_MSG_CHANNEL_EOF
See Also:
Constant Field Values

SSH_MSG_CHANNEL_CLOSE

static final int SSH_MSG_CHANNEL_CLOSE
See Also:
Constant Field Values

SSH_MSG_CHANNEL_REQUEST

static final int SSH_MSG_CHANNEL_REQUEST
See Also:
Constant Field Values

SSH_MSG_CHANNEL_SUCCESS

static final int SSH_MSG_CHANNEL_SUCCESS
See Also:
Constant Field Values

SSH_MSG_CHANNEL_FAILURE

static final int SSH_MSG_CHANNEL_FAILURE
See Also:
Constant Field Values

x11_forwarding

boolean x11_forwarding

in

java.io.InputStream in

out

java.io.OutputStream out

random

static Random random

buf

Buffer buf

packet

Packet packet

socket_factory

SocketFactory socket_factory

host

java.lang.String host

port

int port

username

java.lang.String username

password

java.lang.String password

jsch

JSch jsch

uncompress_len

int[] uncompress_len

thread

java.lang.Runnable thread
Constructor Detail

Session

Session(JSch jsch)
  throws JSchException
Throws:
JSchException
Method Detail

connect

public void connect()
             throws JSchException
Throws:
JSchException

connect

public void connect(int connectTimeout)
             throws JSchException
Throws:
JSchException

rekey

public void rekey()
           throws java.lang.Exception
Throws:
java.lang.Exception

openChannel

public Channel openChannel(java.lang.String type)
                    throws JSchException
Throws:
JSchException

encode

public void encode(Packet packet)
            throws java.lang.Exception
Throws:
java.lang.Exception

read

public Buffer read(Buffer buf)
            throws java.lang.Exception
Throws:
java.lang.Exception

getSessionId

byte[] getSessionId()

write

void write(Packet packet,
           Channel c,
           int length)
     throws java.lang.Exception
Throws:
java.lang.Exception

write

public void write(Packet packet)
           throws java.lang.Exception
Throws:
java.lang.Exception

run

public void run()
Specified by:
run in interface java.lang.Runnable

disconnect

public void disconnect()

setPortForwardingL

public void setPortForwardingL(int lport,
                               java.lang.String host,
                               int rport)
                        throws JSchException
Throws:
JSchException

setPortForwardingL

public void setPortForwardingL(java.lang.String boundaddress,
                               int lport,
                               java.lang.String host,
                               int rport)
                        throws JSchException
Throws:
JSchException

setPortForwardingL

public void setPortForwardingL(java.lang.String boundaddress,
                               int lport,
                               java.lang.String host,
                               int rport,
                               ServerSocketFactory ssf)
                        throws JSchException
Throws:
JSchException

delPortForwardingL

public void delPortForwardingL(int lport)
                        throws JSchException
Throws:
JSchException

delPortForwardingL

public void delPortForwardingL(java.lang.String boundaddress,
                               int lport)
                        throws JSchException
Throws:
JSchException

getPortForwardingL

public java.lang.String[] getPortForwardingL()
                                      throws JSchException
Throws:
JSchException

setPortForwardingR

public void setPortForwardingR(int rport,
                               java.lang.String host,
                               int lport)
                        throws JSchException
Throws:
JSchException

setPortForwardingR

public void setPortForwardingR(int rport,
                               java.lang.String host,
                               int lport,
                               SocketFactory sf)
                        throws JSchException
Throws:
JSchException

setPortForwardingR

public void setPortForwardingR(int rport,
                               java.lang.String daemon)
                        throws JSchException
Throws:
JSchException

setPortForwardingR

public void setPortForwardingR(int rport,
                               java.lang.String daemon,
                               java.lang.Object[] arg)
                        throws JSchException
Throws:
JSchException

delPortForwardingR

public void delPortForwardingR(int rport)
                        throws JSchException
Throws:
JSchException

addChannel

void addChannel(Channel channel)

getConfig

public java.lang.String getConfig(java.lang.String name)

setProxy

public void setProxy(Proxy proxy)

setHost

public void setHost(java.lang.String host)

setPort

public void setPort(int port)

setUserName

void setUserName(java.lang.String foo)

setPassword

public void setPassword(java.lang.String foo)

setUserInfo

public void setUserInfo(UserInfo userinfo)

setInputStream

public void setInputStream(java.io.InputStream in)

setOutputStream

public void setOutputStream(java.io.OutputStream out)

setX11Host

public void setX11Host(java.lang.String host)

setX11Port

public void setX11Port(int port)

setX11Cookie

public void setX11Cookie(java.lang.String cookie)

setConfig

public void setConfig(java.util.Properties foo)

setConfig

public void setConfig(java.util.Hashtable foo)

setSocketFactory

public void setSocketFactory(SocketFactory foo)

isConnected

public boolean isConnected()

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int foo)
                throws JSchException
Throws:
JSchException

getServerVersion

public java.lang.String getServerVersion()

getClientVersion

public java.lang.String getClientVersion()

setClientVersion

public void setClientVersion(java.lang.String cv)

sendIgnore

public void sendIgnore()
                throws java.lang.Exception
Throws:
java.lang.Exception

getHostKey

public HostKey getHostKey()

getHost

public java.lang.String getHost()

getUserName

public java.lang.String getUserName()

getPort

public int getPort()


Copyright 2006 jcraft. All Rights Reserved.