|
|
|
|
org.eclipse.rse.connectorservice.dstore
Class DStoreConnectorService
java.lang.Object
org.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.AbstractConnectorService
org.eclipse.rse.core.subsystems.AuthenticatingConnectorService
org.eclipse.rse.ui.subsystems.StandardConnectorService
org.eclipse.rse.connectorservice.dstore.DStoreConnectorService
-
All Implemented Interfaces:
- org.eclipse.dstore.core.model.IDataStoreProvider,
IPropertySetContainer,
IRSEModelObject,
IRSEPersistableContainer,
IConnectorService
-
public class DStoreConnectorService
- extends
StandardConnectorService
- 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.
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. |
protected org.eclipse.rse.connectorservice.dstore.DStoreConnectorService.ConnectionStatusPair
|
connectWithDaemon
(
SystemSignonInformation info,
IRemoteServerLauncher serverLauncher,
Boolean alertedNONSSL,
IProgressMonitor monitor)
Connection to a server via the RSE daemon. |
protected org.eclipse.dstore.core.client.ConnectionStatus
|
connectWithOther
(org.eclipse.dstore.core.client.ClientConnection clientConnection,
SystemSignonInformation info,
IServerLauncherProperties serverLauncher,
IProgressMonitor monitor)
Connect via an overridden launchServer method |
protected org.eclipse.dstore.core.client.ConnectionStatus
|
connectWithREXEC
(
SystemSignonInformation info,
IRemoteServerLauncher serverLauncher,
IProgressMonitor monitor)
Connect to the server by using REXEC as a daemon to launch it. |
protected org.eclipse.dstore.core.client.ConnectionStatus
|
connectWithRunning
(
IProgressMonitor monitor)
Connect to a running server. |
protected
SystemMessage
|
createSystemMessage
(
String msgId,
int severity,
String msg)
|
protected
SystemMessage
|
createSystemMessage
(
String msgId,
int severity,
String msg,
String msgDetails)
|
protected
SystemMessage
|
createSystemMessage
(
String msgId,
int severity,
String msg,
Throwable e)
|
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.isServerLaunchTypeEnabled(ISubSystem, ServerLaunchType)
or
SubSystemConfiguration.supportsServerLaunchType(ServerLaunchType)
|
IServerLauncher
|
getRemoteServerLauncher
()
Return the remote server launcher, which implements IServerLauncher. |
IServerLauncherProperties
|
getRemoteServerLauncherProperties
()
Gets the properties associated with a remote server launcher. |
boolean
|
getRexecLaunchEnabled
(
SubSystem subsystemImpl)
Deprecated. Use instead
AbstractConnectorService.isServerLaunchTypeEnabled(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 |
protected void
|
handleConnectionFailure
(org.eclipse.dstore.core.client.ConnectionStatus launchStatus,
org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
IRemoteServerLauncher serverLauncher,
ServerLaunchType serverLauncherType,
IProgressMonitor monitor)
Diagnostics the occurs after the failure of a connect. |
protected void
|
importCertsAndReconnect
(org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
IProgressMonitor monitor)
|
protected void
|
initializeConnection
(org.eclipse.dstore.core.client.ConnectionStatus launchStatus,
org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
Boolean alertedNONSSL,
IProgressMonitor monitor)
Initialize the DataStore connection. |
protected void
|
internalConnect
(
IProgressMonitor monitor)
Performs the actual connection to the target system. |
protected void
|
internalDisconnect
(
IProgressMonitor monitor)
Performs the actual disconnection from the target system. |
boolean
|
isConnected
()
|
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
(
SystemSignonInformation info,
IServerLauncherProperties serverLauncherProperties,
IProgressMonitor monitor)
|
protected boolean
|
promptForTrusting
(
X509Certificate cert)
|
boolean
|
runClassInstanceRemotely
(org.eclipse.dstore.core.java.IRemoteClassInstance instance)
|
protected void
|
setPluginPathProperty
()
|
void
|
setRemoteServerLauncherProperties
(
IServerLauncherProperties newRemoteServerLauncher)
Do nothing, may be overridden |
protected boolean
|
setSSLProperties
(boolean enable)
|
boolean
|
supportsPassword
()
Determines if this connector service understand the concept of a password. |
boolean
|
supportsRemoteServerLaunching
()
|
boolean
|
supportsServerLaunchProperties
()
|
boolean
|
supportsUserId
()
Reports if this connector service can use a user identifier. |
Methods inherited from class org.eclipse.rse.core.subsystems.
AuthenticatingConnectorService
|
acquireCredentials,
clearCredentials,
clearPassword,
getCredentialsProvider,
getUserId,
hasPassword,
inheritsCredentials,
isSuppressed,
postDisconnect,
removePassword,
removeUserId,
savePassword,
saveUserId,
setCredentialsProvider,
setPassword,
setSuppressed,
setUserId,
sharesCredentials
|
Methods inherited from class org.eclipse.rse.core.subsystems.
AbstractConnectorService
|
addCommunicationsListener,
commit,
connect,
deregisterSubSystem,
disconnect,
fireCommunicationsEvent,
getConnectPort,
getDenyPasswordSave,
getDescription,
getHost,
getHostName,
getName,
getPersistableChildren,
getPersistableParent,
getPort,
getPrimarySubSystem,
getSubSystems,
hasActiveCommunicationListeners,
hasRemoteServerLauncherProperties,
initializeSubSystems,
isServerLaunchTypeEnabled,
isUsingSSL,
notifyConnection,
notifyDisconnection,
notifyError,
postConnect,
preConnect,
preDisconnect,
registerSubSystem,
removeCommunicationsListener,
reset,
setDenyPasswordSave,
setHost,
setIsUsingSSL,
setPort,
uninitializeSubSystems
|
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
DStoreConnectorService
public DStoreConnectorService(
String name,
String description,
IHost host)
- Constructor when we don't have a subsystem yet.
Call setSubSystem after.
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
-
-
Returns:
- the version, release, modification of the remote system,
if connected, if applicable, and if available. Return null if
this information is not available.
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
-
-
Returns:
- an empty string
-
See Also:
-
IConnectorService.getHomeDirectory()
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
-
-
Returns:
- an empty string
-
See Also:
-
IConnectorService.getTempDirectory()
getSocketTimeOutValue
protected int getSocketTimeOutValue()
-
-
internalDisconnect
protected void internalDisconnect(
IProgressMonitor monitor)
throws
Exception
-
Description copied from class:
AbstractConnectorService
- Performs the actual disconnection from the target system.
-
-
Specified by:
-
internalDisconnect
in class
AbstractConnectorService
-
-
Parameters:
-
monitor - for cancellation and progress reporting
-
Throws:
-
Exception
- if disconnection does not succeed -
See Also:
-
IConnectorService.disconnect(IProgressMonitor)
setPluginPathProperty
protected void setPluginPathProperty()
-
-
getRexecLaunchEnabled
public boolean getRexecLaunchEnabled(
SubSystem subsystemImpl)
-
Deprecated. Use instead
AbstractConnectorService.isServerLaunchTypeEnabled(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.isServerLaunchTypeEnabled(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.
-
-
Specified by:
-
getRemoteServerLauncher
in interface
IConnectorService
-
Overrides:
-
getRemoteServerLauncher
in class
AbstractConnectorService
-
-
Returns:
- null, may be overriden
-
See Also:
-
IConnectorService.getRemoteServerLauncher()
getRemoteServerLauncherProperties
public
IServerLauncherProperties getRemoteServerLauncherProperties()
-
Description copied from interface:
IConnectorService
- Gets the properties associated with a remote server launcher.
These may be null.
This an optional object containing
properties used to launch the remote server that
communicates with this client.
-
-
Specified by:
-
getRemoteServerLauncherProperties
in interface
IConnectorService
-
Overrides:
-
getRemoteServerLauncherProperties
in class
AbstractConnectorService
-
-
Returns:
- null, may be overridden
-
See Also:
-
IConnectorService.getRemoteServerLauncherProperties()
setRemoteServerLauncherProperties
public void setRemoteServerLauncherProperties(
IServerLauncherProperties newRemoteServerLauncher)
-
Description copied from class:
AbstractConnectorService
- Do nothing, may be overridden
-
-
Specified by:
-
setRemoteServerLauncherProperties
in interface
IConnectorService
-
Overrides:
-
setRemoteServerLauncherProperties
in class
AbstractConnectorService
-
-
Parameters:
-
newRemoteServerLauncher - the server launcher properties -
See Also:
-
IConnectorService.setRemoteServerLauncherProperties(IServerLauncherProperties)
connectWithREXEC
protected org.eclipse.dstore.core.client.ConnectionStatus connectWithREXEC(
SystemSignonInformation info,
IRemoteServerLauncher serverLauncher,
IProgressMonitor monitor)
throws
Exception
- Connect to the server by using REXEC as a daemon to launch it.
-
-
-
Parameters:
-
info - the signon information -
serverLauncher - the server launcher -
monitor - the progress monitor
-
Returns:
- the connection status
-
Throws:
-
Exception
-
Since:
- 3.1
connectWithDaemon
protected org.eclipse.rse.connectorservice.dstore.DStoreConnectorService.ConnectionStatusPair connectWithDaemon(
SystemSignonInformation info,
IRemoteServerLauncher serverLauncher,
Boolean alertedNONSSL,
IProgressMonitor monitor)
throws
InterruptedException
- Connection to a server via the RSE daemon.
-
-
-
Parameters:
-
info - the signon information -
serverLauncher - the server launcher -
alertedNONSSL - indication of whether an alert for NON-ssl has already been issued -
monitor - the progress monitor
-
Returns:
- a pair of connection statuses - the launch status for the daemon and the connect status for the server
-
Throws:
-
InterruptedException
-
Since:
- 3.1
connectWithRunning
protected org.eclipse.dstore.core.client.ConnectionStatus connectWithRunning(
IProgressMonitor monitor)
- Connect to a running server.
-
-
-
Parameters:
-
monitor - the progress monitor
-
Returns:
- the connection status
-
Since:
- 3.1
connectWithOther
protected org.eclipse.dstore.core.client.ConnectionStatus connectWithOther(org.eclipse.dstore.core.client.ClientConnection clientConnection,
SystemSignonInformation info,
IServerLauncherProperties serverLauncher,
IProgressMonitor monitor)
throws
Exception
- Connect via an overridden launchServer method
-
-
-
Parameters:
-
clientConnection - the clientConnection -
info - the signon info -
serverLauncher - the server launcher -
monitor - the progress monitor
-
Returns:
- the connection status
-
Throws:
-
Exception
-
Since:
- 3.1
initializeConnection
protected void initializeConnection(org.eclipse.dstore.core.client.ConnectionStatus launchStatus,
org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
Boolean alertedNONSSL,
IProgressMonitor monitor)
throws
Exception
- Initialize the DataStore connection.
-
-
-
Parameters:
-
launchStatus - the launch status if the server was launched via the daemon. Otherwise, null. -
connectStatus - the connect status for the server -
alertedNONSSL - a boolean indicating whether the user has been alerted to a NON-ssl connection -
monitor - the status monitor
-
Throws:
-
Exception
-
Since:
- 3.1
handleConnectionFailure
protected void handleConnectionFailure(org.eclipse.dstore.core.client.ConnectionStatus launchStatus,
org.eclipse.dstore.core.client.ConnectionStatus connectStatus,
IRemoteServerLauncher serverLauncher,
ServerLaunchType serverLauncherType,
IProgressMonitor monitor)
throws
Exception
- Diagnostics the occurs after the failure of a connect.
-
-
-
Parameters:
-
launchStatus - the status of the launching of the server (if a daemon was used) -
connectStatus - the status of the connecting to the server -
serverLauncher - the server launcher -
serverLauncherType - the type of server launcher -
monitor - the progress monitor
-
Throws:
-
Exception
-
Since:
- 3.1
internalConnect
protected void internalConnect(
IProgressMonitor monitor)
throws
Exception
-
Description copied from class:
AbstractConnectorService
- Performs the actual connection to the target system.
-
-
Specified by:
-
internalConnect
in class
AbstractConnectorService
-
-
Parameters:
-
monitor - for cancellation and progress reporting
-
Throws:
-
Exception
- if connection does not succeed -
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(
SystemSignonInformation info,
IServerLauncherProperties serverLauncherProperties,
IProgressMonitor monitor)
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()
-
-
Specified by:
-
isConnected
in interface
IConnectorService
-
-
Returns:
- true if currently connected.
-
See Also:
-
IConnectorService.isConnected()
isNetworkError
public boolean isNetworkError()
- Shortcut to checking if the network is down
-
-
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.
supportsRemoteServerLaunching
public boolean supportsRemoteServerLaunching()
-
-
Specified by:
-
supportsRemoteServerLaunching
in interface
IConnectorService
-
Overrides:
-
supportsRemoteServerLaunching
in class
AbstractConnectorService
-
-
Returns:
- false, may be overridden
-
See Also:
-
IConnectorService.supportsRemoteServerLaunching()
supportsServerLaunchProperties
public boolean supportsServerLaunchProperties()
-
-
Specified by:
-
supportsServerLaunchProperties
in interface
IConnectorService
-
Overrides:
-
supportsServerLaunchProperties
in class
AbstractConnectorService
-
-
Returns:
- false, may be overridden
-
See Also:
-
IConnectorService.supportsServerLaunchProperties()
supportsPassword
public boolean supportsPassword()
-
Description copied from class:
StandardConnectorService
- Determines if this connector service understand the concept of a password.
This implementation always returns true.
Override if necessary.
-
-
Specified by:
-
supportsPassword
in interface
IConnectorService
-
Overrides:
-
supportsPassword
in class
StandardConnectorService
-
-
Returns:
- true
-
See Also:
-
IConnectorService.supportsPassword()
supportsUserId
public boolean supportsUserId()
-
Description copied from class:
StandardConnectorService
- Reports if this connector service can use a user identifier.
This implementation always returns true.
Override if necessary.
-
-
Specified by:
-
supportsUserId
in interface
IConnectorService
-
Overrides:
-
supportsUserId
in class
StandardConnectorService
-
-
Returns:
- true
-
See Also:
-
IConnectorService.supportsUserId()
createSystemMessage
protected
SystemMessage createSystemMessage(
String msgId,
int severity,
String msg)
-
-
-
Since:
- org.eclipse.rse.connectorservice.dstore 3.0
createSystemMessage
protected
SystemMessage createSystemMessage(
String msgId,
int severity,
String msg,
Throwable e)
-
-
-
Since:
- org.eclipse.rse.connectorservice.dstore 3.0
createSystemMessage
protected
SystemMessage createSystemMessage(
String msgId,
int severity,
String msg,
String msgDetails)
-
-
-
Since:
- org.eclipse.rse.connectorservice.dstore 3.0
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|