aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteSession2.java
blob: 23f670ae2516974995e898a744993c2b399f3020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Copyright (C) 2020, Thomas Wolf <thomas.wolf@paranor.ch> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.transport;

import java.io.IOException;
import java.util.Map;

/**
 * A {@link RemoteSession} that supports passing environment variables to
 * commands.
 *
 * @since 5.11
 */
public interface RemoteSession2 extends RemoteSession {

	/**
	 * Creates a new remote {@link Process} to execute the given command. The
	 * returned process's streams exist and are connected, and execution of the
	 * process is already started.
	 *
	 * @param commandName
	 *            command to execute
	 * @param environment
	 *            environment variables to pass on
	 * @param timeout
	 *            timeout value, in seconds, for creating the remote process
	 * @return a new remote process, already started
	 * @throws java.io.IOException
	 *             may be thrown in several cases. For example, on problems
	 *             opening input or output streams or on problems connecting or
	 *             communicating with the remote host. For the latter two cases,
	 *             a TransportException may be thrown (a subclass of
	 *             java.io.IOException).
	 */
	Process exec(String commandName, Map<String, String> environment,
			int timeout) throws IOException;
}