# Session.Command (sshj 0.4.0 API)
Date: 2011-06-06

## net.schmizz.sshj.connection.channel.direct
Interface Session.Command

All Superinterfaces:
  Channel, 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
`String` `getErrorAsString()` Deprecated.
`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.
`String` `getOutputAsString()` Deprecated.
`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, getOutputStream, getRecipient, getRemoteMaxPacketSize, getRemoteWinSize, getType, isOpen, join, join, sendEOF, setAutoExpand`

Methods inherited from interface net.schmizz.sshj.common.SSHPacketHandler
`handle`

Methods inherited from interface net.schmizz.sshj.common.ErrorNotifiable
`notifyError`

Method Detail

### getErrorStream

    InputStream getErrorStream()

  Returns the command's `stderr` stream.

### getExitErrorMessage

    String getExitErrorMessage()

  If the command exit violently `with a signal`, an error message would have been received and can be retrieved via this method. Otherwise, this method will return `null`.

### getExitSignal

    Signal getExitSignal()

  Returns the `signal` if the command exit violently, or `null` if this information was not received.

### getExitStatus

    Integer getExitStatus()

  Returns the exit status of the command if it was received, or `null` if this information was not received.

### getExitWasCoreDumped

    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. Otherwise, this method will return `null`.

### 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

### getOutputAsString

    @Deprecated
    String getOutputAsString()
                             throws IOException

  Deprecated.

  Throws:
    `IOException`

### getErrorAsString

    @Deprecated
    String getErrorAsString()
                            throws IOException

  Deprecated.

  Throws:
    `IOException`

Copyright © 2009-2011. All Rights Reserved.