T
- The type of sessions that are created when connecting to the hostpublic abstract class AbstractHost<T extends AbstractSession<?>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ConnectionInfo |
ci |
private static org.slf4j.Logger |
logger |
Modifier | Constructor and Description |
---|---|
protected |
AbstractHost(ConnectionInfo ci) |
Modifier and Type | Method and Description |
---|---|
abstract T |
connect(int timeout)
Connect to the cluster.
|
private net.schmizz.sshj.userauth.keyprovider.KeyProvider |
createFileKeyProvider(net.schmizz.sshj.Config config,
java.lang.String privateKey,
java.lang.String password,
java.lang.String format)
Create and initialize a private key provider.
|
ConnectionInfo |
getConnectionInfo()
Get the connection information for this host.
|
protected net.schmizz.sshj.SSHClient |
internalConnect(int timeout) |
java.lang.String |
toString() |
private static final org.slf4j.Logger logger
private final ConnectionInfo ci
protected AbstractHost(ConnectionInfo ci)
public ConnectionInfo getConnectionInfo()
public abstract T connect(int timeout)
AbstractSession.close()
the session after use.timeout
- Timeout in seconds for the connection to be establishedprotected net.schmizz.sshj.SSHClient internalConnect(int timeout)
public java.lang.String toString()
toString
in class java.lang.Object
private net.schmizz.sshj.userauth.keyprovider.KeyProvider createFileKeyProvider(net.schmizz.sshj.Config config, java.lang.String privateKey, java.lang.String password, java.lang.String format) throws net.schmizz.sshj.common.SSHException, java.io.IOException
config
- Required since we get supported key file formats from thisprivateKey
- The private key file as a string (required)password
- Optionalformat
- Optional (if not specified, auto-detection will be attempted)net.schmizz.sshj.common.SSHException
java.io.IOException