|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.cluster.ssh.launcher.SSHLauncher
@Service(name="SSHLauncher") @Scoped(value=org.jvnet.hk2.component.PerLookup.class) public class SSHLauncher
| Constructor Summary | |
|---|---|
SSHLauncher()
|
|
| Method Summary | |
|---|---|
boolean |
checkConnection()
Check if we can authenticate using public key auth |
boolean |
checkPasswordAuth()
Check if we can connect using password auth |
java.lang.String |
expandPasswordAlias(java.lang.String alias)
|
com.trilead.ssh2.SCPClient |
getSCPClient()
|
SFTPClient |
getSFTPClient()
|
void |
init(java.util.logging.Logger logger)
|
void |
init(Node node,
java.util.logging.Logger logger)
|
void |
init(java.lang.String userName,
java.lang.String host,
int port,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.util.logging.Logger logger)
|
boolean |
isPasswordAlias(java.lang.String alias)
|
void |
pingConnection()
|
int |
runCommand(java.util.List<java.lang.String> command,
java.io.OutputStream os)
|
int |
runCommand(java.util.List<java.lang.String> command,
java.io.OutputStream os,
java.util.List<java.lang.String> stdinLines)
Executes a command on the remote system via ssh, optionally sending lines of data to the remote process's System.in. |
int |
runCommand(java.lang.String command,
java.io.OutputStream os)
WARNING! This method does not handle paths with spaces in them. |
int |
runCommand(java.lang.String command,
java.io.OutputStream os,
java.util.List<java.lang.String> stdinLines)
Executes a command on the remote system via ssh, optionally sending lines of data to the remote process's System.in. |
void |
setupKey(java.lang.String node,
java.lang.String pubKeyFile,
boolean generateKey,
java.lang.String passwd)
Setting up the key involves the following steps: -If a key exists and we can connect using the key, do nothing. |
static byte[] |
toByteArray(java.io.InputStream input)
|
java.lang.String |
toString()
|
void |
validate(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.lang.String installDir,
java.util.logging.Logger logger)
|
void |
validate(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.lang.String installDir,
java.lang.String landmarkPath,
java.util.logging.Logger logger)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SSHLauncher()
| Method Detail |
|---|
public void init(java.util.logging.Logger logger)
public void init(Node node,
java.util.logging.Logger logger)
public void init(java.lang.String userName,
java.lang.String host,
int port,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.util.logging.Logger logger)
public int runCommand(java.util.List<java.lang.String> command,
java.io.OutputStream os,
java.util.List<java.lang.String> stdinLines)
throws java.io.IOException,
java.lang.InterruptedException
command - the command to execute in the form of an argv style listos - stream to receive the output from the commandstdinLines - optional data to be sent to the process's System.in
stream; null if no input should be sent
java.io.IOException
java.lang.InterruptedException
public int runCommand(java.util.List<java.lang.String> command,
java.io.OutputStream os)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public int runCommand(java.lang.String command,
java.io.OutputStream os)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public int runCommand(java.lang.String command,
java.io.OutputStream os,
java.util.List<java.lang.String> stdinLines)
throws java.io.IOException,
java.lang.InterruptedException
command - the command to executeos - stream to receive the output from the commandstdinLines - optional data to be sent to the process's System.in stream; null if no input should be sent
java.io.IOException
java.lang.InterruptedException
public void pingConnection()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void validate(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.lang.String installDir,
java.lang.String landmarkPath,
java.util.logging.Logger logger)
throws java.io.IOException
java.io.IOException
public void validate(java.lang.String host,
int port,
java.lang.String userName,
java.lang.String password,
java.lang.String keyFile,
java.lang.String keyPassPhrase,
java.lang.String installDir,
java.util.logging.Logger logger)
throws java.io.IOException
java.io.IOException
public SFTPClient getSFTPClient()
throws java.io.IOException
java.io.IOException
public com.trilead.ssh2.SCPClient getSCPClient()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String expandPasswordAlias(java.lang.String alias)
public boolean isPasswordAlias(java.lang.String alias)
public void setupKey(java.lang.String node,
java.lang.String pubKeyFile,
boolean generateKey,
java.lang.String passwd)
throws java.io.IOException,
java.lang.InterruptedException
node - - remote hostpubKeyFile - - .pub filegenerateKey - - flag to indicate if key needs to be generated or notpasswd - - ssh user password
java.io.IOException
java.lang.InterruptedException
public static byte[] toByteArray(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic boolean checkConnection()
public boolean checkPasswordAuth()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||