com.sshtools.common.ui

Interface SessionManager

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

void
addEventHandler(SshEventAdapter eventHandler)
Add an event handler to the managed connection
void
allowChannelOpen(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 computer
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(String requestname, boolean wantreply, byte[] requestdata)
Send a global request

Method Details

addEventHandler

public void addEventHandler(SshEventAdapter eventHandler)
Add an event handler to the managed connection
Parameters:
eventHandler -

allowChannelOpen

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

applyProfileChanges

public void applyProfileChanges(SshToolsConnectionProfile profile)
The session can call this method to apply any changes to the profile it may have made.
Parameters:
profile -

getForwardingClient

public ForwardingClient getForwardingClient()
Gets the managed connections port forwarding client.
Returns:

getProfile

public SshToolsConnectionProfile getProfile()
Get the current profile attached to the session.
Returns:

getRemoteEOL

public int getRemoteEOL()
Returns the guessed EOL setting of the remote computer
Returns:

getServerId

public String getServerId()
Gets the identification string supplied by the server.
Returns:

isConnected

public boolean isConnected()
Determine if the managed connection is still connected.
Returns:

openChannel

public boolean openChannel(Channel channel)
            throws IOException
Opens a channel on the managed connection.
Parameters:
channel -
Returns:

openSession

public SessionChannelClient openSession()
            throws IOException
Opens a session on the managed connection.
Returns:

openSftpClient

public SftpClient openSftpClient()
            throws IOException
Opens an SftpClient on the managed connection.
Returns:

requestDisconnect

public 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:

sendGlobalRequest

public byte[] sendGlobalRequest(String requestname,
                                boolean wantreply,
                                byte[] requestdata)
            throws IOException
Send a global request
Parameters:
requestname -
wantreply -
requestdata -
Returns:

Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.