public class ChannelManager extends Object implements MessageHandler
| Constructor and Description |
|---|
ChannelManager(ServerConnectionState state)
Constructor for server-mode.
|
ChannelManager(TransportManager tm)
Constructor for client-mode.
|
| Modifier and Type | Method and Description |
|---|---|
X11ServerData |
checkX11Cookie(String hexFakeCookie) |
void |
closeAllChannels() |
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 |
handleMessage(byte[] msg,
int msglen) |
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 |
msgGlobalFailure() |
void |
msgGlobalRequest(byte[] msg,
int msglen) |
void |
msgGlobalSuccess() |
Channel |
openDirectTCPIPChannel(String host_to_connect,
int port_to_connect,
String originator_IP_address,
int originator_port) |
Channel |
openSessionChannel() |
void |
registerThread(ch.ethz.ssh2.channel.IChannelWorkerThread thr) |
void |
registerX11Cookie(String hexFakeCookie,
X11ServerData data) |
void |
requestCancelGlobalForward(int bindPort) |
void |
requestExecCommand(Channel c,
String cmd) |
void |
requestExecCommand(Channel c,
String cmd,
String charsetName) |
int |
requestGlobalForward(String bindAddress,
int bindPort,
String targetAddress,
int targetPort) |
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 |
requestShell(Channel c) |
void |
requestSubSystem(Channel c,
String subSystemName) |
void |
requestWindowChange(Channel c,
int term_width_characters,
int term_height_characters,
int term_width_pixels,
int term_height_pixels) |
void |
requestX11(Channel c,
boolean singleConnection,
String x11AuthenticationProtocol,
String x11AuthenticationCookie,
int x11ScreenNumber) |
void |
sendData(Channel c,
byte[] buffer,
int pos,
int len) |
void |
sendEOF(Channel c) |
void |
sendOpenConfirmation(Channel c) |
void |
unRegisterX11Cookie(String hexFakeCookie,
boolean killChannels) |
int |
waitForCondition(Channel c,
long timeout,
int condition_mask)
Wait until for a condition.
|
public ChannelManager(TransportManager tm)
tm - public ChannelManager(ServerConnectionState state)
state - public void registerX11Cookie(String hexFakeCookie, X11ServerData data)
public void unRegisterX11Cookie(String hexFakeCookie, boolean killChannels)
public X11ServerData checkX11Cookie(String hexFakeCookie)
public void closeAllChannels()
public void closeChannel(Channel c, String reason, boolean force) throws IOException
IOExceptionpublic void sendEOF(Channel c) throws IOException
IOExceptionpublic void sendOpenConfirmation(Channel c) throws IOException
IOExceptionpublic void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
IOExceptionpublic int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort) throws IOException
IOExceptionpublic void requestCancelGlobalForward(int bindPort)
throws IOException
IOExceptionpublic void registerThread(ch.ethz.ssh2.channel.IChannelWorkerThread thr)
throws IOException
IOExceptionpublic Channel openDirectTCPIPChannel(String host_to_connect, int port_to_connect, String originator_IP_address, int originator_port) throws IOException
IOExceptionpublic Channel openSessionChannel() throws IOException
IOExceptionpublic 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
IOExceptionpublic void requestWindowChange(Channel c, int term_width_characters, int term_height_characters, int term_width_pixels, int term_height_pixels) throws IOException
IOExceptionpublic void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) throws IOException
IOExceptionpublic void requestSubSystem(Channel c, String subSystemName) throws IOException
IOExceptionpublic void requestExecCommand(Channel c, String cmd) throws IOException
IOExceptionpublic void requestExecCommand(Channel c, String cmd, String charsetName) throws IOException
charsetName - The charset used to convert between Java Unicode Strings and byte encodingsIOExceptionpublic void requestShell(Channel c) throws IOException
IOExceptionpublic void msgChannelExtendedData(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic int waitForCondition(Channel c, long timeout, int condition_mask) throws IOException
c - Channeltimeout - in ms, 0 means no timeout.condition_mask - minimum event mask (at least one of the conditions must be fulfilled)IOExceptionpublic int getAvailable(Channel c, boolean extended) throws IOException
IOExceptionpublic int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
IOExceptionpublic void msgChannelData(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelWindowAdjust(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpen(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelRequest(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelEOF(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelClose(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelSuccess(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelFailure(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpenConfirmation(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpenFailure(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgGlobalRequest(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgGlobalSuccess()
throws IOException
IOExceptionpublic void msgGlobalFailure()
throws IOException
IOExceptionpublic void handleMessage(byte[] msg,
int msglen)
throws IOException
handleMessage in interface MessageHandlerIOExceptionCopyright © 2014. All Rights Reserved.