Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
JInternalFrame
com.sshtools.common.ui.SshToolsApplicationInternalFrame
com.sshtools.common.ui.SessionProviderInternalFrame
public class SessionProviderInternalFrame
extends SshToolsApplicationInternalFrame
implements SessionManager
// Create an SshClient connection SshClient ssh = new SshClient(); // Connection code goes here - see SshClient for more details SessionProviderFrame frame = new SessionProviderFrame(null, new SshToolsConnectionProfile(), ssh, SessionProviderFactory.getInstance().getProvider("sshterm")); frame.pack(); frame.show();
Field Summary |
Fields inherited from class com.sshtools.common.ui.SshToolsApplicationInternalFrame | |
PREF_LAST_FRAME_GEOMETRY , aboutAction , exitAction , log , newWindowAction , toolSeparator |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
boolean |
|
void |
|
ForwardingClient |
|
SshToolsConnectionProfile |
|
int |
|
String |
|
SshToolsApplicationSessionPanel |
|
boolean |
|
boolean |
|
boolean |
|
SessionChannelClient |
|
SftpClient |
|
boolean |
|
byte[] |
|
void |
|
Methods inherited from class com.sshtools.common.ui.SshToolsApplicationInternalFrame | |
closeContainer , getApplication , getApplicationPanel , init , isContainerVisible , setContainerTitle , setContainerVisible , showAboutBox , showExitAction , showNewWindowAction |
public SessionProviderInternalFrame(SshToolsConnectionProfile profile, SshClient ssh, SessionProvider provider) throws IOException, SshToolsApplicationException
Construct a new Session Provider frame.
- Parameters:
profile
- The profile of the connectionssh
- the client connectionprovider
- the provider instance
- Throws:
SshToolsApplicationException
-
public void addEventHandler(SshEventAdapter eventHandler)
Implementation of the SessionManager method, simply calls the SshClient method addEventHandler.
- Specified by:
- addEventHandler in interface SessionManager
- Parameters:
eventHandler
-
public void allowChannelOpen(String channelType, ChannelFactory cf) throws IOException
Implemenation of the SessionManager method, simply calls the SshClient method allowChannelOpen.
- Specified by:
- allowChannelOpen in interface SessionManager
- Parameters:
channelType
-cf
-
public void applyProfileChanges(SshToolsConnectionProfile profile)
Implementation of the SessionManager method, this does nothing. Overide this method to provide additional functionality to save changes made by the session to the profile.
- Specified by:
- applyProfileChanges in interface SessionManager
- Parameters:
profile
-
public boolean canExit()
Called by the application framework when testing exit state
- Returns:
public void exit()
Called by the framework when exiting. Can also be called to close the session.
public ForwardingClient getForwardingClient()
Implementation of the SessionManager method, simply calls the SshClient method getForwardingClient.
- Specified by:
- getForwardingClient in interface SessionManager
- Returns:
public SshToolsConnectionProfile getProfile()
Gets the profile currently attached to the frame.
- Specified by:
- getProfile in interface SessionManager
- Returns:
public int getRemoteEOL()
Returns the guessed EOL setting of the remote computer
- Specified by:
- getRemoteEOL in interface SessionManager
- Returns:
public String getServerId()
Implemenation of the SessionManager method, simply calls the SshClient method getServerId.
- Specified by:
- getServerId in interface SessionManager
- Returns:
public SshToolsApplicationSessionPanel getSessionPanel()
Get the attached session provider panel.
- Returns:
public boolean initFrame(SshToolsApplication app) throws IOException, SshToolsApplicationException
Initialize the frame and open the remote session
- Parameters:
app
- the application object, can be null
- Returns:
- Throws:
SshToolsApplicationException
-
public boolean isConnected()
Implementation of the SessionManager method, this simply calls the SshClient method isConnected.
- Specified by:
- isConnected in interface SessionManager
- Returns:
public boolean openChannel(Channel channel) throws IOException
Implementation of the SessionManager method, this simply calls the SshClient method openChannel.
- Specified by:
- openChannel in interface SessionManager
- Parameters:
channel
-
- Returns:
public SessionChannelClient openSession() throws IOException
Implementation of the SessionManager method, simply calls the SshClient openSession method.
- Specified by:
- openSession in interface SessionManager
- Returns:
public SftpClient openSftpClient() throws IOException
Implementation of the SessionManager method, this simply calls the SshClient method openSftpClient.
- Specified by:
- openSftpClient in interface SessionManager
- Returns:
public boolean requestDisconnect()
Implementation of the SessionManager method, this simply returns false. Overide to change this behaviour
- Specified by:
- requestDisconnect in interface SessionManager
- Returns:
public byte[] sendGlobalRequest(String requestname, boolean wantreply, byte[] requestdata) throws IOException
Implementation of the SessionManager method, simply calls the SshClient method sendGlobalRequest.
- Specified by:
- sendGlobalRequest in interface SessionManager
- Parameters:
requestname
-wantreply
-requestdata
-
- Returns:
public void setDisconnectOnClose(boolean disconnectOnClose)
When the session closes, should the connection be disconnected?
- Parameters:
disconnectOnClose
-