|
RSE Release 1.0 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.AbstractConnectorService
This is a base class to make it easier to create connector service classes.
An IConnectorService object
is returned from a subsystem object via getConnectorService(), and
it is used to represent the live connection to a particular subsystem.
You must override/implement
AbstractConnectorServiceManager| Nested Class Summary | |
|---|---|
protected class |
AbstractConnectorService.NewPasswordInfo
|
| Field Summary | |
|---|---|
protected IServerLauncherProperties |
_remoteServerLauncherProperties
The cached value of the ' Remote Server Launcher' containment reference |
protected Object |
connectResult
The result of calling connect in the server launcher object, in the connect method |
protected Object |
launchResult
The result of calling launch in the server launcher object, in the connect method |
protected Shell |
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 | |
|---|---|
AbstractConnectorService(String name,
String description,
IHost host,
int port)
|
|
| Method Summary | |
|---|---|
void |
addCommunicationsListener(ICommunicationsListener listener)
Fully implemented, no need to override. |
protected void |
clearCommunicationListeners()
Private - used internally. |
void |
clearPasswordCache()
Useful utility method. |
void |
clearPasswordCache(boolean onDisk)
Useful utility method. |
protected void |
clearPasswordForOtherSystemsInConnection(String uid,
boolean fromDisk)
|
void |
clearUserIdCache()
Useful utility method. |
boolean |
commit()
Request a persistence manager to persist this object. |
void |
connect(IProgressMonitor monitor)
This connection method wrappers the others (internal connect) so that registered subsystems can be notified and initialized after a connect Previous implementations that overrode this method should now change their connect() method to internalConnect() |
void |
deregisterSubSystem(ISubSystem ss)
Removes the subsystem from teh list |
void |
disconnect(IProgressMonitor monitor)
Disconnects from the remote system. |
protected void |
fireCommunicationsEvent(int eventType)
Private - used internally. |
protected boolean |
forcePasswordToUpperCase()
Useful utility method. |
protected int |
getCommunicationListenerCount()
Private - used internally. |
protected int |
getConnectPort()
Return the port to use for connecting to the remote server, once it is running. |
String |
getDescription()
|
String |
getHomeDirectory()
Not implemented, you should override if possible. |
IHost |
getHost()
Return the host |
String |
getHostName()
Useful utility method. |
String |
getHostType()
Useful utility method. |
protected String |
getLocalUserId()
Useful utility method. |
String |
getName()
Return the name of this connector service |
protected SystemSignonInformation |
getPasswordInformation()
Useful utility method. |
protected ISystemPasswordPromptDialog |
getPasswordPromptDialog(Shell shell)
A default implementation is supplied, but can be overridden if desired. |
ISystemValidator |
getPasswordValidator()
Useful utility method. |
int |
getPort()
Return the port for this connector |
ISubSystem |
getPrimarySubSystem()
Return the subsystem object this system is associated with |
IServerLauncher |
getRemoteServerLauncher()
Return the remote server launcher, which implements IServerLauncher. |
IServerLauncherProperties |
getRemoteServerLauncherProperties()
Returns the value of the 'Remote Server Launcher' containment reference. |
ISignonValidator |
getSignonValidator()
Optionally overridable, not implemented by default. |
ISubSystem[] |
getSubSystems()
Return all the subsystems that use this service |
String |
getTempDirectory()
Not implemented, you should override if possible. |
String |
getUserId()
Useful utility method. |
ISystemValidator |
getUserIdValidator()
Useful utility method. |
String |
getVersionReleaseModification()
Not implemented, you should override if possible. |
boolean |
hasRemoteSearchLauncherProperties()
|
boolean |
hasRemoteServerLauncherProperties()
|
boolean |
inheritConnectionUserPassword()
Return true if this system can inherit the uid and password of other ISystems in this connection |
protected void |
internalConnect(IProgressMonitor monitor)
You must override unless subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true. |
void |
internalDisconnect(IProgressMonitor monitor)
|
protected void |
intializeSubSystems(IProgressMonitor monitor)
|
protected boolean |
isEnabledServerLaunchType(ISubSystem subsystem,
ServerLaunchType serverLaunchType)
This methods returns the enablement state per server launch type. |
boolean |
isPasswordCached()
Useful utility method. |
boolean |
isPasswordCached(boolean onDisk)
Useful utility method. |
boolean |
isSuppressSignonPrompt()
Returns the suppressSignonPrompt flag. |
boolean |
isUsingSSL()
|
void |
notifyConnection()
Notifies all listeners of a connection through a communications event |
void |
notifyDisconnection()
Notifies all listeners of a disconnection through a communications event |
void |
notifyError()
Notifies all listeners of an error through a communications event |
protected AbstractConnectorService.NewPasswordInfo |
promptForNewPassword(SystemMessage prompt)
|
void |
promptForPassword(boolean forcePrompt)
Do not override. |
void |
registerSubSystem(ISubSystem ss)
Set the subsystem, when its not known at constructor time |
void |
removeCommunicationsListener(ICommunicationsListener listener)
Fully implemented, no need to override. |
boolean |
requiresPassword()
If a password is supported this is used to determine if the password is required. |
boolean |
requiresUserId()
Report if this connector service requires a user id. |
void |
reset()
Optionally override if you add any instance variables. |
void |
setHost(IHost host)
|
void |
setIsUsingSSL(boolean flag)
|
void |
setPassword(String matchingUserId,
String password)
Useful utility method. |
void |
setPassword(String matchingUserId,
String password,
boolean persist)
Useful utility method. |
protected void |
setPasswordInformation(SystemSignonInformation passwordInfo)
Useful utility method. |
void |
setPort(int port)
Set the port for this connector |
void |
setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher)
Sets the value of the ' Remote Server Launcher' containment reference |
void |
setSuppressSignonPrompt(boolean suppressSignonPrompt)
Sets the suppressSignonPrompt flag. |
void |
setUserId(String newId)
Set the user id for this connector |
boolean |
shareUserPasswordWithConnection()
Return true if this connector service can share it's uid and password with other connector services in this host (connection). |
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. |
protected void |
unintializeSubSystems(IProgressMonitor monitor)
|
protected void |
updatePasswordForOtherSystemsInConnection(String uid,
String password,
boolean persistPassword)
|
| 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.subsystems.IConnectorService |
|---|
isConnected |
| 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 |
| Field Detail |
protected IServerLauncherProperties _remoteServerLauncherProperties
Remote Server Launcher' containment reference.
getRemoteServerLauncher()protected Shell shell
protected Object launchResult
protected Object connectResult
| Constructor Detail |
public AbstractConnectorService(String name,
String description,
IHost host,
int port)
| Method Detail |
public String getVersionReleaseModification()
Up to each implementer to decide if this will be cached.
Returns an empty string by default, override if possible
getVersionReleaseModification in interface IConnectorServicepublic String getHomeDirectory()
Up to each implementer to decide how to implement, and if this will be cached.
Returns an empty string by default, override if possible
getHomeDirectory in interface IConnectorServicepublic String getTempDirectory()
Up to each implementer to decide how to implement, and if this will be cached.
Returns an empty string by default, override if possible
getTempDirectory in interface IConnectorServicepublic void registerSubSystem(ISubSystem ss)
registerSubSystem in interface IConnectorServicepublic void deregisterSubSystem(ISubSystem ss)
deregisterSubSystem in interface IConnectorServicess - public final ISubSystem[] getSubSystems()
IConnectorService
getSubSystems in interface IConnectorServicepublic final ISubSystem getPrimarySubSystem()
IConnectorService
getPrimarySubSystem in interface IConnectorServicepublic final IHost getHost()
IConnectorService
getHost in interface IConnectorServicepublic final String getHostType()
getSubSystem().getSystemConnection().getSystemType()
getHostType in interface IConnectorServicepublic final String getName()
IConnectorService
getName in interface IConnectorServicepublic final String getDescription()
getDescription in interface IRSEModelObjectgetDescription in class RSEModelObjectpublic final String getHostName()
getSubSystem().getSystemConnection().getHostName()
getHostName in interface IConnectorServicepublic final String getUserId()
getUserId in interface IConnectorServiceprotected final String getLocalUserId()
public final void setUserId(String newId)
IConnectorService
setUserId in interface IConnectorServicenewId - public final void setHost(IHost host)
setHost in interface IConnectorServicepublic final void clearUserIdCache()
clearPasswordCache().
clearUserIdCache in interface IConnectorServicepublic final void clearPasswordCache()
clearPasswordCache in interface IConnectorServiceclearUserIdCache()public final void clearPasswordCache(boolean onDisk)
clearPasswordCache in interface IConnectorServiceonDisk - if this is true, clear the password from the disk cache as wellclearUserIdCache()public final boolean isPasswordCached(boolean onDisk)
isPasswordCached in interface IConnectorServiceonDisk - true if the check should be made for a persisted form as well,
false if the check should be made for a password in memory only.
public final boolean isPasswordCached()
isPasswordCached in interface IConnectorServicepublic final boolean inheritConnectionUserPassword()
inheritConnectionUserPassword in interface IConnectorServicepublic boolean requiresPassword()
IConnectorService
requiresPassword in interface IConnectorServicepublic boolean supportsPassword()
IConnectorService
supportsPassword in interface IConnectorServicepublic boolean requiresUserId()
IConnectorService
requiresUserId in interface IConnectorServicepublic boolean supportsUserId()
IConnectorService
supportsUserId in interface IConnectorServicepublic boolean supportsRemoteServerLaunching()
supportsRemoteServerLaunching in interface IConnectorServicepublic boolean hasRemoteServerLauncherProperties()
hasRemoteServerLauncherProperties in interface IConnectorServicepublic boolean supportsServerLaunchProperties()
IConnectorService
supportsServerLaunchProperties in interface IConnectorServicepublic boolean shareUserPasswordWithConnection()
shareUserPasswordWithConnection in interface IConnectorService
public void promptForPassword(boolean forcePrompt)
throws InterruptedException
promptForPassword in interface IConnectorServiceforcePrompt - if true then present the prompt even if the password was found and is valid.
InterruptedException - if user is prompted and user cancels that prompt or if isSuppressSignonPrompt is true.
protected void clearPasswordForOtherSystemsInConnection(String uid,
boolean fromDisk)
protected void updatePasswordForOtherSystemsInConnection(String uid,
String password,
boolean persistPassword)
protected final ISystemPasswordPromptDialog getPasswordPromptDialog(Shell shell)
By default returns an instance of SystemPasswordPromptDialog. Calls forcePasswordToUpperCase() to decide whether the user Id and password should be folded to uppercase.
Calls getUserIdValidator() and getPasswordValidator() to set the validators. These return null by default by you can override them.
Before calling open() on the dialog, the getPassword(Shell) method that calls this will call setSystemInput(this).
After return, it will call wasCancelled() and getUserId(), getIsUserIdChanged(), getIsUserIdChangePermanent() and getPassword().
protected SystemSignonInformation getPasswordInformation()
protected void setPasswordInformation(SystemSignonInformation passwordInfo)
passwordInfo - the password information object
public void setPassword(String matchingUserId,
String password,
boolean persist)
setPassword in interface IConnectorServicematchingUserId - the user for which to set the passwordpassword - the password to set for this useridpersist - true if the password is to be persisted as well
public void setPassword(String matchingUserId,
String password)
setPassword(matchingUserId, password, false)
setPassword in interface IConnectorServicematchingUserId - the user for which to set the passwordpassword - the password to set for this useridprotected boolean forcePasswordToUpperCase()
getSubSystem().forceUserIdToUpperCase()
public ISystemValidator getUserIdValidator()
By default, returns
getSubSystem().getParentSubSystemConfiguration().getUserIdValidator()
public ISystemValidator getPasswordValidator()
By default, returns:
getSubSystem().getParentSubSystemConfiguration().getPasswordValidator()
public ISignonValidator getSignonValidator()
public final void connect(IProgressMonitor monitor)
throws Exception
connect in interface IConnectorServiceExceptionprotected void intializeSubSystems(IProgressMonitor monitor)
protected void unintializeSubSystems(IProgressMonitor monitor)
protected void internalConnect(IProgressMonitor monitor)
throws Exception
Attempt to connect to the remote system.
If the subsystem supports server launch,
the default behavior is to get the remote server launcher by
getRemoteServerLauncher(), and if IServerLauncher.isLaunched()
returns false, to call IServerLauncher.launch(IProgressMonitor).
This is called, by default, from the connect(...) methods of the subsystem.
Exceptionprotected int getConnectPort()
getPort().
Override if appropriate.
connect(IProgressMonitor), if
subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties() is true.
public final void disconnect(IProgressMonitor monitor)
throws Exception
You must override
if subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties
returns false.
If the subsystem supports server launch
the default behavior is to use the same remote server
launcher created in connect() and call disconnect().
This is called, by default, from the disconnect()
method of the subsystem.
disconnect in interface IConnectorServiceExceptionIServerLauncher.disconnect()
public void internalDisconnect(IProgressMonitor monitor)
throws Exception
Exceptionpublic IServerLauncher getRemoteServerLauncher()
This returns null be default!
public void reset()
reset in interface IConnectorServicepublic void addCommunicationsListener(ICommunicationsListener listener)
addCommunicationsListener in interface IConnectorServiceIConnectorService.addCommunicationsListener(ICommunicationsListener)public void removeCommunicationsListener(ICommunicationsListener listener)
removeCommunicationsListener in interface IConnectorServiceIConnectorService.removeCommunicationsListener(ICommunicationsListener)protected void fireCommunicationsEvent(int eventType)
protected int getCommunicationListenerCount()
protected void clearCommunicationListeners()
public boolean isSuppressSignonPrompt()
isSuppressSignonPrompt in interface IConnectorServicepublic void setSuppressSignonPrompt(boolean suppressSignonPrompt)
setSuppressSignonPrompt in interface IConnectorServicesuppressSignonPrompt -
protected boolean isEnabledServerLaunchType(ISubSystem subsystem,
ServerLaunchType serverLaunchType)
RemoteServerLauncher.enableServerLaunchType(ServerLaunchType, boolean) has not been
called for this server launch type, then it is enabled by default.
ServerLaunchTypepublic void notifyDisconnection()
IConnectorService
notifyDisconnection in interface IConnectorServicepublic void notifyConnection()
IConnectorService
notifyConnection in interface IConnectorServicepublic void notifyError()
IConnectorService
notifyError in interface IConnectorServicepublic void setPort(int port)
IConnectorService
setPort in interface IConnectorServiceport - public int getPort()
IConnectorService
getPort in interface IConnectorServicepublic boolean isUsingSSL()
isUsingSSL in interface IConnectorServicepublic void setIsUsingSSL(boolean flag)
setIsUsingSSL in interface IConnectorServicepublic IServerLauncherProperties getRemoteServerLauncherProperties()
IConnectorServiceParent Sub System'.
Get the remote server launcher, which may be null. This an optional object containing properties used to launch the remote server that communicates with this subsystem.
getRemoteServerLauncherProperties in interface IConnectorService#setRemoteServerLauncher(IServerLauncherProperties),
org.eclipse.rse.core.subsystems.SubsystemsPackage#getSubSystem_RemoteServerLauncher(),
org.eclipse.rse.core.subsystems.IServerLauncherProperties#getParentSubSystempublic void setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher)
IConnectorServiceRemote Server Launcher' containment reference.
Set the remote server launcher, which is an optional object containing
properties used to launch the remote server that communicates with this subsystem.
setRemoteServerLauncherProperties in interface IConnectorServicenewRemoteServerLauncher - the new value of the 'Remote Server Launcher' containment reference.#getRemoteServerLauncher()public boolean hasRemoteSearchLauncherProperties()
public boolean commit()
org.eclipse.rse.core.persistance.IRSEPersistableContainer
commit in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
protected AbstractConnectorService.NewPasswordInfo promptForNewPassword(SystemMessage prompt)
throws InterruptedException
InterruptedException
|
RSE Release 1.0 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||