|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthudson.model.AbstractDescribableImpl<hudson.slaves.ComputerLauncher>
hudson.slaves.ComputerLauncher
hudson.plugins.sshslaves.SSHLauncher
public class SSHLauncher
A computer launcher that tries to start a linux slave by opening an SSH connection and trying to find java.
| Nested Class Summary | |
|---|---|
static class |
SSHLauncher.DefaultJavaProvider
|
static class |
SSHLauncher.DefaultJDKInstaller
Deprecated. Subtype of JDKInstaller causes JENKINS-10641. |
static class |
SSHLauncher.DescriptorImpl
|
| Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
|---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
| Field Summary | |
|---|---|
java.lang.String |
javaPath
Field javaPath. |
java.lang.String |
prefixStartSlaveCmd
Field prefixStartSlaveCmd. |
java.lang.String |
suffixStartSlaveCmd
Field suffixStartSlaveCmd. |
| Fields inherited from class hudson.slaves.ComputerLauncher |
|---|
LIST |
| Constructor Summary | |
|---|---|
SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions)
|
|
SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions,
java.lang.String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
java.lang.String prefixStartSlaveCmd,
java.lang.String suffixStartSlaveCmd)
Constructor SSHLauncher creates a new SSHLauncher instance. |
|
SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions,
java.lang.String javaPath,
java.lang.String prefixStartSlaveCmd,
java.lang.String suffixStartSlaveCmd)
Constructor SSHLauncher creates a new SSHLauncher instance. |
|
| Method Summary | |
|---|---|
void |
afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener)
|
protected java.lang.String |
checkJavaVersion(java.io.PrintStream logger,
java.lang.String javaCommand,
java.io.BufferedReader r,
java.io.StringWriter output)
Given the output of "java -version" in r, determine if this
version of Java is supported. |
com.trilead.ssh2.Connection |
getConnection()
|
java.lang.String |
getHost()
Getter for property 'host'. |
java.lang.String |
getJavaPath()
Gets the optionnal java command to use to launch the slave JVM. |
java.lang.String |
getJvmOptions()
Gets the JVM Options used to launch the slave JVM. |
java.lang.String |
getPassword()
Getter for property 'password'. |
int |
getPort()
Getter for property 'port'. |
java.lang.String |
getPrefixStartSlaveCmd()
|
java.lang.String |
getPrivatekey()
Getter for property 'privatekey'. |
java.lang.String |
getSuffixStartSlaveCmd()
|
protected java.lang.String |
getTimestamp()
Gets the formatted current time stamp. |
java.lang.String |
getUsername()
Getter for property 'username'. |
boolean |
isLaunchSupported()
|
void |
launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
|
protected void |
openConnection(hudson.model.TaskListener listener)
|
protected void |
reportEnvironment(hudson.model.TaskListener listener)
|
protected java.lang.String |
resolveJava(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
return javaPath if specified in the configuration. |
| Methods inherited from class hudson.slaves.ComputerLauncher |
|---|
afterDisconnect, beforeDisconnect, beforeDisconnect, launch |
| Methods inherited from class hudson.model.AbstractDescribableImpl |
|---|
getDescriptor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String javaPath
public final java.lang.String prefixStartSlaveCmd
public final java.lang.String suffixStartSlaveCmd
| Constructor Detail |
|---|
@DataBoundConstructor
public SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions,
java.lang.String javaPath,
java.lang.String prefixStartSlaveCmd,
java.lang.String suffixStartSlaveCmd)
host - The host to connect to.port - The port to connect on.username - The username to connect as.password - The password to connect with.privatekey - The ssh privatekey to connect with.jvmOptions - Options passed to the java vm.javaPath - Path to the host jdk installation. If null the jdk will be auto detected or installed by the JDKInstaller.prefixStartSlaveCmd - This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start slave command.
public SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions,
java.lang.String javaPath,
hudson.tools.JDKInstaller jdkInstaller,
java.lang.String prefixStartSlaveCmd,
java.lang.String suffixStartSlaveCmd)
host - The host to connect to.port - The port to connect on.username - The username to connect as.password - The password to connect with.privatekey - The ssh privatekey to connect with.jvmOptions - Options passed to the java vm.javaPath - Path to the host jdk installation. If null the jdk will be auto detected or installed by the JDKInstaller.jdkInstaller - The jdk installer that will be used if no java vm is found on the specified host. If null the SSHLauncher.DefaultJDKInstaller will be used.prefixStartSlaveCmd - This will prefix the start slave command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start slave command.
public SSHLauncher(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String privatekey,
java.lang.String jvmOptions)
| Method Detail |
|---|
public boolean isLaunchSupported()
isLaunchSupported in class hudson.slaves.ComputerLauncherpublic java.lang.String getJvmOptions()
public java.lang.String getJavaPath()
protected java.lang.String getTimestamp()
public void launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
throws java.lang.InterruptedException
launch in class hudson.slaves.ComputerLauncherjava.lang.InterruptedException
protected java.lang.String resolveJava(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
throws java.lang.InterruptedException,
hudson.util.IOException2
java.lang.InterruptedException
hudson.util.IOException2
protected void reportEnvironment(hudson.model.TaskListener listener)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
protected java.lang.String checkJavaVersion(java.io.PrintStream logger,
java.lang.String javaCommand,
java.io.BufferedReader r,
java.io.StringWriter output)
throws java.io.IOException
r, determine if this
version of Java is supported. This method has default visiblity for testing.
logger - where to log the outputjavaCommand - the command executed, used for loggingr - the output of "java -version"output - copy the data from r into this output buffer
java.io.IOException
protected void openConnection(hudson.model.TaskListener listener)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener)
afterDisconnect in class hudson.slaves.ComputerLauncherpublic java.lang.String getHost()
public int getPort()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.lang.String getPrivatekey()
public com.trilead.ssh2.Connection getConnection()
public java.lang.String getPrefixStartSlaveCmd()
public java.lang.String getSuffixStartSlaveCmd()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||