|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.gerritevents.ssh.SshConnectionImpl
public class SshConnectionImpl
A simple ssh client connection with private key.
| Field Summary | |
|---|---|
protected static String |
CMD_EXEC
SSH Command to open an "exec channel". |
| Constructor Summary | |
|---|---|
protected |
SshConnectionImpl(String host,
int port,
Authentication authentication)
Creates and opens a SshConnection. |
| Method Summary | |
|---|---|
void |
disconnect()
Disconnects the connection. |
String |
executeCommand(String command)
Execute an ssh command on the server. |
com.jcraft.jsch.ChannelExec |
executeCommandChannel(String command)
This version takes a command to run, and then returns a wrapper instance that exposes all the standard state of the channel (stdin, stdout, stderr, exit status, etc). |
Reader |
executeCommandReader(String command)
Execute an ssh command on the server, without closing the session so that a Reader can be returned with streaming data from the server. |
boolean |
isAuthenticated()
Is the connection authenticated. |
boolean |
isConnected()
Is the connection connected. |
boolean |
isSessionOpen()
Returns if there already is an open session on this connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String CMD_EXEC
| Constructor Detail |
|---|
protected SshConnectionImpl(String host,
int port,
Authentication authentication)
throws SshException,
IOException
host - the host to connect to.port - the port.authentication - the authentication-info
SshException - if something happens - usually due to bad config.
IOException - if the unfortunate happens.| Method Detail |
|---|
public boolean isConnected()
isConnected in interface SshConnectionpublic boolean isAuthenticated()
isAuthenticated in interface SshConnectionpublic boolean isSessionOpen()
isSessionOpen in interface SshConnection
public String executeCommand(String command)
throws SshException
executeCommand in interface SshConnectioncommand - the command to execute.
SshException - if so.
public Reader executeCommandReader(String command)
throws SshException,
IOException
executeCommandReader in interface SshConnectioncommand - the command to execute.
IOException - if it is so.
SshException - if there are any ssh problems.
public com.jcraft.jsch.ChannelExec executeCommandChannel(String command)
throws SshException,
IOException
executeCommandChannel in interface SshConnectioncommand - the command to execute.
IOException - if it is so.
SshException - if there are any ssh problems.executeCommandReader(String)public void disconnect()
disconnect in interface SshConnection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||