Class SSHConnector

All Implemented Interfaces:
ExtensionPoint, Describable<ComputerConnector>

public class SSHConnector extends ComputerConnector
ComputerConnector for SSHLauncher.

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
  • Field Details

    • port

      public int port
      Field port
  • Constructor Details

    • 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. If null 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 seconds
      maxNumRetries - The number of times to retry connection if the SSH connection is refused during initial connect
      retryWaitTime - The number of seconds to wait between retries
      sshHostKeyVerificationStrategy - Host key verification method selected.
  • Method Details

    • launch

      public SSHLauncher launch(@NonNull String host, TaskListener listener)
      Specified by:
      launch in class ComputerConnector
    • 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()