Different implementations of the session factory may be used to control communicating with the end-user as well as reading their personal SSH configuration settings, such as known hosts and private keys.
A RemoteSession must be returned to the factory that created it.
Callers are encouraged to retain the SshSessionFactory for the duration of
the period they are using the session.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static SshSessionFactory | Returns: factory the current factory for this JVM.Gets the currently configured JVM-wide factory. |
| public static String | Returns: the user nameRetrieves the local user name as defined by the system property "user.name". |
| public abstract RemoteSession | Returns: a connected and authenticated session for communicating with the remote host given by theuriURI of the remote host to connect to uri, CredentialsProvider provider to support authentication, may be credentialsProvider, FS null if no
user input for authentication is neededthe file system abstraction to use for certain file
operations, such as reading configuration files fs, int connection timeout for creating the session, in milliseconds tms)Opens (or reuses) a session to a host. |
| public abstract String | |
| public void | releaseSession(RemoteSession
a session previously obtained from this factory's
session)getSession(URIish, CredentialsProvider, FS, int)
method.Closes (or recycles) a session to a host. |
| public static void | setInstance(SshSessionFactory
factory for future sessions to be created through; if
newFactory)null the default factory will be restored.Changes the JVM-wide factory to a different implementation. |
| SshSessionFactory | back to summary |
|---|---|
| public SshSessionFactory() | |
| getInstance | back to summary |
|---|---|
| public static SshSessionFactory getInstance() Gets the currently configured JVM-wide factory.
By default the factory will read from the user's
| |
| getLocalUserName | back to summary |
|---|---|
| public static String getLocalUserName() Retrieves the local user name as defined by the system property "user.name".
| |
| getSession | back to summary |
|---|---|
| public abstract RemoteSession getSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, int tms) throws TransportException Opens (or reuses) a session to a host. The returned session is connected and authenticated and is ready for further use.
| |
| getType | back to summary |
|---|---|
| public abstract String getType() The name of the type of session factory.
| |
| releaseSession | back to summary |
|---|---|
| public void releaseSession(RemoteSession session) Closes (or recycles) a session to a host.
| |
| setInstance | back to summary |
|---|---|
| public static void setInstance(SshSessionFactory newFactory) Changes the JVM-wide factory to a different implementation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static volatile SshSessionFactory |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SshSessionFactory | |
| private static SshSessionFactory | |
| public static void |
| INSTANCE | back to summary |
|---|---|
| private static volatile SshSessionFactory INSTANCE | |
| DefaultFactory | back to summary |
|---|---|
| private DefaultFactory() | |
| getInstance | back to summary |
|---|---|
| public static SshSessionFactory getInstance() | |
| loadSshSessionFactory | back to summary |
|---|---|
| private static SshSessionFactory loadSshSessionFactory() | |
| setInstance | back to summary |
|---|---|
| public static void setInstance(SshSessionFactory newFactory) | |