com.mindbright.sshcommon
Interface SSHConsoleRemote

All Known Implementing Classes:
SSH2ConsoleRemote, SSHConsoleClient

public interface SSHConsoleRemote

Basic interface to classes implementing a console to a remote command or shell.


Method Summary
 void changeStdOut(java.io.OutputStream out)
          Changes the output stream where stdout is written to in the underlying session channel.
 void close()
          Closes the session channel.
 void close(boolean waitforcloseconfirm)
          Closes the session channel.
 boolean command(java.lang.String command)
          Runs single command on server.
 java.io.OutputStream getStdIn()
          Gets the stdin stream of the underlying session channel.
 java.io.InputStream getStdOut()
          Gets the stdout stream of the underlying session channel.
 boolean shell()
          Starts an interactive shell on the server, note that no PTY is allocated.
 

Method Detail

command

public boolean command(java.lang.String command)
Runs single command on server.

Parameters:
command - command line to run
Returns:
a boolean indicating success or failure

shell

public boolean shell()
Starts an interactive shell on the server, note that no PTY is allocated.

Returns:
a boolean indicating success or failure

close

public void close()
Closes the session channel. That is cancels a command/shell in progress if it hasn't already exited.


close

public void close(boolean waitforcloseconfirm)
Closes the session channel. If waitforcloseconfirm is true it waits for the remote end to acknowledge the close.


changeStdOut

public void changeStdOut(java.io.OutputStream out)
Changes the output stream where stdout is written to in the underlying session channel.

Parameters:
out - new stdout stream

getStdIn

public java.io.OutputStream getStdIn()
Gets the stdin stream of the underlying session channel. Note, this is an output stream since one wants to write to stdin.

Returns:
the input stream of stdout stream

getStdOut

public java.io.InputStream getStdOut()
Gets the stdout stream of the underlying session channel. Note, this is an input stream since one wants to read from stdout.

Returns:
the input stream of stdout stream