|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mindbright.ssh.SSHClientUserAdaptor
com.mindbright.ssh.SSHConsoleClient
public class SSHConsoleClient
| Field Summary | |
|---|---|
protected SSHClient |
client
|
static int |
DEFAULT_COPY_BUFFER_SZ
|
protected OutputStreamPipe |
inBottom
|
protected InputStreamPipe |
inTop
|
protected SSHClientUser |
proxyUser
|
protected java.io.OutputStream |
stderr
Where to store standard error bytes. |
protected com.mindbright.ssh.SSHConsoleClient.TerminalOutStream |
stdin
|
protected java.io.OutputStream |
stdout
|
| Fields inherited from class com.mindbright.ssh.SSHClientUserAdaptor |
|---|
interactor, sshHost, sshPort |
| Constructor Summary | |
|---|---|
SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor)
|
|
SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
int bufferSize)
|
|
SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
SSHClientUser user)
|
|
SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
SSHClientUser user,
int bufferSize)
|
|
| Method Summary | |
|---|---|
void |
changeStdErr(java.io.OutputStream err)
Where to store standard error bytes. |
void |
changeStdOut(NonBlockingOutput out)
Changes the output stream where stdout is written to in the underlying session channel. |
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. |
int |
command(java.lang.String command,
long timeout)
Send a command and wait for a given timeout for the it to finish. |
NonBlockingOutput |
getNBStdIn()
Gets the stdin stream of the underlying session channel. |
NonBlockingInput |
getNBStdOut()
Gets the stdout stream of the underlying session channel. |
NetworkConnection |
getProxyConnection()
Return a connection to the 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. |
TerminalWindow |
getTerminal()
|
void |
print(java.lang.String str)
|
void |
println(java.lang.String str)
|
void |
serverConnect(SSHChannelController controller,
SSHCipher sndCipher)
|
void |
serverDisconnect(java.lang.String reason)
|
void |
setClientUser(SSHClientUser proxyUser)
|
boolean |
shell()
Starts an interactive shell on the server, note that no PTY is allocated. |
void |
stderrWriteString(byte[] str)
|
void |
stdoutWriteString(byte[] str)
|
boolean |
wantPTY()
Return true if we need a PTY on the server |
| Methods inherited from class com.mindbright.ssh.SSHClientUserAdaptor |
|---|
getAliveInterval, getCompressionLevel, getConnectTimeout, getDisplay, getHelloTimeout, getInteractor, getKexTimeout, getMaxPacketSz, getSrvHost, getSrvPort, wantX11Forward |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_COPY_BUFFER_SZ
protected SSHClient client
protected SSHClientUser proxyUser
protected InputStreamPipe inTop
protected OutputStreamPipe inBottom
protected java.io.OutputStream stdout
protected com.mindbright.ssh.SSHConsoleClient.TerminalOutStream stdin
protected java.io.OutputStream stderr
| Constructor Detail |
|---|
public SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
SSHClientUser user)
throws java.io.IOException
java.io.IOException
public SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor)
throws java.io.IOException
java.io.IOException
public SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
int bufferSize)
throws java.io.IOException
java.io.IOException
public SSHConsoleClient(java.lang.String sshHost,
int port,
SSHAuthenticator authenticator,
SSHInteractor interactor,
SSHClientUser user,
int bufferSize)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public boolean command(java.lang.String command)
SSHConsoleRemoteNote, this will create an extra pair of threads to handle the data.
command in interface SSHConsoleRemotecommand - command line to run
public int command(java.lang.String command,
long timeout)
throws TimeoutException,
java.io.IOException
TimeoutException
java.io.IOExceptionpublic boolean shell()
SSHConsoleRemote
shell in interface SSHConsoleRemotepublic void close()
SSHConsoleRemote
close in interface SSHConsoleRemotepublic void close(boolean waitforcloseconfirm)
SSHConsoleRemote
close in interface SSHConsoleRemotepublic void changeStdOut(java.io.OutputStream out)
SSHConsoleRemoteNote that this method only works if the underlying session uses blocking streams and threads.
changeStdOut in interface SSHConsoleRemoteout - new stdout streampublic void changeStdErr(java.io.OutputStream err)
public java.io.OutputStream getStdIn()
SSHConsoleRemoteNote that this method returns null if the underlying stream uses non-blocking io
getStdIn in interface SSHConsoleRemotepublic java.io.InputStream getStdOut()
SSHConsoleRemoteNote that this method returns null if the underlying stream uses non-blocking io
getStdOut in interface SSHConsoleRemote
public void changeStdOut(NonBlockingOutput out)
throws java.lang.IllegalArgumentException
SSHConsoleRemoteNote that this method only works if the underlying session uses non-blocking io.
changeStdOut in interface SSHConsoleRemoteout - new stdout stream
java.lang.IllegalArgumentExceptionpublic NonBlockingOutput getNBStdIn()
SSHConsoleRemoteNote that this method returns null if the underlying stream uses blocking io
getNBStdIn in interface SSHConsoleRemotepublic NonBlockingInput getNBStdOut()
SSHConsoleRemoteNote that this method returns null if the underlying stream uses blocking io
getNBStdOut in interface SSHConsoleRemotepublic void setClientUser(SSHClientUser proxyUser)
public void stdoutWriteString(byte[] str)
stdoutWriteString in interface SSHConsolepublic void stderrWriteString(byte[] str)
stderrWriteString in interface SSHConsolepublic TerminalWindow getTerminal()
getTerminal in interface SSHConsolepublic void print(java.lang.String str)
print in interface SSHConsolepublic void println(java.lang.String str)
println in interface SSHConsole
public void serverConnect(SSHChannelController controller,
SSHCipher sndCipher)
serverConnect in interface SSHConsolepublic void serverDisconnect(java.lang.String reason)
serverDisconnect in interface SSHConsolepublic boolean wantPTY()
SSHClientUser
wantPTY in interface SSHClientUserwantPTY in class SSHClientUserAdaptor
public NetworkConnection getProxyConnection()
throws java.io.IOException
SSHClientUser
getProxyConnection in interface SSHClientUsergetProxyConnection in class SSHClientUserAdaptorjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||