|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.transport.SshSessionFactory
org.eclipse.jgit.transport.SshConfigSessionFactory
public abstract class SshConfigSessionFactory
The base session factory that loads known hosts and private keys from
$HOME/.ssh.
This is the default implementation used by JGit and provides most of the compatibility necessary to match OpenSSH, a popular implementation of SSH used by C Git.
The factory does not provide UI behavior. Override the method
configure(org.eclipse.jgit.transport.OpenSshConfig.Host, Session)
to supply appropriate UserInfo to the session.
| Constructor Summary | |
|---|---|
SshConfigSessionFactory()
|
|
| Method Summary | |
|---|---|
protected abstract void |
configure(OpenSshConfig.Host hc,
com.jcraft.jsch.Session session)
Provide additional configuration for the session based on the host information. |
protected com.jcraft.jsch.JSch |
createDefaultJSch()
|
protected com.jcraft.jsch.Session |
createSession(OpenSshConfig.Host hc,
java.lang.String user,
java.lang.String host,
int port)
Create a new JSch session for the requested address. |
protected com.jcraft.jsch.JSch |
getJSch(OpenSshConfig.Host hc)
Obtain the JSch used to create new sessions. |
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. |
| Methods inherited from class org.eclipse.jgit.transport.SshSessionFactory |
|---|
getInstance, releaseSession, setInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SshConfigSessionFactory()
| Method Detail |
|---|
public com.jcraft.jsch.Session getSession(java.lang.String user,
java.lang.String pass,
java.lang.String host,
int port)
throws com.jcraft.jsch.JSchException
SshSessionFactoryA 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.
getSession in class SshSessionFactoryuser - 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.
protected com.jcraft.jsch.Session createSession(OpenSshConfig.Host hc,
java.lang.String user,
java.lang.String host,
int port)
throws com.jcraft.jsch.JSchException
hc - host configurationuser - login to authenticate as.host - server name to connect to.port - port number of the SSH daemon (typically 22).
com.jcraft.jsch.JSchException - the session could not be created.
protected abstract void configure(OpenSshConfig.Host hc,
com.jcraft.jsch.Session session)
UserInfo.
hc - host configurationsession - session to configure
protected com.jcraft.jsch.JSch getJSch(OpenSshConfig.Host hc)
throws com.jcraft.jsch.JSchException
hc - host configuration
com.jcraft.jsch.JSchException - the user configuration could not be created.
protected com.jcraft.jsch.JSch createDefaultJSch()
throws com.jcraft.jsch.JSchException
com.jcraft.jsch.JSchException - known host keys cannot be loaded.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||