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 Channel
Channel.Direct, Channel.ForwardedNested classes/interfaces inherited from interface ErrorNotifiable
ErrorNotifiable.Util -
Method Summary
Modifier and TypeMethodDescriptionReturns the command'sstderrstream.If the command exit violentlywith a signal, an error message would have been received and can be retrieved via this method.Returns thesignalif the command exit violently, ornullif this information was not received.Returns the exit status of the command if it was received, ornullif 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.voidSend a signal to the remote command.Methods inherited from interface Channel
close, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getLoggerFactory, getOutputStream, getRecipient, getRemoteCharset, getRemoteMaxPacketSize, getRemoteWinSize, getType, isEOF, isOpen, join, join, setAutoExpandMethods inherited from interface ErrorNotifiable
notifyErrorMethods inherited from interface SSHPacketHandler
handle
-
Method Details
-
getErrorStream
InputStream getErrorStream()Returns the command'sstderrstream. -
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 thesignalif the command exit violently, ornullif 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, ornullif 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
-