|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.schmizz.sshj.connection.channel.AbstractChannel
net.schmizz.sshj.connection.channel.direct.AbstractDirectChannel
net.schmizz.sshj.connection.channel.direct.SessionChannel
public class SessionChannel
Session implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.schmizz.sshj.connection.channel.direct.Session |
|---|
Session.Command, Session.Shell, Session.Subsystem |
| Nested classes/interfaces inherited from interface net.schmizz.sshj.connection.channel.Channel |
|---|
Channel.Direct, Channel.Forwarded |
| Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable |
|---|
ErrorNotifiable.Util |
| Field Summary |
|---|
| Fields inherited from class net.schmizz.sshj.connection.channel.AbstractChannel |
|---|
closeEvent, conn, log, lwin, openEvent, rwin, trans |
| Constructor Summary | |
|---|---|
SessionChannel(Connection conn)
|
|
| Method Summary | |
|---|---|
void |
allocateDefaultPTY()
Allocates a default PTY. |
void |
allocatePTY(String term,
int cols,
int rows,
int width,
int height,
Map<PTYMode,Integer> modes)
Allocate a psuedo-terminal for this session. |
Boolean |
canDoFlowControl()
Whether the client can do local flow control using control-S and control-Q. |
void |
changeWindowDimensions(int cols,
int rows,
int width,
int height)
Sends a window dimension change message. |
protected void |
closeAllStreams()
Called when all I/O streams should be closed. |
protected void |
eofInputStreams()
Called when EOF has been received. |
Session.Command |
exec(String command)
Execute a remote command. |
InputStream |
getErrorStream()
Returns the command's stderr stream. |
String |
getExitErrorMessage()
If the command exit violently with a signal, an error message would have been
received and can be retrieved via this method. |
Signal |
getExitSignal()
Returns the signal if the command exit violently, or null if this information was not
received. |
Integer |
getExitStatus()
Returns the exit status of the command if it was received, or null if this information was not
received. |
Boolean |
getExitWasCoreDumped()
If the command exit violently with a signal, information about whether a core dump
took place would have been received and can be retrieved via this method. |
protected void |
gotExtendedData(SSHPacket buf)
|
void |
handleRequest(String req,
SSHPacket buf)
|
void |
notifyError(SSHException error)
Notifies this object of an error. |
void |
reqX11Forwarding(String authProto,
String authCookie,
int screen)
Request X11 forwarding. |
void |
setEnvVar(String name,
String value)
Set an enviornment variable. |
void |
signal(Signal sig)
Send a signal to the remote command. |
Session.Shell |
startShell()
Request a shell. |
Session.Subsystem |
startSubsystem(String name)
Request a subsystem. |
| Methods inherited from class net.schmizz.sshj.connection.channel.direct.AbstractDirectChannel |
|---|
buildOpenReq, gotUnknown, open |
| Methods inherited from class net.schmizz.sshj.connection.channel.AbstractChannel |
|---|
close, finishOff, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getOutputStream, getRecipient, getRemoteMaxPacketSize, getRemoteWinSize, getType, handle, init, isOpen, join, join, newBuffer, receiveInto, sendChannelRequest, sendClose, sendEOF, setAutoExpand, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.schmizz.sshj.connection.channel.Channel |
|---|
close, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getOutputStream, getRecipient, getRemoteMaxPacketSize, getRemoteWinSize, getType, isOpen, join, join, sendEOF, setAutoExpand |
| Methods inherited from interface net.schmizz.sshj.common.SSHPacketHandler |
|---|
handle |
| Constructor Detail |
|---|
public SessionChannel(Connection conn)
| Method Detail |
|---|
public void allocateDefaultPTY()
throws ConnectionException,
TransportException
Session"vt100" with the echo modes disabled.
allocateDefaultPTY in interface SessionConnectionException
TransportException
public void allocatePTY(String term,
int cols,
int rows,
int width,
int height,
Map<PTYMode,Integer> modes)
throws ConnectionException,
TransportException
Session0 dimension parameters will be ignored by the server.
allocatePTY in interface Sessionterm - TERM environment variable value (e.g., vt100)cols - terminal width, cols (e.g., 80)rows - terminal height, rows (e.g., 24)width - terminal width, pixels (e.g., 640)height - terminal height, pixels (e.g., 480)
ConnectionException
TransportExceptionpublic Boolean canDoFlowControl()
Session.Shellcontrol-S and control-Q.
canDoFlowControl in interface Session.Shellnull if no such information was
received
public void changeWindowDimensions(int cols,
int rows,
int width,
int height)
throws TransportException
Session.Shell
changeWindowDimensions in interface Session.Shellcols - terminal width, columnsrows - terminal height, rowswidth - terminal width, pixelsheight - terminal height, pixels
TransportException
public Session.Command exec(String command)
throws ConnectionException,
TransportException
Session
exec in interface SessionSession.Command instance which should now be used
ConnectionException - if the request to execute the command failed
TransportException - if there is an error sending the requestpublic InputStream getErrorStream()
Session.Commandstderr stream.
getErrorStream in interface Session.CommandgetErrorStream in interface Session.Shellpublic String getExitErrorMessage()
Session.Commandwith a signal, an error message would have been
received and can be retrieved via this method. Otherwise, this method will return null.
getExitErrorMessage in interface Session.Commandpublic Signal getExitSignal()
Session.Commandsignal if the command exit violently, or null if this information was not
received.
getExitSignal in interface Session.Commandpublic Integer getExitStatus()
Session.Commandnull if this information was not
received.
getExitStatus in interface Session.CommandgetExitStatus in interface Session.Subsystem
public void handleRequest(String req,
SSHPacket buf)
throws ConnectionException,
TransportException
handleRequest in class AbstractChannelConnectionException
TransportException
public void reqX11Forwarding(String authProto,
String authCookie,
int screen)
throws ConnectionException,
TransportException
Session
reqX11Forwarding in interface SessionauthProto - X11 authentication protocol nameauthCookie - X11 authentication cookiescreen - X11 screen number
ConnectionException - if the request failed
TransportException - if there was an error sending the request
public void setEnvVar(String name,
String value)
throws ConnectionException,
TransportException
Session
setEnvVar in interface Sessionname - name of the variablevalue - value to set
ConnectionException - if the request failed
TransportException - if there was an error sending the request
public void signal(Signal sig)
throws TransportException
Session.Command
signal in interface Session.Commandsignal in interface Session.Shellsig - the signal
TransportException - if error sending the signal
public Session.Shell startShell()
throws ConnectionException,
TransportException
Session
startShell in interface SessionSession.Shell instance which should now be used
ConnectionException - if the request failed
TransportException - if there was an error sending the request
public Session.Subsystem startSubsystem(String name)
throws ConnectionException,
TransportException
Session
startSubsystem in interface Sessionname - subsystem name
Session.Subsystem instance which should now be used
ConnectionException - if the request failed
TransportException - if there was an error sending the requestpublic Boolean getExitWasCoreDumped()
Session.Commandwith a signal, information about whether a core dump
took place would have been received and can be retrieved via this method. Otherwise, this method will return
null.
getExitWasCoreDumped in interface Session.Commandprotected void closeAllStreams()
AbstractChannel
closeAllStreams in class AbstractChannelprotected void eofInputStreams()
AbstractChannel
eofInputStreams in class AbstractChannel
protected void gotExtendedData(SSHPacket buf)
throws ConnectionException,
TransportException
gotExtendedData in class AbstractChannelConnectionException
TransportExceptionpublic void notifyError(SSHException error)
ErrorNotifiableerror.
notifyError in interface ErrorNotifiablenotifyError in class AbstractChannel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||