org.eclipse.jgit.transport
Class SshTransport

java.lang.Object
  extended by org.eclipse.jgit.transport.Transport
      extended by org.eclipse.jgit.transport.TcpTransport
          extended by org.eclipse.jgit.transport.SshTransport
Direct Known Subclasses:
TransportGitSsh, TransportSftp

public abstract class SshTransport
extends TcpTransport

The base class for transports that use SSH protocol. This class allows customizing SSH connection settings.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jgit.transport.Transport
Transport.Operation
 
Field Summary
 
Fields inherited from class org.eclipse.jgit.transport.Transport
DEFAULT_FETCH_THIN, DEFAULT_PUSH_THIN, local, REFSPEC_PUSH_ALL, REFSPEC_TAGS, uri
 
Constructor Summary
protected SshTransport(Repository local, URIish uri)
          Create a new transport instance.
 
Method Summary
 void close()
          Close any resources used by this transport.
protected  RemoteSession getSession()
          Get the default SSH session
 SshSessionFactory getSshSessionFactory()
           
 void setSshSessionFactory(SshSessionFactory factory)
          Set SSH session factory instead of the default one for this instance of the transport.
 
Methods inherited from class org.eclipse.jgit.transport.Transport
applyConfig, fetch, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, getCredentialsProvider, getOptionReceivePack, getOptionUploadPack, getPackConfig, getTagOpt, getTimeout, getTransportProtocols, getURI, isCheckFetchedObjects, isDryRun, isFetchThin, isPushThin, isRemoveDeletedRefs, open, open, open, open, open, open, openAll, openAll, openAll, openAll, openFetch, openPush, push, register, setCheckFetchedObjects, setCredentialsProvider, setDryRun, setFetchThin, setOptionReceivePack, setOptionUploadPack, setPackConfig, setPushThin, setRemoveDeletedRefs, setTagOpt, setTimeout, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshTransport

protected SshTransport(Repository local,
                       URIish uri)
Create a new transport instance.

Parameters:
local - the repository this instance will fetch into, or push out of. This must be the repository passed to Transport.open(Repository, URIish).
uri - the URI used to access the remote repository. This must be the URI passed to Transport.open(Repository, URIish).
Method Detail

setSshSessionFactory

public void setSshSessionFactory(SshSessionFactory factory)
Set SSH session factory instead of the default one for this instance of the transport.

Parameters:
factory - a factory to set, must not be null
Throws:
IllegalStateException - if session has been already created.

getSshSessionFactory

public SshSessionFactory getSshSessionFactory()
Returns:
the SSH session factory that will be used for creating SSH sessions

getSession

protected RemoteSession getSession()
                            throws TransportException
Get the default SSH session

Returns:
a remote session
Throws:
TransportException - in case of error with opening SSH session

close

public void close()
Description copied from class: Transport
Close any resources used by this transport.

If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.

Specified by:
close in class Transport


Copyright © 2012. All Rights Reserved.