Package com.sshtools.common.ui
Interface SessionManager
- All Known Implementing Classes:
SessionProviderFrame
,SessionProviderInternalFrame
public interface SessionManager
This interface is used by the Session Provider framework to abstract
the SshClient connection away from the session provider. This restricts
the session to performing operations that are allowed by the controlling
application. For instance, the provider cannot simply diconnect the
connection, since the SshClient's disconnect method is not exposed, instead
a requestDisconnect
method is provided allowing the controlling
application to simply ignore a disconnect since it may have other sessions
open.
Most of the methods of this interface will simply be required to call the identical method on SshClient.
- Version:
- $Revision: 1.11 $
- Author:
- Lee David Painter
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventHandler
(SshEventAdapter eventHandler) Add an event handler to the managed connectionvoid
allowChannelOpen
(String channelType, ChannelFactory cf) Adds a channel factory to the managed connection.void
The session can call this method to apply any changes to the profile it may have made.Gets the managed connections port forwarding client.Get the current profile attached to the session.int
Returns the guessed EOL setting of the remote computerGets the identification string supplied by the server.boolean
Determine if the managed connection is still connected.boolean
openChannel
(Channel channel) Opens a channel on the managed connection.Opens a session on the managed connection.Opens an SftpClient on the managed connection.boolean
Called when a session wants to disconnect the connection.byte[]
sendGlobalRequest
(String requestname, boolean wantreply, byte[] requestdata) Send a global request
-
Method Details
-
openSession
Opens a session on the managed connection.- Returns:
- Throws:
IOException
-
applyProfileChanges
The session can call this method to apply any changes to the profile it may have made.- Parameters:
profile
-
-
openSftpClient
Opens an SftpClient on the managed connection.- Returns:
- Throws:
IOException
-
openChannel
Opens a channel on the managed connection.- Parameters:
channel
-- Returns:
- Throws:
IOException
-
isConnected
boolean isConnected()Determine if the managed connection is still connected.- Returns:
-
requestDisconnect
boolean requestDisconnect()Called when a session wants to disconnect the connection. The manager implementation should ideally not diconnect unless no other sessions are open.- Returns:
-
getForwardingClient
ForwardingClient getForwardingClient()Gets the managed connections port forwarding client.- Returns:
-
sendGlobalRequest
byte[] sendGlobalRequest(String requestname, boolean wantreply, byte[] requestdata) throws IOException Send a global request- Parameters:
requestname
-wantreply
-requestdata
-- Returns:
- Throws:
IOException
-
addEventHandler
Add an event handler to the managed connection- Parameters:
eventHandler
-
-
getServerId
String getServerId()Gets the identification string supplied by the server.- Returns:
-
getRemoteEOL
int getRemoteEOL()Returns the guessed EOL setting of the remote computer- Returns:
-
allowChannelOpen
Adds a channel factory to the managed connection.- Parameters:
channelType
-cf
-- Throws:
IOException
-
getProfile
SshToolsConnectionProfile getProfile()Get the current profile attached to the session.- Returns:
-