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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEventHandler(SshEventAdapter eventHandler)
Add an event handler to the managed connectionvoid
allowChannelOpen(java.lang.String channelType, ChannelFactory cf)
Adds a channel factory to the managed connection.void
applyProfileChanges(SshToolsConnectionProfile profile)
The session can call this method to apply any changes to the profile it may have made.ForwardingClient
getForwardingClient()
Gets the managed connections port forwarding client.SshToolsConnectionProfile
getProfile()
Get the current profile attached to the session.int
getRemoteEOL()
Returns the guessed EOL setting of the remote computerjava.lang.String
getServerId()
Gets the identification string supplied by the server.boolean
isConnected()
Determine if the managed connection is still connected.boolean
openChannel(Channel channel)
Opens a channel on the managed connection.SessionChannelClient
openSession()
Opens a session on the managed connection.SftpClient
openSftpClient()
Opens an SftpClient on the managed connection.boolean
requestDisconnect()
Called when a session wants to disconnect the connection.byte[]
sendGlobalRequest(java.lang.String requestname, boolean wantreply, byte[] requestdata)
Send a global request
-
-
-
Method Detail
-
openSession
SessionChannelClient openSession() throws java.io.IOException
Opens a session on the managed connection.- Returns:
- Throws:
java.io.IOException
-
applyProfileChanges
void applyProfileChanges(SshToolsConnectionProfile profile)
The session can call this method to apply any changes to the profile it may have made.- Parameters:
profile
-
-
openSftpClient
SftpClient openSftpClient() throws java.io.IOException
Opens an SftpClient on the managed connection.- Returns:
- Throws:
java.io.IOException
-
openChannel
boolean openChannel(Channel channel) throws java.io.IOException
Opens a channel on the managed connection.- Parameters:
channel
-- Returns:
- Throws:
java.io.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(java.lang.String requestname, boolean wantreply, byte[] requestdata) throws java.io.IOException
Send a global request- Parameters:
requestname
-wantreply
-requestdata
-- Returns:
- Throws:
java.io.IOException
-
addEventHandler
void addEventHandler(SshEventAdapter eventHandler)
Add an event handler to the managed connection- Parameters:
eventHandler
-
-
getServerId
java.lang.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
void allowChannelOpen(java.lang.String channelType, ChannelFactory cf) throws java.io.IOException
Adds a channel factory to the managed connection.- Parameters:
channelType
-cf
-- Throws:
java.io.IOException
-
getProfile
SshToolsConnectionProfile getProfile()
Get the current profile attached to the session.- Returns:
-
-