Package hudson.plugins.sshslaves
Class SSHConnector
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ComputerConnector>
-
- hudson.slaves.ComputerConnector
-
- hudson.plugins.sshslaves.SSHConnector
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ComputerConnector>
public class SSHConnector extends ComputerConnector
ComputerConnector
forSSHLauncher
.Significant code duplication between this and
SSHLauncher
because of the historical reason. Newer plugins like this should define a separate Describable connection parameter class and have connector and launcher share them.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SSHConnector.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description int
port
Field port
-
Constructor Summary
Constructors Constructor Description SSHConnector(int port, String credentialsId)
Constructor SSHLauncher creates a new SSHLauncher instance.SSHConnector(int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
Constructor SSHConnector creates a new SSHConnector instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCredentialsId()
String
getJavaPath()
String
getJvmOptions()
Integer
getLaunchTimeoutSeconds()
Integer
getMaxNumRetries()
int
getPort()
String
getPrefixStartSlaveCmd()
Integer
getRetryWaitTime()
SshHostKeyVerificationStrategy
getSshHostKeyVerificationStrategy()
String
getSuffixStartSlaveCmd()
Boolean
getTcpNoDelay()
String
getWorkDir()
SSHLauncher
launch(String host, TaskListener listener)
void
setCredentialsId(String credentialsId)
void
setJavaPath(String value)
void
setJvmOptions(String value)
void
setLaunchTimeoutSeconds(Integer value)
void
setMaxNumRetries(Integer value)
void
setPort(int value)
void
setPrefixStartSlaveCmd(String value)
void
setRetryWaitTime(Integer value)
void
setSshHostKeyVerificationStrategy(SshHostKeyVerificationStrategy value)
void
setSuffixStartSlaveCmd(String value)
void
setTcpNoDelay(Boolean tcpNoDelay)
void
setWorkDir(String workDir)
-
Methods inherited from class hudson.slaves.ComputerConnector
getDescriptor
-
-
-
-
Constructor Detail
-
SSHConnector
@DataBoundConstructor public SSHConnector(int port, String credentialsId)
Constructor SSHLauncher creates a new SSHLauncher instance.- Parameters:
port
- The port to connect on.credentialsId
- The credentials id to connect as.
-
SSHConnector
public SSHConnector(int port, String credentialsId, String jvmOptions, String javaPath, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime, SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
Constructor SSHConnector creates a new SSHConnector instance.- Parameters:
port
- The port to connect on.credentialsId
- The credentials id to connect as.jvmOptions
- Options passed to the java vm.javaPath
- Path to the host jdk installation. Ifnull
the jdk will be auto detected.prefixStartSlaveCmd
- This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd
- This will suffix the start agent command.launchTimeoutSeconds
- Launch timeout in secondsmaxNumRetries
- The number of times to retry connection if the SSH connection is refused during initial connectretryWaitTime
- The number of seconds to wait between retriessshHostKeyVerificationStrategy
- Host key verification method selected.
-
-
Method Detail
-
launch
public SSHLauncher launch(@NonNull String host, TaskListener listener)
- Specified by:
launch
in classComputerConnector
-
setJvmOptions
@DataBoundSetter public void setJvmOptions(String value)
-
setJavaPath
@DataBoundSetter public void setJavaPath(String value)
-
setPrefixStartSlaveCmd
@DataBoundSetter public void setPrefixStartSlaveCmd(String value)
-
setSuffixStartSlaveCmd
@DataBoundSetter public void setSuffixStartSlaveCmd(String value)
-
setMaxNumRetries
@DataBoundSetter public void setMaxNumRetries(Integer value)
-
setLaunchTimeoutSeconds
@DataBoundSetter public void setLaunchTimeoutSeconds(Integer value)
-
setRetryWaitTime
@DataBoundSetter public void setRetryWaitTime(Integer value)
-
setSshHostKeyVerificationStrategy
@DataBoundSetter public void setSshHostKeyVerificationStrategy(SshHostKeyVerificationStrategy value)
-
setPort
public void setPort(int value)
-
setTcpNoDelay
@DataBoundSetter public void setTcpNoDelay(Boolean tcpNoDelay)
-
getSshHostKeyVerificationStrategy
public SshHostKeyVerificationStrategy getSshHostKeyVerificationStrategy()
-
setWorkDir
@DataBoundSetter public void setWorkDir(String workDir)
-
getCredentialsId
public String getCredentialsId()
-
getPort
public int getPort()
-
setCredentialsId
public void setCredentialsId(String credentialsId)
-
getJvmOptions
public String getJvmOptions()
-
getJavaPath
public String getJavaPath()
-
getPrefixStartSlaveCmd
public String getPrefixStartSlaveCmd()
-
getSuffixStartSlaveCmd
public String getSuffixStartSlaveCmd()
-
getLaunchTimeoutSeconds
public Integer getLaunchTimeoutSeconds()
-
getMaxNumRetries
public Integer getMaxNumRetries()
-
getRetryWaitTime
public Integer getRetryWaitTime()
-
getWorkDir
public String getWorkDir()
-
getTcpNoDelay
public Boolean getTcpNoDelay()
-
-