|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.transport.SshSessionFactory
public abstract class SshSessionFactory
Creates and destroys SSH connections to a remote system.
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 Session 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.
| Constructor Summary | |
|---|---|
SshSessionFactory()
|
|
| Method Summary | |
|---|---|
static SshSessionFactory |
getInstance()
Get the currently configured JVM-wide factory. |
abstract com.jcraft.jsch.Session |
getSession(java.lang.String user,
java.lang.String pass,
java.lang.String host,
int port)
Open (or reuse) a session to a host. |
void |
releaseSession(com.jcraft.jsch.Session session)
Close (or recycle) a session to a host. |
static void |
setInstance(SshSessionFactory newFactory)
Change the JVM-wide factory to a different implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SshSessionFactory()
| Method Detail |
|---|
public static SshSessionFactory getInstance()
A factory is always available. By default the factory will read from the
user's $HOME/.ssh and assume OpenSSH compatibility.
public static void setInstance(SshSessionFactory newFactory)
newFactory - factory for future sessions to be created through. If null the
default factory will be restored.s
public abstract com.jcraft.jsch.Session getSession(java.lang.String user,
java.lang.String pass,
java.lang.String host,
int port)
throws com.jcraft.jsch.JSchException
A reasonable UserInfo that can interact with the end-user (if necessary) is installed on the returned session by this method.
The caller must connect the session by invoking connect()
if it has not already been connected.
user - username to authenticate as. If null a reasonable default must
be selected by the implementation. This may be
System.getProperty("user.name").pass - optional user account password or passphrase. If not null a
UserInfo that supplies this value to the SSH library will be
configured.host - hostname (or IP address) to connect to. Must not be null.port - port number the server is listening for connections on. May be <=
0 to indicate the IANA registered port of 22 should be used.
com.jcraft.jsch.JSchException - the session could not be created.public void releaseSession(com.jcraft.jsch.Session session)
session - a session previously obtained from this factory's
getSession(String,String, String, int) method.s
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||