public class SshdSession extends Object implements RemoteSession2
RemoteSession based on Apache MINA sshd.| Modifier and Type | Method and Description | 
|---|---|
void | 
addCloseListener(SessionCloseListener listener)
Adds a  
SessionCloseListener to this session. | 
void | 
disconnect()
Disconnects the remote session. 
 | 
Process | 
exec(String commandName,
    int timeout)
Creates a new remote  
Process to execute the given command. | 
Process | 
exec(String commandName,
    Map<String,String> environment,
    int timeout)
Creates a new remote  
Process to execute the given command. | 
FtpChannel | 
getFtpChannel()
Obtain an  
FtpChannel to perform SFTP operations in this
 SshdSession. | 
void | 
removeCloseListener(SessionCloseListener listener)
Removes the given  
listener; has no effect if the listener is not
 currently registered with this session. | 
public void addCloseListener(@NonNull SessionCloseListener listener)
SessionCloseListener to this session. Has no effect if the
 given listener is already registered with this session.listener - to addpublic void removeCloseListener(@NonNull SessionCloseListener listener)
listener; has no effect if the listener is not
 currently registered with this session.listener - to removepublic Process exec(String commandName, int timeout) throws IOException
RemoteSessionProcess to execute the given command. The
 returned process's streams exist and are connected, and execution of the
 process is already started.exec in interface RemoteSessioncommandName - command to executetimeout - timeout value, in seconds, for creating the remote processIOException - 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).public Process exec(String commandName, Map<String,String> environment, int timeout) throws IOException
RemoteSession2Process to execute the given command. The
 returned process's streams exist and are connected, and execution of the
 process is already started.exec in interface RemoteSession2commandName - command to executeenvironment - environment variables to pass ontimeout - timeout value, in seconds, for creating the remote processIOException - 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).@NonNull public FtpChannel getFtpChannel()
FtpChannel to perform SFTP operations in this
 SshdSession.getFtpChannel in interface RemoteSessionFtpChannelpublic void disconnect()
RemoteSessiondisconnect in interface RemoteSessionCopyright © 2021 Eclipse JGit Project. All rights reserved.