Class AbstractHost<T extends AbstractSession<?>>

java.lang.Object
net.sf.basedb.opengrid.AbstractHost<T>
Type Parameters:
T - The type of sessions that are created when connecting to the host
Direct Known Subclasses:
OpenGridCluster, RemoteHost

public abstract class AbstractHost<T extends AbstractSession<?>>
extends Object
An abstract host that can be reached via SSH.
Since:
1.0
Author:
nicklas
  • Field Details

  • Constructor Details

  • Method Details

    • getConnectionInfo

      public ConnectionInfo getConnectionInfo()
      Get the connection information for this host.
    • connect

      public abstract T connect​(int timeout)
      Connect to the cluster. The returned session can be used to send commands or transfer files to/from the cluster. Do not forget to AbstractSession.close() the session after use.
      Parameters:
      timeout - Timeout in seconds for the connection to be established
    • internalConnect

      protected net.schmizz.sshj.SSHClient internalConnect​(int timeout)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createFileKeyProvider

      private net.schmizz.sshj.userauth.keyprovider.KeyProvider createFileKeyProvider​(net.schmizz.sshj.Config config, String privateKey, String password, String format) throws net.schmizz.sshj.common.SSHException, IOException
      Create and initialize a private key provider.
      Parameters:
      config - Required since we get supported key file formats from this
      privateKey - The private key file as a string (required)
      password - Optional
      format - Optional (if not specified, auto-detection will be attempted)
      Throws:
      net.schmizz.sshj.common.SSHException
      IOException