Interface Session.Command
- All Superinterfaces:
AutoCloseable
,Channel
,Closeable
,ErrorNotifiable
,SSHPacketHandler
- All Known Implementing Classes:
SessionChannel
- Enclosing interface:
Session
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
Modifier and TypeMethodDescriptionReturns the command'sstderr
stream.If the command exit violentlywith a signal
, an error message would have been received and can be retrieved via this method.Returns thesignal
if the command exit violently, ornull
if this information was not received.Returns the exit status of the command if it was received, ornull
if this information was not received.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
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 Details
-
getErrorStream
InputStream getErrorStream()Returns the command'sstderr
stream. -
getExitErrorMessage
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
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
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
Send a signal to the remote command.- Parameters:
signal
- the signal- Throws:
TransportException
- if error sending the signal
-