|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.transport.SshSessionFactory org.eclipse.jgit.transport.JschConfigSessionFactory
public abstract class JschConfigSessionFactory
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 | |
---|---|
JschConfigSessionFactory()
|
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(FS fs)
|
protected com.jcraft.jsch.Session |
createSession(OpenSshConfig.Host hc,
String user,
String host,
int port,
FS fs)
Create a new remote session for the requested address. |
protected com.jcraft.jsch.JSch |
getJSch(OpenSshConfig.Host hc,
FS fs)
Obtain the JSch used to create new sessions. |
RemoteSession |
getSession(URIish uri,
CredentialsProvider credentialsProvider,
FS fs,
int tms)
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 JschConfigSessionFactory()
Method Detail |
---|
public RemoteSession getSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, int tms) throws TransportException
SshSessionFactory
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.
getSession
in class SshSessionFactory
uri
- URI information about the remote hostcredentialsProvider
- provider to support authentication, may be null.fs
- the file system abstraction which will be necessary to
perform certain file system operations.tms
- Timeout value, in milliseconds.
TransportException
- the session could not be created.protected com.jcraft.jsch.Session createSession(OpenSshConfig.Host hc, String user, String host, int port, FS fs) 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).fs
- the file system abstraction which will be necessary to
perform certain file system operations.
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 configureprotected com.jcraft.jsch.JSch getJSch(OpenSshConfig.Host hc, FS fs) throws com.jcraft.jsch.JSchException
hc
- host configurationfs
- the file system abstraction which will be necessary to
perform certain file system operations.
com.jcraft.jsch.JSchException
- the user configuration could not be created.protected com.jcraft.jsch.JSch createDefaultJSch(FS fs) throws com.jcraft.jsch.JSchException
fs
- the file system abstraction which will be necessary to
perform certain file system operations.
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 |