Package net.sf.basedb.opengrid
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
An abstract host that can be reached via SSH.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ConnectionInfo
private static final ExtensionsLogger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract T
connect
(int timeout) Connect to the cluster.private net.schmizz.sshj.userauth.keyprovider.KeyProvider
createFileKeyProvider
(net.schmizz.sshj.Config config, String privateKey, String password, String format) Create and initialize a private key provider.Get the connection information for this host.protected net.schmizz.sshj.SSHClient
internalConnect
(int timeout) toString()
-
Field Details
-
logger
-
ci
-
-
Constructor Details
-
AbstractHost
-
-
Method Details
-
getConnectionInfo
Get the connection information for this host. -
connect
Connect to the cluster. The returned session can be used to send commands or transfer files to/from the cluster. Do not forget toAbstractSession.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
-
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 thisprivateKey
- The private key file as a string (required)password
- Optionalformat
- Optional (if not specified, auto-detection will be attempted)- Throws:
net.schmizz.sshj.common.SSHException
IOException
-