RSE
Release 1.0

org.eclipse.rse.connectorservice.dstore
Class DStoreConnectorService

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.dstore.DStoreConnectorService
All Implemented Interfaces:
IConnectorService, org.eclipse.dstore.core.model.IDataStoreProvider, IPropertySetContainer, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer, ISystemUserIdConstants

public class DStoreConnectorService
extends AbstractConnectorService
implements org.eclipse.dstore.core.model.IDataStoreProvider

System class required by the remote systems framework. This represents the live connection at tool runtime.

The universal subsystems are based on datastore technology so we use that to do the connection.


Nested Class Summary
 
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
DStoreConnectorService(String name, String description, IHost host)
          Constructor when we don't have a subsystem yet.
 
Method Summary
protected  org.eclipse.dstore.core.client.ConnectionStatus changePassword(org.eclipse.dstore.core.client.ClientConnection clientConnection, SystemSignonInformation info, IServerLauncherProperties serverLauncherProperties, IProgressMonitor monitor, String newPassword)
          Change the password on a remote system and optionally remain connected to it.
 String getClientIP()
          Return the Client IP that the RSE server is connected to.
 org.eclipse.dstore.core.model.DataStore getDataStore()
           
 String getHomeDirectory()
          Return the home directory of the remote system for the current user, if available.
 boolean getNoLaunchEnabled(SubSystem subsystemImpl)
          Deprecated. Use instead AbstractConnectorService.isEnabledServerLaunchType(ISubSystem, ServerLaunchType) or SubSystemConfiguration.supportsServerLaunchType(ServerLaunchType)
 IServerLauncher getRemoteServerLauncher()
          Return the remote server launcher, which implements IServerLauncher.
 boolean getRexecLaunchEnabled(SubSystem subsystemImpl)
          Deprecated. Use instead AbstractConnectorService.isEnabledServerLaunchType(ISubSystem, ServerLaunchType) or SubSystemConfiguration.supportsServerLaunchType(ServerLaunchType)
 String getServerInstallPath()
          Return the location where the RSE server is installed
 int getServerMinor()
           
 int getServerVersion()
           
protected  int getSocketTimeOutValue()
           
 String getTempDirectory()
          Return the temp directory of the remote system for the current user, if available.
 String getVersionReleaseModification()
          Return the version, release, modification of the remote system
 boolean hasRemoteServerLauncherProperties()
           
protected  void importCertsAndReconnect(org.eclipse.dstore.core.client.ConnectionStatus connectStatus, IProgressMonitor monitor)
           
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 isNetworkError()
          Shortcut to checking if the network is down
protected  boolean isNewPasswordInvalid(String message)
           
protected  boolean isPasswordExpired(String message)
           
protected  boolean isPortOutOfRange(String message)
           
protected  org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection, SystemSignonInformation info, int daemonPort, IProgressMonitor monitor)
           
protected  org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection, SystemSignonInformation info, int daemonPort, IProgressMonitor monitor, int timeout)
           
protected  org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection, SystemSignonInformation info, IServerLauncherProperties launcher, IProgressMonitor monitor)
           
protected  int launchUsingRexec(IProgressMonitor monitor, SystemSignonInformation info, IServerLauncherProperties serverLauncherProperties)
           
protected  boolean promptForTrusting(X509Certificate cert)
           
 boolean runClassInstanceRemotely(org.eclipse.dstore.core.java.IRemoteClassInstance instance)
           
protected  void setPluginPathProperty()
           
protected  boolean setSSLProperties(boolean enable)
           
 void showWarningMsgs(Shell shell, Vector warnings)
          Show any warning messages returned by host api calls.
 boolean supportsPassword()
          Can be used to determine if a password field is present on a login dialog for this connector service.
 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.
 boolean supportsUserId()
          Report if this connector service can use a user identifier.
 
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, getHost, getHostName, getHostType, getLocalUserId, getName, getPasswordInformation, getPasswordPromptDialog, getPasswordValidator, getPort, getPrimarySubSystem, getRemoteServerLauncherProperties, getSignonValidator, getSubSystems, getUserId, getUserIdValidator, hasRemoteSearchLauncherProperties, inheritConnectionUserPassword, intializeSubSystems, isEnabledServerLaunchType, isPasswordCached, isPasswordCached, isSuppressSignonPrompt, isUsingSSL, notifyConnection, notifyDisconnection, notifyError, promptForNewPassword, promptForPassword, registerSubSystem, removeCommunicationsListener, requiresPassword, requiresUserId, reset, setHost, setIsUsingSSL, setPassword, setPassword, setPasswordInformation, setPort, setRemoteServerLauncherProperties, setSuppressSignonPrompt, setUserId, shareUserPasswordWithConnection, 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

DStoreConnectorService

public DStoreConnectorService(String name,
                              String description,
                              IHost host)
Constructor when we don't have a subsystem yet. Call setSubSystem after.

Method Detail

getServerVersion

public int getServerVersion()

getServerMinor

public int getServerMinor()

getVersionReleaseModification

public String getVersionReleaseModification()
Return the version, release, modification of the remote system

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

getHomeDirectory

public String getHomeDirectory()
Return the home directory of the remote system for the current user, if available.

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

runClassInstanceRemotely

public boolean runClassInstanceRemotely(org.eclipse.dstore.core.java.IRemoteClassInstance instance)

getServerInstallPath

public String getServerInstallPath()
Return the location where the RSE server is installed

Returns:
the server install location

getClientIP

public String getClientIP()
Return the Client IP that the RSE server is connected to. When connected, the client IP is obtained from the server-side. When not-connected, the fall back is to get the IP locally (note that the IP obtained locally may be not be what you want when using VPN).

Returns:
the client ip

getTempDirectory

public String getTempDirectory()
Return the temp directory of the remote system for the current user, if available.

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

getSocketTimeOutValue

protected int getSocketTimeOutValue()

internalDisconnect

public void internalDisconnect(IProgressMonitor monitor)
                        throws Exception
Overrides:
internalDisconnect in class AbstractConnectorService
Throws:
Exception
See Also:
IConnectorService.disconnect(IProgressMonitor)

setPluginPathProperty

protected void setPluginPathProperty()

getRexecLaunchEnabled

public boolean getRexecLaunchEnabled(SubSystem subsystemImpl)
Deprecated. Use instead AbstractConnectorService.isEnabledServerLaunchType(ISubSystem, ServerLaunchType) or SubSystemConfiguration.supportsServerLaunchType(ServerLaunchType)

Return if you support remotely launching a server script


getNoLaunchEnabled

public boolean getNoLaunchEnabled(SubSystem subsystemImpl)
Deprecated. Use instead AbstractConnectorService.isEnabledServerLaunchType(ISubSystem, ServerLaunchType) or SubSystemConfiguration.supportsServerLaunchType(ServerLaunchType)

Return if you support connecting to a server already running


getRemoteServerLauncher

public IServerLauncher getRemoteServerLauncher()
Return the remote server launcher, which implements IServerLauncher. This is called by the default implementation of connect, if subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true.

Overrides:
getRemoteServerLauncher in class AbstractConnectorService

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
See Also:
IConnectorService.connect(IProgressMonitor)

isPortOutOfRange

protected boolean isPortOutOfRange(String message)

isPasswordExpired

protected boolean isPasswordExpired(String message)

isNewPasswordInvalid

protected boolean isNewPasswordInvalid(String message)

importCertsAndReconnect

protected void importCertsAndReconnect(org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
                                       IProgressMonitor monitor)
                                throws Exception
Throws:
Exception

launchUsingRexec

protected int launchUsingRexec(IProgressMonitor monitor,
                               SystemSignonInformation info,
                               IServerLauncherProperties serverLauncherProperties)
                        throws Exception
Throws:
Exception

setSSLProperties

protected boolean setSSLProperties(boolean enable)

promptForTrusting

protected boolean promptForTrusting(X509Certificate cert)

launchServer

protected org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection,
                                                                       SystemSignonInformation info,
                                                                       int daemonPort,
                                                                       IProgressMonitor monitor)

launchServer

protected org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection,
                                                                       SystemSignonInformation info,
                                                                       int daemonPort,
                                                                       IProgressMonitor monitor,
                                                                       int timeout)

launchServer

protected org.eclipse.dstore.core.client.ConnectionStatus launchServer(org.eclipse.dstore.core.client.ClientConnection clientConnection,
                                                                       SystemSignonInformation info,
                                                                       IServerLauncherProperties launcher,
                                                                       IProgressMonitor monitor)

changePassword

protected org.eclipse.dstore.core.client.ConnectionStatus changePassword(org.eclipse.dstore.core.client.ClientConnection clientConnection,
                                                                         SystemSignonInformation info,
                                                                         IServerLauncherProperties serverLauncherProperties,
                                                                         IProgressMonitor monitor,
                                                                         String newPassword)
Change the password on a remote system and optionally remain connected to it. Subclasses must implement this method if they wish to

Parameters:
clientConnection - The connection on which the password must be changed
info - The old SystemSignonInformation, including the old password.
serverLauncherProperties - The properties of the server launcher used to connect to the server. Use this object to get the type of serverlauncher, if your implementation varies depending on the type.
monitor - a progress monitor
newPassword - the new password to which the old one will be changed.
Returns:
the status of the password change and optionally the connection. If the new password is rejected by the remote system, return new ConnectionStatus(false, IDataStoreConstants.NEW_PASSWORD_INVALID). If the system is now connected, and the server is ready to be connected, construct a new ConnectionStatus(true) and if using the RSE daemon, set the ticket on it to the ticket number of the server. If you wish to just have the UniversalSystem attempt a reconnect from the beginning after changing the password, return new ConnectionStatus(true, IDataStoreConstants.ATTEMPT_RECONNECT).

isConnected

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

Specified by:
isConnected in interface IConnectorService
See Also:
IConnectorService.isConnected()

isNetworkError

public boolean isNetworkError()
Shortcut to checking if the network is down


showWarningMsgs

public void showWarningMsgs(Shell shell,
                            Vector warnings)
Show any warning messages returned by host api calls.

Parameters:
shell - Parent UI
warnings - Vector of String or toString()'able messages.

getDataStore

public org.eclipse.dstore.core.model.DataStore getDataStore()
Specified by:
getDataStore in interface org.eclipse.dstore.core.model.IDataStoreProvider
Returns:
The DataStore currently being used by this connection.

hasRemoteServerLauncherProperties

public boolean hasRemoteServerLauncherProperties()
Specified by:
hasRemoteServerLauncherProperties in interface IConnectorService
Overrides:
hasRemoteServerLauncherProperties in class AbstractConnectorService
See Also:
AbstractConnectorService.isPasswordCached()

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

supportsPassword

public boolean supportsPassword()
Description copied from interface: IConnectorService
Can be used to determine if a password field is present on a login dialog for this connector service. The default implementation of this interface should return true.

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

supportsUserId

public boolean supportsUserId()
Description copied from interface: IConnectorService
Report if this connector service can use a user identifier. Returns true in default implementation. Typically used to indicate if a login dialog needs to be presented when connecting.

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

RSE
Release 1.0

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