Package org.eclipse.jgit.api
Class TransportCommand<C extends GitCommand,T>
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<T>
-
- org.eclipse.jgit.api.TransportCommand<C,T>
-
- Type Parameters:
C
-T
-
- All Implemented Interfaces:
Callable<T>
- Direct Known Subclasses:
CloneCommand
,FetchCommand
,LsRemoteCommand
,PullCommand
,PushCommand
,SubmoduleAddCommand
,SubmoduleUpdateCommand
public abstract class TransportCommand<C extends GitCommand,T> extends GitCommand<T>
Base class for commands that use aTransport
during execution.This class provides standard configuration of a transport for options such as a
CredentialsProvider
, a timeout, and aTransportConfigCallback
.
-
-
Field Summary
Fields Modifier and Type Field Description protected CredentialsProvider
credentialsProvider
Configured credentials providerprotected int
timeout
Configured transport timeoutprotected TransportConfigCallback
transportConfigCallback
Configured callback for transport configuration-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransportCommand(Repository repo)
Constructor for TransportCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected C
configure(TransportCommand childCommand)
Configure a child command with the current configuration set inthis
commandprotected C
configure(Transport transport)
Configure transport with credentials provider, timeout, and config callbackprotected C
self()
Return this command cast toC
C
setCredentialsProvider(CredentialsProvider credentialsProvider)
Set thecredentialsProvider
.C
setTimeout(int timeout)
Settimeout
.C
setTransportConfigCallback(TransportConfigCallback transportConfigCallback)
Set theTransportConfigCallback
.-
Methods inherited from class org.eclipse.jgit.api.GitCommand
call, checkCallable, getRepository, setCallable
-
-
-
-
Field Detail
-
credentialsProvider
protected CredentialsProvider credentialsProvider
Configured credentials provider
-
timeout
protected int timeout
Configured transport timeout
-
transportConfigCallback
protected TransportConfigCallback transportConfigCallback
Configured callback for transport configuration
-
-
Constructor Detail
-
TransportCommand
protected TransportCommand(Repository repo)
Constructor for TransportCommand.
- Parameters:
repo
- aRepository
object.
-
-
Method Detail
-
setCredentialsProvider
public C setCredentialsProvider(CredentialsProvider credentialsProvider)
Set thecredentialsProvider
.- Parameters:
credentialsProvider
- theCredentialsProvider
to use- Returns:
this
-
setTimeout
public C setTimeout(int timeout)
Settimeout
.- Parameters:
timeout
- the timeout (in seconds) used for the transport step- Returns:
this
-
setTransportConfigCallback
public C setTransportConfigCallback(TransportConfigCallback transportConfigCallback)
Set theTransportConfigCallback
.
-
self
protected final C self()
Return this command cast toC
- Returns:
this
cast toC
-
configure
protected C configure(Transport transport)
Configure transport with credentials provider, timeout, and config callback- Parameters:
transport
- aTransport
object.- Returns:
this
-
configure
protected C configure(TransportCommand childCommand)
Configure a child command with the current configuration set inthis
command- Parameters:
childCommand
- aTransportCommand
object.- Returns:
this
-
-