Package com.trilead.ssh2.channel
Class ChannelManager
java.lang.Object
com.trilead.ssh2.channel.ChannelManager
- All Implemented Interfaces:
MessageHandler
ChannelManager. Please read the comments in Channel.java.
Besides the crypto part, this is the core of the library.
- Version:
- $Id: ChannelManager.java,v 1.2 2008/03/03 07:01:36 cplattne Exp $
- Author:
- Christian Plattner, plattner@trilead.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckX11Cookie
(String hexFakeCookie) void
void
closeChannel
(Channel c, String reason, boolean force) int
getAvailable
(Channel c, boolean extended) int
getChannelData
(Channel c, boolean extended, byte[] target, int off, int len) void
handleEndMessage
(Throwable cause) Called to inform that no more messages will be delivered.void
handleMessage
(byte[] msg, int msglen) Handle message.void
msgChannelClose
(byte[] msg, int msglen) void
msgChannelData
(byte[] msg, int msglen) void
msgChannelEOF
(byte[] msg, int msglen) void
msgChannelExtendedData
(byte[] msg, int msglen) void
msgChannelFailure
(byte[] msg, int msglen) void
msgChannelOpen
(byte[] msg, int msglen) void
msgChannelOpenConfirmation
(byte[] msg, int msglen) void
msgChannelOpenFailure
(byte[] msg, int msglen) void
msgChannelRequest
(byte[] msg, int msglen) void
msgChannelSuccess
(byte[] msg, int msglen) void
msgChannelWindowAdjust
(byte[] msg, int msglen) void
void
msgGlobalRequest
(byte[] msg, int msglen) void
openDirectTCPIPChannel
(String host_to_connect, int port_to_connect, String originator_IP_address, int originator_port) void
registerThread
(com.trilead.ssh2.channel.IChannelWorkerThread thr) void
registerX11Cookie
(String hexFakeCookie, X11ServerData data) void
requestCancelGlobalForward
(int bindPort) void
void
requestExecCommand
(Channel c, String cmd) int
requestGlobalForward
(String bindAddress, int bindPort, String targetAddress, int targetPort) void
void
requestPTY
(Channel c, String term, int term_width_characters, int term_height_characters, int term_width_pixels, int term_height_pixels, byte[] terminal_modes) void
void
requestSubSystem
(Channel c, String subSystemName) void
requestX11
(Channel c, boolean singleConnection, String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) void
void
void
void
unRegisterX11Cookie
(String hexFakeCookie, boolean killChannels) int
waitForCondition
(Channel c, long timeout, int condition_mask) Wait until for a condition.
-
Constructor Details
-
ChannelManager
-
-
Method Details
-
registerX11Cookie
-
unRegisterX11Cookie
-
checkX11Cookie
-
closeAllChannels
public void closeAllChannels() -
closeChannel
- Throws:
IOException
-
sendEOF
- Throws:
IOException
-
sendOpenConfirmation
- Throws:
IOException
-
sendData
- Throws:
IOException
-
requestGlobalForward
public int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort) throws IOException - Throws:
IOException
-
requestCancelGlobalForward
- Throws:
IOException
-
registerThread
- Throws:
IOException
-
openDirectTCPIPChannel
public Channel openDirectTCPIPChannel(String host_to_connect, int port_to_connect, String originator_IP_address, int originator_port) throws IOException - Throws:
IOException
-
openSessionChannel
- Throws:
IOException
-
requestGlobalTrileadPing
- Throws:
IOException
-
requestChannelTrileadPing
- Throws:
IOException
-
requestPTY
public void requestPTY(Channel c, String term, int term_width_characters, int term_height_characters, int term_width_pixels, int term_height_pixels, byte[] terminal_modes) throws IOException - Throws:
IOException
-
requestX11
public void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) throws IOException - Throws:
IOException
-
requestSubSystem
- Throws:
IOException
-
requestExecCommand
- Throws:
IOException
-
requestShell
- Throws:
IOException
-
msgChannelExtendedData
- Throws:
IOException
-
waitForCondition
public int waitForCondition(Channel c, long timeout, int condition_mask) throws InterruptedException Wait until for a condition.- Parameters:
c
- Channeltimeout
- in ms, 0 means no timeout.condition_mask
- minimum event mask- Returns:
- all current events
- Throws:
InterruptedException
- the interrupted exception
-
getAvailable
- Throws:
IOException
-
getChannelData
public int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException - Throws:
IOException
-
msgChannelData
- Throws:
IOException
-
msgChannelWindowAdjust
- Throws:
IOException
-
msgChannelOpen
- Throws:
IOException
-
msgChannelRequest
- Throws:
IOException
-
msgChannelEOF
- Throws:
IOException
-
msgChannelClose
- Throws:
IOException
-
msgChannelSuccess
- Throws:
IOException
-
msgChannelFailure
- Throws:
IOException
-
msgChannelOpenConfirmation
- Throws:
IOException
-
msgChannelOpenFailure
- Throws:
IOException
-
msgGlobalRequest
- Throws:
IOException
-
msgGlobalSuccess
- Throws:
IOException
-
msgGlobalFailure
- Throws:
IOException
-
handleMessage
Description copied from interface:MessageHandler
Handle message.- Specified by:
handleMessage
in interfaceMessageHandler
- Parameters:
msg
- the msgmsglen
- the msglen- Throws:
IOException
- the io exception
-
handleEndMessage
Description copied from interface:MessageHandler
Called to inform that no more messages will be delivered.- Specified by:
handleEndMessage
in interfaceMessageHandler
- Parameters:
cause
- For diagnosis, the reason that caused the transport to close down.- Throws:
IOException
- the io exception
-