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 a `Transport` during execution.

This class provides standard configuration of a transport for options such as a `CredentialsProvider`, a timeout, and a `TransportConfigCallback`.

### Field Summary

Fields
`protected CredentialsProvider` `credentialsProvider` Configured credentials provider
`protected int` `timeout` Configured transport timeout
`protected TransportConfigCallback` `transportConfigCallback` Configured callback for transport configuration

### Fields inherited from class org.eclipse.jgit.api.GitCommand

`repo`

### Constructor Summary

Constructors
`protected` `TransportCommand(Repository repo)`

### Method Summary

Methods
`protected C` `configure(Transport transport)` Configure transport with credentials provider, timeout, and config callback
`protected C` `configure(TransportCommand childCommand)` Configure a child command with the current configuration set in `this` command
`protected C` `self()`
`C` `setCredentialsProvider(CredentialsProvider credentialsProvider)`
`C` `setTimeout(int timeout)`
`C` `setTransportConfigCallback(TransportConfigCallback transportConfigCallback)`

### Methods inherited from class org.eclipse.jgit.api.GitCommand

`call, checkCallable, getRepository, setCallable`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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)

Parameters:
  `repo` -

### Method Detail

#### setCredentialsProvider

    public C setCredentialsProvider(CredentialsProvider credentialsProvider)

Parameters:
  `credentialsProvider` - the `CredentialsProvider` to use
Returns:
  `this`

#### setTimeout

    public C setTimeout(int timeout)

Parameters:
  `timeout` - the timeout used for the transport step
Returns:
  `this`

#### setTransportConfigCallback

    public C setTransportConfigCallback(TransportConfigCallback transportConfigCallback)

Parameters:
  `transportConfigCallback` - if set, the callback will be invoked after the `Transport` has created, but before the `Transport` is used. The callback can use this opportunity to set additional type-specific configuration on the `Transport` instance.
Returns:
  `this`

#### self

    protected final C self()

Returns:
  `this`

#### configure

    protected C configure(Transport transport)

Configure transport with credentials provider, timeout, and config callback

Parameters:
  `transport` -
Returns:
  `this`

#### configure

    protected C configure(TransportCommand childCommand)

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

Parameters:
  `childCommand` -
Returns:
  `this`