RSE
Release 1.0

org.eclipse.rse.connectorservice.ssh
Class SshConnectorService

java.lang.Object
  extended byorg.eclipse.rse.core.model.PropertySetContainer
      extended byorg.eclipse.rse.core.model.RSEModelObject
          extended byorg.eclipse.rse.core.subsystems.AbstractConnectorService
              extended byorg.eclipse.rse.connectorservice.ssh.SshConnectorService
All Implemented Interfaces:
IConnectorService, IPropertySetContainer, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer, ISshSessionProvider, ISystemUserIdConstants

public class SshConnectorService
extends AbstractConnectorService
implements ISshSessionProvider

Create SSH connections.


Nested Class Summary
static class SshConnectorService.ResponsiveSocketFactory
           
static class SshConnectorService.SessionLostHandler
          Handle session-lost events.
static class SshConnectorService.SimpleSocketFactory
           
 
Nested classes inherited from class org.eclipse.rse.core.subsystems.AbstractConnectorService
AbstractConnectorService.NewPasswordInfo
 
Field Summary
 
Fields inherited from class org.eclipse.rse.core.subsystems.AbstractConnectorService
_remoteServerLauncherProperties, connectResult, launchResult, shell
 
Fields inherited from class org.eclipse.rse.core.model.RSEModelObject
_isDirty, _wasRestored
 
Fields inherited from interface org.eclipse.rse.core.ISystemUserIdConstants
USERID_LOCATION_CONNECTION, USERID_LOCATION_DEFAULT_OVERALL, USERID_LOCATION_DEFAULT_SYSTEMTYPE, USERID_LOCATION_NOTSET, USERID_LOCATION_SUBSYSTEM
 
Constructor Summary
SshConnectorService(IHost host)
           
 
Method Summary
static void checkCanceled(IProgressMonitor monitor)
          Progress Monitor Helper: from team.cvs.core.Policy
static Socket createSocket(String host, int port, int timeout, IProgressMonitor monitor)
          Helper method that will time out when making a socket connection.
 com.jcraft.jsch.Session getSession()
           
protected static Display getStandardDisplay()
           
 void handleSessionLost()
          Notification from sub-services that our session was lost.
 boolean hasRemoteServerLauncherProperties()
           
protected  void internalConnect(IProgressMonitor monitor)
          You must override unless subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true.
 void internalDisconnect(IProgressMonitor monitor)
           
 boolean isConnected()
          Return true if currently connected.
 boolean requiresPassword()
          If a password is supported this is used to determine if the password is required.
 boolean supportsRemoteServerLaunching()
           
 boolean supportsServerLaunchProperties()
          Tell us if this subsystem factory supports server launch properties, which allow the user to configure how the server-side code for these subsystems are started.
 
Methods inherited from class org.eclipse.rse.core.subsystems.AbstractConnectorService
addCommunicationsListener, clearCommunicationListeners, clearPasswordCache, clearPasswordCache, clearPasswordForOtherSystemsInConnection, clearUserIdCache, commit, connect, deregisterSubSystem, disconnect, fireCommunicationsEvent, forcePasswordToUpperCase, getCommunicationListenerCount, getConnectPort, getDescription, getHomeDirectory, getHost, getHostName, getHostType, getLocalUserId, getName, getPasswordInformation, getPasswordPromptDialog, getPasswordValidator, getPort, getPrimarySubSystem, getRemoteServerLauncher, getRemoteServerLauncherProperties, getSignonValidator, getSubSystems, getTempDirectory, getUserId, getUserIdValidator, getVersionReleaseModification, hasRemoteSearchLauncherProperties, inheritConnectionUserPassword, intializeSubSystems, isEnabledServerLaunchType, isPasswordCached, isPasswordCached, isSuppressSignonPrompt, isUsingSSL, notifyConnection, notifyDisconnection, notifyError, promptForNewPassword, promptForPassword, registerSubSystem, removeCommunicationsListener, requiresUserId, reset, setHost, setIsUsingSSL, setPassword, setPassword, setPasswordInformation, setPort, setRemoteServerLauncherProperties, setSuppressSignonPrompt, setUserId, shareUserPasswordWithConnection, supportsPassword, supportsUserId, unintializeSubSystems, updatePasswordForOtherSystemsInConnection
 
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject
compareStrings, isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
isDirty, setDirty, setWasRestored, wasRestored
 

Constructor Detail

SshConnectorService

public SshConnectorService(IHost host)
Method Detail

checkCanceled

public static void checkCanceled(IProgressMonitor monitor)
Progress Monitor Helper: from team.cvs.core.Policy

Parameters:
monitor -

createSocket

public static Socket createSocket(String host,
                                  int port,
                                  int timeout,
                                  IProgressMonitor monitor)
                           throws UnknownHostException,
                                  IOException
Helper method that will time out when making a socket connection. This is required because there is no way to provide a timeout value when creating a socket and in some instances, they don't seem to timeout at all.

Parameters:
host - inetaddress to connect to
port - port to connect to
timeout - number of seconds for timeout (default=60)
monitor - progress monitor
Throws:
UnknownHostException
IOException

internalConnect

protected void internalConnect(IProgressMonitor monitor)
                        throws Exception
Description copied from class: AbstractConnectorService
You must override unless subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true.

Attempt to connect to the remote system.
If the subsystem supports server launch, the default behavior is to get the remote server launcher by AbstractConnectorService.getRemoteServerLauncher(), and if IServerLauncher.isLaunched() returns false, to call IServerLauncher.launch(IProgressMonitor).

This is called, by default, from the connect(...) methods of the subsystem.

Overrides:
internalConnect in class AbstractConnectorService
Throws:
Exception

internalDisconnect

public void internalDisconnect(IProgressMonitor monitor)
                        throws Exception
Overrides:
internalDisconnect in class AbstractConnectorService
Throws:
Exception

getSession

public com.jcraft.jsch.Session getSession()
Specified by:
getSession in interface ISshSessionProvider

handleSessionLost

public void handleSessionLost()
Notification from sub-services that our session was lost. Notify all subsystems properly. TODO allow user to try and reconnect?

Specified by:
handleSessionLost in interface ISshSessionProvider

getStandardDisplay

protected static Display getStandardDisplay()

isConnected

public boolean isConnected()
Description copied from interface: IConnectorService
Return true if currently connected.

Specified by:
isConnected in interface IConnectorService

hasRemoteServerLauncherProperties

public boolean hasRemoteServerLauncherProperties()
Specified by:
hasRemoteServerLauncherProperties in interface IConnectorService
Overrides:
hasRemoteServerLauncherProperties in class AbstractConnectorService

supportsRemoteServerLaunching

public boolean supportsRemoteServerLaunching()
Specified by:
supportsRemoteServerLaunching in interface IConnectorService
Overrides:
supportsRemoteServerLaunching in class AbstractConnectorService

supportsServerLaunchProperties

public boolean supportsServerLaunchProperties()
Description copied from interface: IConnectorService
Tell us if this subsystem factory supports server launch properties, which allow the user to configure how the server-side code for these subsystems are started. There is a Server Launch Setting property page, with a pluggable composite, where users can configure these properties.

Specified by:
supportsServerLaunchProperties in interface IConnectorService
Overrides:
supportsServerLaunchProperties in class AbstractConnectorService

requiresPassword

public boolean requiresPassword()
Description copied from interface: IConnectorService
If a password is supported this is used to determine if the password is required. Must be ignored if supportsPassword() returns false. The default implementation of this interface should return true.

Specified by:
requiresPassword in interface IConnectorService
Overrides:
requiresPassword in class AbstractConnectorService
Returns:
false
See Also:
AbstractConnectorService.requiresPassword()

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.