Package org.eclipse.jgit.transport
Interface RemoteSession
-
- All Known Implementing Classes:
JschSession
,SshdSession
public interface RemoteSession
Create a remote "session" for executing remote commands.Clients should subclass RemoteSession to create an alternate way for JGit to execute remote commands. (The client application may already have this functionality available.) Note that this class is just a factory for creating remote processes. If the application already has a persistent connection to the remote machine, RemoteSession may do nothing more than return a new RemoteProcess when exec is called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
disconnect()
Disconnect the remote sessionProcess
exec(String commandName, int timeout)
Generate a new remote process to execute the given command.default FtpChannel
getFtpChannel()
Obtain anFtpChannel
for performing FTP operations over thisRemoteSession
.
-
-
-
Method Detail
-
exec
Process exec(String commandName, int timeout) throws IOException
Generate a new remote process to execute the given command. This function should also start execution and may need to create the streams prior to execution.- Parameters:
commandName
- command to executetimeout
- timeout value, in seconds, for command execution- Returns:
- a new remote process
- Throws:
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).
-
getFtpChannel
default FtpChannel getFtpChannel()
Obtain anFtpChannel
for performing FTP operations over thisRemoteSession
. The default implementation returnsnull
.- Returns:
- the
FtpChannel
- Since:
- 5.2
-
disconnect
void disconnect()
Disconnect the remote session
-
-