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 Details

    • openSession

      SessionChannelClient openSession() throws IOException
      Opens a session on the managed connection.
      Returns:
      Throws:
      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 IOException
      Opens an SftpClient on the managed connection.
      Returns:
      Throws:
      IOException
    • openChannel

      boolean openChannel(Channel channel) throws IOException
      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

      void addEventHandler(SshEventAdapter eventHandler)
      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

      void allowChannelOpen(String channelType, ChannelFactory cf) throws IOException
      Adds a channel factory to the managed connection.
      Parameters:
      channelType -
      cf -
      Throws:
      IOException
    • getProfile

      Get the current profile attached to the session.
      Returns: