Interface Session.Command
-
- All Superinterfaces:
java.lang.AutoCloseable
,Channel
,java.io.Closeable
,ErrorNotifiable
,SSHPacketHandler
- All Known Implementing Classes:
SessionChannel
- Enclosing interface:
- Session
public static interface Session.Command extends Channel
Command API.
-
-
Nested Class Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.InputStream
getErrorStream()
Returns the command'sstderr
stream.java.lang.String
getExitErrorMessage()
If the command exit violentlywith a signal
, an error message would have been received and can be retrieved via this method.Signal
getExitSignal()
Returns thesignal
if the command exit violently, ornull
if this information was not received.java.lang.Integer
getExitStatus()
Returns the exit status of the command if it was received, ornull
if this information was not received.java.lang.Boolean
getExitWasCoreDumped()
If the command exit violentlywith a signal
, information about whether a core dump took place would have been received and can be retrieved via this method.void
signal(Signal signal)
Send a signal to the remote command.-
Methods inherited from interface net.schmizz.sshj.connection.channel.Channel
close, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getLoggerFactory, getOutputStream, getRecipient, getRemoteCharset, getRemoteMaxPacketSize, getRemoteWinSize, getType, isEOF, isOpen, join, join, setAutoExpand
-
Methods inherited from interface net.schmizz.sshj.common.ErrorNotifiable
notifyError
-
Methods inherited from interface net.schmizz.sshj.common.SSHPacketHandler
handle
-
-
-
-
Method Detail
-
getErrorStream
java.io.InputStream getErrorStream()
Returns the command'sstderr
stream.
-
getExitErrorMessage
java.lang.String getExitErrorMessage()
If the command exit violentlywith a signal
, an error message would have been received and can be retrieved via this method. Otherwise, this method will returnnull
. NOTE: Always callChannel.close()
first before inspecting the exit error message.
-
getExitSignal
Signal getExitSignal()
Returns thesignal
if the command exit violently, ornull
if this information was not received. NOTE: Always callChannel.close()
first before inspecting the exit signal.
-
getExitStatus
java.lang.Integer getExitStatus()
Returns the exit status of the command if it was received, ornull
if this information was not received. NOTE: Always callChannel.close()
first before inspecting the exit status.
-
getExitWasCoreDumped
java.lang.Boolean getExitWasCoreDumped()
If the command exit violentlywith 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 returnnull
.
-
signal
void signal(Signal signal) throws TransportException
Send a signal to the remote command.- Parameters:
signal
- the signal- Throws:
TransportException
- if error sending the signal
-
-