Top Description Fields Constructors Methods
org.eclipse.jgit.api

public abstract Class TransportCommand<C extends GitCommand<T>, T>

extends GitCommand<T>
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.api.CloneCommand, org.eclipse.jgit.api.FetchCommand, org.eclipse.jgit.api.LsRemoteCommand, org.eclipse.jgit.api.PullCommand, org.eclipse.jgit.api.PushCommand, org.eclipse.jgit.api.SubmoduleAddCommand, org.eclipse.jgit.api.SubmoduleUpdateCommand
Type Parameters
<C>
concrete type of this GitCommand
<T>
the return type of the GitCommand's call() method
Imports
org.eclipse.jgit.lib.Repository, org.eclipse.jgit.transport.CredentialsProvider, .Transport

Base class for commands that use a org.eclipse.jgit.transport.Transport during execution.

This class provides standard configuration of a transport for options such as a org.eclipse.jgit.transport.CredentialsProvider, a timeout, and a org.eclipse.jgit.api.TransportConfigCallback.

Field Summary

Modifier and TypeField and Description
protected CredentialsProvider
credentialsProvider

Configured credentials provider

protected int
timeout

Configured transport timeout

protected TransportConfigCallback
transportConfigCallback

Configured callback for transport configuration

Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
protected
TransportCommand(Repository repo)

Constructor for TransportCommand.

Method Summary

Modifier and TypeMethod and Description
protected C

Returns:

this
configure
(Transport transport)

Configure transport with credentials provider, timeout, and config callback

protected C

Returns:

this
configure
(TransportCommand<C extends GitCommand<T>, T> childCommand)

Configure a child command with the current configuration set in this command

protected final C

Returns:

this cast to C
self
()

Return this command cast to C

public C

Returns:

this
setCredentialsProvider
(final CredentialsProvider credentialsProvider)

Set the credentialsProvider.

public C

Returns:

this
setTimeout
(int
the timeout (in seconds) used for the transport step
timeout
)

Set timeout.

public C

Returns:

this
setTransportConfigCallback
(final TransportConfigCallback
if set, the callback will be invoked after the org.eclipse.jgit.transport.Transport has created, but before the org.eclipse.jgit.transport.Transport is used. The callback can use this opportunity to set additional type-specific configuration on the org.eclipse.jgit.transport.Transport instance.
transportConfigCallback
)

Set the TransportConfigCallback.

Inherited from org.eclipse.jgit.api.GitCommand:
callcheckCallablegetRepositorysetCallable

Field Detail

credentialsProviderback to summary
protected CredentialsProvider credentialsProvider

Configured credentials provider

timeoutback to summary
protected int timeout

Configured transport timeout

transportConfigCallbackback to summary
protected TransportConfigCallback transportConfigCallback

Configured callback for transport configuration

Constructor Detail

TransportCommandback to summary
protected TransportCommand(Repository repo)

Constructor for TransportCommand.

Parameters
repo:Repository

a org.eclipse.jgit.lib.Repository object.

Method Detail

configureback to summary
protected C configure(Transport transport)

Configure transport with credentials provider, timeout, and config callback

Parameters
transport:Transport

a org.eclipse.jgit.transport.Transport object.

Returns:C

this

configureback to summary
protected C configure(TransportCommand<C extends GitCommand<T>, T> childCommand)

Configure a child command with the current configuration set in this command

Parameters
childCommand:TransportCommand<C extends GitCommand<T>, T>

a org.eclipse.jgit.api.TransportCommand object.

Returns:C

this

selfback to summary
protected final C self()

Return this command cast to C

Returns:C

this cast to C

Annotations
@SuppressWarnings:unchecked
setCredentialsProviderback to summary
public C setCredentialsProvider(final CredentialsProvider credentialsProvider)

Set the credentialsProvider.

Parameters
credentialsProvider:CredentialsProvider

the org.eclipse.jgit.transport.CredentialsProvider to use

Returns:C

this

setTimeoutback to summary
public C setTimeout(int timeout)

Set timeout.

Parameters
timeout:int

the timeout (in seconds) used for the transport step

Returns:C

this

setTransportConfigCallbackback to summary
public C setTransportConfigCallback(final TransportConfigCallback transportConfigCallback)

Set the TransportConfigCallback.

Parameters
transportConfigCallback:TransportConfigCallback

if set, the callback will be invoked after the org.eclipse.jgit.transport.Transport has created, but before the org.eclipse.jgit.transport.Transport is used. The callback can use this opportunity to set additional type-specific configuration on the org.eclipse.jgit.transport.Transport instance.

Returns:C

this