From 80c67c5af6307fa4e2c1e4313ce8c7fe01b2420c Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Fri, 3 Aug 2007 10:37:46 +0000 Subject: [PATCH] [198790] make SSH createSession() protected --- .../connectorservice/ssh/SshConnectorService.java | 13 ++++++++++++- .../META-INF/MANIFEST.MF | 2 +- .../tm/internal/terminal/ssh/SshConnection.java | 10 +++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java index eb3729bca0c..b05dedaf79d 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java @@ -12,6 +12,7 @@ * - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM) * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186761] make the port setting configurable + * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.ssh; @@ -70,7 +71,14 @@ public class SshConnectorService extends StandardConnectorService implements ISs // //---------------------------------------------------------------------- - private static Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException { + /** + * Create a Jsch session. + * Subclasses can override in order to replace the UserInfo wrapper + * (for non-interactive usage, for instance), or in order to change + * the Jsch config (for instance, in order to switch off strict + * host key checking or in order to add specific ciphers). + */ + protected Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException { IJSchService service = Activator.getDefault().getJSchService(); if (service == null) return null; @@ -102,6 +110,9 @@ public class SshConnectorService extends StandardConnectorService implements ISs protected void internalConnect(IProgressMonitor monitor) throws Exception { + // Fire comm event to signal state about to change + fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT); + String host = getHostName(); String user = getUserId(); String password=""; //$NON-NLS-1$ diff --git a/terminal/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF b/terminal/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF index 8b8aba3d678..dfbba0111b1 100644 --- a/terminal/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF +++ b/terminal/org.eclipse.tm.terminal.ssh/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, diff --git a/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java b/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java index dd339a68dec..9c31af994b4 100644 --- a/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java +++ b/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java @@ -10,6 +10,7 @@ * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API * - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM) + * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected *******************************************************************************/ package org.eclipse.tm.internal.terminal.ssh; @@ -50,7 +51,14 @@ class SshConnection extends Thread { // //---------------------------------------------------------------------- - private static Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException { + /** + * Create a Jsch session. + * Subclasses can override in order to replace the UserInfo wrapper + * (for non-interactive usage, for instance), or in order to change + * the Jsch config (for instance, in order to switch off strict + * host key checking or in order to add specific ciphers). + */ + protected Session createSession(String username, String password, String hostname, int port, UserInfo wrapperUI, IProgressMonitor monitor) throws JSchException { IJSchService service = Activator.getDefault().getJSchService(); if (service == null) return null;