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
Modifier and Type Method Description java.io.InputStreamgetErrorStream()Returns the command'sstderrstream.java.lang.StringgetExitErrorMessage()If the command exit violentlywith a signal, an error message would have been received and can be retrieved via this method.SignalgetExitSignal()Returns thesignalif the command exit violently, ornullif this information was not received.java.lang.IntegergetExitStatus()Returns the exit status of the command if it was received, ornullif this information was not received.java.lang.BooleangetExitWasCoreDumped()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.voidsignal(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'sstderrstream.
-
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 thesignalif the command exit violently, ornullif 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, ornullif 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
-
-