1 /*
2 * Copyright (C) 2011, Roberto Tyley <roberto.tyley@gmail.com> and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.api;
12
13 import org.eclipse.jgit.transport.Transport;
14
15 /**
16 * Receives a callback allowing type-specific configuration to be set
17 * on the Transport instance after it's been created.
18 * <p>
19 * This allows consumers of the JGit command API to perform custom
20 * configuration that would be difficult anticipate and expose on the
21 * API command builders.
22 * <p>
23 * For instance, if a client needs to replace the SshSessionFactorys
24 * on any SSHTransport used (eg to control available SSH identities),
25 * they can set the TransportConfigCallback on the JGit API command -
26 * once the transport has been created by the command, the callback
27 * will be invoked and passed the transport instance, which the
28 * client can then inspect and configure as necessary.
29 */
30 public interface TransportConfigCallback {
31
32 /**
33 * Add any additional transport-specific configuration required.
34 *
35 * @param transport
36 * a {@link org.eclipse.jgit.transport.Transport} object.
37 */
38 void configure(Transport transport);
39 }