Package org.apache.sshd.git.transport
Class GitSshdSessionFactory
- java.lang.Object
-
- org.eclipse.jgit.transport.SshSessionFactory
-
- org.apache.sshd.git.transport.GitSshdSessionFactory
-
- All Implemented Interfaces:
org.apache.sshd.client.session.ClientSessionHolder
,org.apache.sshd.common.session.SessionContextHolder
,org.apache.sshd.common.session.SessionHolder<org.apache.sshd.client.session.ClientSession>
public class GitSshdSessionFactory extends org.eclipse.jgit.transport.SshSessionFactory implements org.apache.sshd.common.session.SessionHolder<org.apache.sshd.client.session.ClientSession>, org.apache.sshd.client.session.ClientSessionHolder
TODO Add javadoc
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.sshd.client.SshClient
client
static GitSshdSessionFactory
INSTANCE
private org.apache.sshd.client.session.ClientSession
session
-
Constructor Summary
Constructors Modifier Constructor Description GitSshdSessionFactory()
GitSshdSessionFactory(org.apache.sshd.client.session.ClientSession session)
Used to provide an externally managedClientSession
instance.GitSshdSessionFactory(org.apache.sshd.client.SshClient client)
Used to provide an externally managedSshClient
instance.protected
GitSshdSessionFactory(org.apache.sshd.client.SshClient client, org.apache.sshd.client.session.ClientSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.sshd.client.SshClient
getClient()
org.apache.sshd.client.session.ClientSession
getClientSession()
org.apache.sshd.client.session.ClientSession
getSession()
org.eclipse.jgit.transport.RemoteSession
getSession(org.eclipse.jgit.transport.URIish uri, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider, org.eclipse.jgit.util.FS fs, int tms)
java.lang.String
getType()
-
Methods inherited from class org.eclipse.jgit.transport.SshSessionFactory
getInstance, getLocalUserName, releaseSession, setInstance
-
-
-
-
Field Detail
-
INSTANCE
public static final GitSshdSessionFactory INSTANCE
-
client
private final org.apache.sshd.client.SshClient client
-
session
private final org.apache.sshd.client.session.ClientSession session
-
-
Constructor Detail
-
GitSshdSessionFactory
public GitSshdSessionFactory()
-
GitSshdSessionFactory
public GitSshdSessionFactory(org.apache.sshd.client.SshClient client)
Used to provide an externally managedSshClient
instance. In this case, the caller is responsible for start/stop-ing the client once no longer needed.- Parameters:
client
- The (nevernull
) client instance
-
GitSshdSessionFactory
public GitSshdSessionFactory(org.apache.sshd.client.session.ClientSession session)
Used to provide an externally managedClientSession
instance. In this case, the caller is responsible for connecting and disconnecting the session once no longer needed. Note: in this case, the connection and authentication phase are skipped - i.e., any specific host/port/user/password(s) specified in the GIT URI are not used.- Parameters:
session
- The (nevernull
) client session instance
-
GitSshdSessionFactory
protected GitSshdSessionFactory(org.apache.sshd.client.SshClient client, org.apache.sshd.client.session.ClientSession session)
-
-
Method Detail
-
getType
public java.lang.String getType()
- Specified by:
getType
in classorg.eclipse.jgit.transport.SshSessionFactory
-
getSession
public org.eclipse.jgit.transport.RemoteSession getSession(org.eclipse.jgit.transport.URIish uri, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider, org.eclipse.jgit.util.FS fs, int tms) throws org.eclipse.jgit.errors.TransportException
- Specified by:
getSession
in classorg.eclipse.jgit.transport.SshSessionFactory
- Throws:
org.eclipse.jgit.errors.TransportException
-
getClient
protected org.apache.sshd.client.SshClient getClient()
-
getClientSession
public org.apache.sshd.client.session.ClientSession getClientSession()
- Specified by:
getClientSession
in interfaceorg.apache.sshd.client.session.ClientSessionHolder
-
getSession
public org.apache.sshd.client.session.ClientSession getSession()
- Specified by:
getSession
in interfaceorg.apache.sshd.common.session.SessionHolder<org.apache.sshd.client.session.ClientSession>
-
-