Package com.jcraft.jsch
Class ChannelSession
java.lang.Object
com.jcraft.jsch.Channel
com.jcraft.jsch.ChannelSession
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
ChannelExec
,ChannelSftp
,ChannelShell
,ChannelSubsystem
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jcraft.jsch.Channel
Channel.MyPipedInputStream, Channel.PassiveInputStream, Channel.PassiveOutputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static byte[]
protected boolean
protected Hashtable
protected boolean
protected int
protected byte[]
protected int
protected int
protected String
protected int
protected boolean
Fields inherited from class com.jcraft.jsch.Channel
close, connected, connectTimeout, eof_local, eof_remote, exitstatus, id, index, io, lmpsize, lwsize, lwsize_max, notifyme, open_confirmation, recipient, reply, rmpsize, rwsize, SSH_MSG_CHANNEL_OPEN_CONFIRMATION, SSH_MSG_CHANNEL_OPEN_FAILURE, SSH_MSG_CHANNEL_WINDOW_ADJUST, SSH_OPEN_ADMINISTRATIVELY_PROHIBITED, SSH_OPEN_CONNECT_FAILED, SSH_OPEN_RESOURCE_SHORTAGE, SSH_OPEN_UNKNOWN_CHANNEL_TYPE, thread, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Hashtable
getEnv()
void
run()
protected void
void
setAgentForwarding
(boolean enable) Enable the agent forwarding.void
setEnv
(byte[] name, byte[] value) Set the environment variable.void
Set the environment variable.void
Deprecated.void
setPty
(boolean enable) Allocate a Pseudo-Terminal.void
setPtySize
(int col, int row, int wp, int hp) Change the window dimension interactively.void
setPtyType
(String ttype) Set the terminal type.void
setPtyType
(String ttype, int col, int row, int wp, int hp) Set the terminal type.void
setTerminalMode
(byte[] terminal_mode) Set the terminal mode.void
setXForwarding
(boolean enable) Enable the X11 forwarding.private byte[]
Methods inherited from class com.jcraft.jsch.Channel
addRemoteWindowSize, close, connect, connect, del, disconnect, disconnect, eof, eof_remote, genChannelOpenPacket, getChannel, getChannel, getData, getExitStatus, getExtInputStream, getId, getInputStream, getOutputStream, getRecipient, getSession, init, isClosed, isConnected, isEOF, sendChannelOpen, sendOpenConfirmation, sendOpenFailure, sendSignal, setExitStatus, setExtOutputStream, setExtOutputStream, setInputStream, setInputStream, setLocalPacketSize, setLocalWindowSize, setLocalWindowSizeMax, setOutputStream, setOutputStream, setRecipient, setRemotePacketSize, setRemoteWindowSize, setSession, start, write, write, write_ext
-
Field Details
-
_session
private static byte[] _session -
agent_forwarding
protected boolean agent_forwarding -
xforwading
protected boolean xforwading -
env
-
pty
protected boolean pty -
ttype
-
tcol
protected int tcol -
trow
protected int trow -
twp
protected int twp -
thp
protected int thp -
terminal_mode
protected byte[] terminal_mode
-
-
Constructor Details
-
ChannelSession
ChannelSession()
-
-
Method Details
-
setAgentForwarding
public void setAgentForwarding(boolean enable) Enable the agent forwarding.- Parameters:
enable
-
-
setXForwarding
public void setXForwarding(boolean enable) Enable the X11 forwarding. Refer to RFC4254 6.3.1. Requesting X11 Forwarding.- Overrides:
setXForwarding
in classChannel
- Parameters:
enable
-
-
setEnv
Deprecated.UsesetEnv(String, String)
orsetEnv(byte[], byte[])
instead.- See Also:
-
setEnv
Set the environment variable. Ifname
andvalue
are needed to be passed to the remote in your favorite encoding, usesetEnv(byte[], byte[])
. Refer to RFC4254 6.4 Environment Variable Passing.- Parameters:
name
- A name for environment variable.value
- A value for environment variable.
-
setEnv
public void setEnv(byte[] name, byte[] value) Set the environment variable. Refer to RFC4254 6.4 Environment Variable Passing.- Parameters:
name
- A name of environment variable.value
- A value of environment variable.- See Also:
-
getEnv
-
setPty
public void setPty(boolean enable) Allocate a Pseudo-Terminal. Refer to RFC4254 6.2. Requesting a Pseudo-Terminal.- Parameters:
enable
-
-
setTerminalMode
public void setTerminalMode(byte[] terminal_mode) Set the terminal mode.- Parameters:
terminal_mode
-
-
setPtySize
public void setPtySize(int col, int row, int wp, int hp) Change the window dimension interactively. Refer to RFC4254 6.7. Window Dimension Change Message.- Parameters:
col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixels
-
setPtyType
Set the terminal type. This method is not effective after Channel#connect().- Parameters:
ttype
- terminal type(for example, "vt100")- See Also:
-
setPtyType
Set the terminal type. This method is not effective after Channel#connect().- Parameters:
ttype
- terminal type(for example, "vt100")col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixels
-
sendRequests
- Throws:
Exception
-
toByteArray
-
run
public void run()
-
setEnv(String, String)
orsetEnv(byte[], byte[])
instead.