1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 18:15:23 +02:00

[168977][api][refactor] - stage 2.2

- Completing server launching protocol in the IConnectorService
- Completing new javadoc in IConnectorService
- Removing notify methods from IConnectorService - not API - making protected in the implementation
- made non-overridable methods final in SuperAbstractConnectorService.
This commit is contained in:
David Dykstal 2007-03-08 20:55:57 +00:00
parent 927be1022e
commit f408d0f68c
4 changed files with 212 additions and 237 deletions

View file

@ -414,11 +414,11 @@ public class DStoreConnectorService extends AbstractConnectorService implements
/** /**
* Return if you support remotely launching a server script * Return if you support remotely launching a server script
* @deprecated Use instead {@link #isEnabledServerLaunchType(ISubSystem, ServerLaunchType)} * @deprecated Use instead {@link #isServerLaunchTypeEnabled(ISubSystem, ServerLaunchType)}
* or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)} * or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
*/ */
public boolean getRexecLaunchEnabled(SubSystem subsystemImpl) { public boolean getRexecLaunchEnabled(SubSystem subsystemImpl) {
return isEnabledServerLaunchType(subsystemImpl, ServerLaunchType.REXEC_LITERAL); return isServerLaunchTypeEnabled(subsystemImpl, ServerLaunchType.REXEC_LITERAL);
} }
// /** // /**
@ -432,11 +432,11 @@ public class DStoreConnectorService extends AbstractConnectorService implements
/** /**
* Return if you support connecting to a server already running * Return if you support connecting to a server already running
* @deprecated Use instead {@link #isEnabledServerLaunchType(ISubSystem, ServerLaunchType)} * @deprecated Use instead {@link #isServerLaunchTypeEnabled(ISubSystem, ServerLaunchType)}
* or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)} * or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
*/ */
public boolean getNoLaunchEnabled(SubSystem subsystemImpl) { public boolean getNoLaunchEnabled(SubSystem subsystemImpl) {
return isEnabledServerLaunchType(subsystemImpl, ServerLaunchType.RUNNING_LITERAL); return isServerLaunchTypeEnabled(subsystemImpl, ServerLaunchType.RUNNING_LITERAL);
} }
/** /**
@ -466,12 +466,6 @@ public class DStoreConnectorService extends AbstractConnectorService implements
} }
} }
public boolean hasRemoteServerLauncherProperties() {
return _remoteServerLauncherProperties != null;
}
/** /**
* @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor) * @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor)
*/ */
@ -1275,9 +1269,9 @@ public class DStoreConnectorService extends AbstractConnectorService implements
} }
} }
/** // /**
* @see org.eclipse.rse.core.subsystems.AbstractConnectorService#getPasswordInformation() // * @see org.eclipse.rse.core.subsystems.AbstractConnectorService#getPasswordInformation()
*/ // */
// public SystemSignonInformation getPasswordInformation() // public SystemSignonInformation getPasswordInformation()
// { // {
// // For Windows we want to avoid the signon prompt (because we never // // For Windows we want to avoid the signon prompt (because we never
@ -1301,9 +1295,9 @@ public class DStoreConnectorService extends AbstractConnectorService implements
// } // }
// } // }
/** // /**
* @see org.eclipse.rse.core.subsystems.AbstractConnectorService#isPasswordCached() // * @see AbstractConnectorService#hasPassword(boolean)
*/ // */
// public boolean isPasswordCached() // public boolean isPasswordCached()
// { // {
// // For Windows we never prompt for userid / password so we don't need // // For Windows we never prompt for userid / password so we don't need

View file

@ -21,12 +21,13 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.IRSEModelObject; import org.eclipse.rse.core.model.IRSEModelObject;
/** /**
* This is the interface implemented by AbstractConnectorService * A connector service provides the means of establishing a connection from
* (formerly System) objects. * a subsystem (or a number of subsystems) to a target system (a host).
* <p> * <p>
* A connector service manages a live connection to a remote system, with * A connector service manages a live connection to a remote system, with
* operations for connecting and disconnecting, and storing information * operations for connecting and disconnecting, and storing information
* typically cached from a subsystem: credentials, port, etc. * typically cached from a subsystem: credentials (such as a userId/password),
* port, etc.
* <p> * <p>
* The SubSystem interface includes a method, getConnectorService(), * The SubSystem interface includes a method, getConnectorService(),
* which returns an instance of an object that implements this interface * which returns an instance of an object that implements this interface
@ -41,57 +42,52 @@ import org.eclipse.rse.core.model.IRSEModelObject;
public interface IConnectorService extends IRSEModelObject { public interface IConnectorService extends IRSEModelObject {
/** /**
* Return the subsystem object this system is associated with * @return the primary subsystem object this connector service is associated
* with. This is usually the subsystem that first established this
* connector service.
*/ */
public ISubSystem getPrimarySubSystem(); public ISubSystem getPrimarySubSystem();
/** /**
* Return all the subsystems that use this service * Return all the subsystems that use this connector service
* @return the subsystems that use this service * @return the subsystems that use this service
*/ */
public ISubSystem[] getSubSystems(); public ISubSystem[] getSubSystems();
/** /**
* Set the subsystem, when its not known at constructor time * Adds a subsystem to this connector service. Does nothing if the
* subsystem is already known to this connector service.
* @param ss a subsystem that is using this connector service.
*/ */
public void registerSubSystem(ISubSystem ss); public void registerSubSystem(ISubSystem ss);
/** /**
* Deregister the subsystem * Deregister the subsystem. Does nothing if the subsystem is not present.
* @param ss * @param ss the subsystem to remove from this connector service.
*/ */
public void deregisterSubSystem(ISubSystem ss); public void deregisterSubSystem(ISubSystem ss);
/** /**
* Return true if currently connected. * @return true if currently connected.
*/ */
public boolean isConnected(); public boolean isConnected();
/** /**
* Attempt to connect to the remote system. * Connects to the remote system.
* @param monitor a monitor for tracking the progress and canceling a connect
* operation.
* @throws Exception an exception of there is a failure to connect.
*/ */
public void connect(IProgressMonitor monitor) throws Exception; public void connect(IProgressMonitor monitor) throws Exception;
/** /**
* Disconnect from the remote system * Disconnects from the remote system.
* @param monitor a monitor for tracking the progress and canceling a disconnect
* operation.
* @throws Exception an exception of the disconnect fails.
*/ */
public void disconnect(IProgressMonitor monitor) throws Exception; public void disconnect(IProgressMonitor monitor) throws Exception;
/**
* Notifies all listeners of a disconnection through a communications event
*/
public void notifyDisconnection();
/**
* Notifies all listeners of a connection through a communications event
*/
public void notifyConnection();
/**
* Notifies all listeners of an error through a communications event
*/
public void notifyError();
/** /**
* Reset after some fundamental change, such as a hostname change. * Reset after some fundamental change, such as a hostname change.
* Clear any memory of the current connection. * Clear any memory of the current connection.
@ -99,206 +95,239 @@ public interface IConnectorService extends IRSEModelObject {
public void reset(); public void reset();
/** /**
* Return the version, release, modification of the remote system, * @return the version, release, modification of the remote system,
* if connected, if applicable and if available. Else return null. * if connected, if applicable, and if available. Return null if
* <p> * this information is not available.
* Up to each implementer to decide if this will be cached.
*/ */
public String getVersionReleaseModification(); public String getVersionReleaseModification();
/** /**
* Return the home directory of the remote system for the current user, if available. * @return the home directory of the remote system for the current user,
* <p> * if available.
* Up to each implementer to decide how to implement, and if this will be cached.
*/ */
public String getHomeDirectory(); public String getHomeDirectory();
/** /**
* Return the temp directory of the remote system for the current user, if available. * @return the temporary directory of the remote system for the current user,
* <p> * if available.
* Up to each implementer to decide how to implement, and if this will be cached.
*/ */
public String getTempDirectory(); public String getTempDirectory();
// --------------------------------------------------------------------
// Utility methods that offer combined connection and subsystem info...
// --------------------------------------------------------------------
/** /**
* Return the system type for this connection. * @return the system type for this connection.
*/ */
public String getHostType(); public String getHostType();
/** /**
* Return the name of this connector service
* @return the name of this connector service * @return the name of this connector service
*/ */
public String getName(); public String getName();
/**
* Sets the host used by this connector service.
* @param host
*/
public void setHost(IHost host); public void setHost(IHost host);
/** /**
* Return the host * @return the host used by this connector service.
* @return the host
*/ */
public IHost getHost(); public IHost getHost();
/** /**
* Return the host name for the connection this system's subsystem is associated with * @return the host name for the connection associated with this
* connector service.
*/ */
public String getHostName(); public String getHostName();
/** /**
* Return the port for this connector * @return the port for this connector service. Usually only used for
* IP based connections.
*/ */
public int getPort(); public int getPort();
/** /**
* Set the port for this connector * Set the port for this connector. Usually only used by IP based
* @param port * connections.
* @param port the IP port used by this connector service.
*/ */
public void setPort(int port); public void setPort(int port);
/** /**
* Return the userId for this system's subsystem we are associated with * @return true if this connector service will attempt to
* use SSL when establishing its connection.
*/
public boolean isUsingSSL();
/**
* @param flag true if the connector service should attempt to use SSL when
* establishing the connection.
*/
public void setIsUsingSSL(boolean flag);
/**
* @return the userId that will be used by this connector when
* establishing its connection.
*/ */
public String getUserId(); public String getUserId();
/** /**
* Set the user id for this connector * Set the user id this connector service will use when establishing its
* @param userId * connection.
* @param userId the user id string for this connector service.
*/ */
public void setUserId(String userId); public void setUserId(String userId);
public boolean isUsingSSL();
public void setIsUsingSSL(boolean flag);
/** /**
* Return the password for this system's subsystem we are associated with. * Acquire the password for this connector service.
* <p> * <p>
* If not currently set in transient memory, prompts the user for a password. * Implementations may retain a remembered password or
* use this acquire the password using some implementation defined means.
* <p> * <p>
* Throws InterruptedException if user is prompted and user cancels that prompt. * Throws InterruptedException if acquisition of the
* @param forcePrompt forces the prompt dialog to be displayed even if the password is currently * password is canceled for some reason.
* in memory. * @param reacquire if true will force the connector service to discard
* any remembered value and reacquire the password.
*/ */
public void promptForPassword(boolean forcePrompt) throws InterruptedException; public void promptForPassword(boolean reacquire) throws InterruptedException;
/** /**
* Set the password if you got it from somewhere * Sets the password used by this connector service.
* Can be used if the connector service acquires a password by some external
* means.
* @param matchingUserId The user id to be associated with this password.
* @param password the password
* @param persist true if the password is to be persisted for later use.
*/ */
public void setPassword(String matchingUserId, String password, boolean persist); public void setPassword(String matchingUserId, String password, boolean persist);
/** /**
* Clear internal userId cache. Called when user uses the property dialog to * Clears the userId held by this service.
* change his userId. * Should be called if there is a change to the user id for
* any using subsystem.
*/ */
public void clearUserId(); public void clearUserId();
/** /**
* Clear internal password cache. Called when user uses the property dialog to * Clear password held by this service and optionally
* clear its persistent form.
* Called when user uses the property dialog to
* change his userId. * change his userId.
* @param onDisk if true, clears the password from disk * @param onDisk if true, clears the persistent form of the password
*/ */
public void clearPassword(boolean onDisk); public void clearPassword(boolean onDisk);
/** /**
* Return true if password is currently cached. * @param onDisk retrieve the persistent form of the password.
* @return true if password is currently known to this service.
*/ */
public boolean hasPassword(boolean onDisk); public boolean hasPassword(boolean onDisk);
/** /**
* Return true if this system can inherit the uid and password of * Returns true if this system can inherit the uid and password of
* other ISystems in this connection * from the connection (Host).
*
* @return true if it can inherit the user/password * @return true if it can inherit the user/password
*/ */
public boolean inheritConnectionUserPassword(); public boolean inheritConnectionUserPassword();
/* /**
* Return true if this system can share it's uid and password * Return true if this system can share it's userId and password
* with other ISystems in this connection * with other connector services in this host.
* * @return true if it can share the userId/password
* @return true if it can share the user/password
*/ */
public boolean shareUserPasswordWithConnection(); public boolean shareUserPasswordWithConnection();
/** /**
* Register a communications listener * Register a communications listener. These listeners will be informed
* of connect and disconnect events.
* @param listener a listener for the communications event.
*/ */
public void addCommunicationsListener(ICommunicationsListener listener); public void addCommunicationsListener(ICommunicationsListener listener);
/** /**
* Remove a communications listener * Remove a communications listener.
* @param listener a listener for the communications event.
*/ */
public void removeCommunicationsListener(ICommunicationsListener listener); public void removeCommunicationsListener(ICommunicationsListener listener);
/** /**
* Returns the suppressSignonPrompt flag. If this is set to true then the user * @return true if the password acquisition is to be suppressed.
* will not be prompted to signon, instead an InterruptedException will be thrown
* by the promptForPassword method.
*
* @return boolean
*/ */
public boolean isSuppressSignonPrompt(); public boolean isSuppressSignonPrompt();
/** /**
* Sets the suppressSignonPrompt flag. Tool writers can use this to temporarily * Suppresses the acquisition of a password by the connector service.
* disable the user from being prompted to signon. This would cause the promptForPassword * Causes {@link #promptForPassword(boolean)} to immediately
* method to throw an InterruptedException instead of prompting. The intent of this * throw an InterruptedException.
* method is to allow tool writeres to prevent multiple signon prompts during a * <p>
* set period of time (such as a series of related communication calls) if the user * The intent is to allow tool writers to prevent multiple
* cancels the first prompt. <b>It is the callers responsability to set this value * attempts to acquire a password during a set period of time.
* back to false when the tool no longer needs to suppress the signon prompt or all * <b>It is the callers responsibility to set this value
* other tools sharing this connection will be affected.</b> * back to false when the tool no longer needs to suppress
* acquisition of the password.</b>
* *
* @param suppressSignonPrompt * @param suppressSignonPrompt <code>true</code> if acquisition is to be suppressed.
* <code>false</code> if acquisition is to be allowed.
*/ */
public void setSuppressSignonPrompt(boolean suppressSignonPrompt); public void setSuppressSignonPrompt(boolean suppressSignonPrompt);
/** /**
* Returns the value of the '<em><b>Remote Server Launcher</b></em>' containment reference. * This methods returns the enablement state of a server launch type.
* It is bidirectional and its opposite is '{@link org.eclipse.rse.core.subsystems.IServerLauncherProperties#getConnectorService()}'. * If {@link RemoteServerLauncher#enableServerLaunchType(ServerLaunchType, boolean)} has not been
* <!-- begin-user-doc --> * called for this server launch type, then it is enabled by default.
* <p> * @param subsystem the subystem for which this may be enabled.
* Get the remote server launcher, which may be null. This an optional object containing * @param serverLaunchType the type to check for enabledment.
* properties used to launch the remote server that communicates with this subsystem. * @return true if the connector service supports server launching and
* </p> * this launch type is enabled.
* <!-- end-user-doc --> * @see org.eclipse.rse.core.subsystems.ServerLaunchType
* @return the value of the '<em>Remote Server Launcher</em>' containment reference. */
* @see #setRemoteServerLauncherProperties(IServerLauncherProperties) public boolean isServerLaunchTypeEnabled(ISubSystem subsystem, ServerLaunchType serverLaunchType);
* @see org.eclipse.rse.core.subsystems.IServerLauncherProperties#getConnectorService()
* @model opposite="parentSubSystem" containment="true" /**
* @generated * 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.
* @return the properties of the server launcher
*/ */
IServerLauncherProperties getRemoteServerLauncherProperties(); IServerLauncherProperties getRemoteServerLauncherProperties();
/** /**
* Sets the value of the '{@link org.eclipse.rse.core.subsystems.IConnectorService#getRemoteServerLauncherProperties()}' containment reference. * Set the properties for the remote server launcher
* <!-- begin-user-doc --> * This is an object containing
* Set the remote server launcher, which is an optional object containing * properties used to launch a remote server that
* properties used to launch the remote server that communicates with this subsystem. * communicates with this client.
* <!-- end-user-doc -->
* @param value the new value of the '<em>Remote Server Launcher</em>' containment reference. * @param value the new value of the '<em>Remote Server Launcher</em>' containment reference.
* @see #getRemoteServerLauncherProperties()
* @generated
*/ */
void setRemoteServerLauncherProperties(IServerLauncherProperties value); void setRemoteServerLauncherProperties(IServerLauncherProperties value);
/**
* @return true if the connector service has server launcher properties.
*/
boolean hasRemoteServerLauncherProperties(); boolean hasRemoteServerLauncherProperties();
/**
* @return true if the connector service supports the concept of remote
* server launch properties. This will always return false {@link #supportsRemoteServerLaunching()}
* is false.
*/
boolean supportsServerLaunchProperties();
/**
* @return true if the connector service supports the concept of remote
* server launching.
*/
boolean supportsRemoteServerLaunching(); boolean supportsRemoteServerLaunching();
/** /**
* Tell us if this subsystem factory supports server launch properties, which allow the user * @return the server launcher. Will be null unless {@link #supportsRemoteServerLaunching()}
* to configure how the server-side code for these subsystems are started. There is a Server * is true.
* Launch Setting property page, with a pluggable composite, where users can configure these
* properties.
*/ */
public boolean supportsServerLaunchProperties(); IServerLauncher getRemoteServerLauncher();
/** /**
* Report if this connector service can use a user identifier. * Reports if this connector service can use a user identifier.
* Returns true in default implementation. * Returns true in default implementation.
* Typically used to indicate if a login dialog needs to be presented when connecting. * Typically used to indicate if a login dialog needs to be presented when connecting.
* @return true if and only if the connector service can use a user id. * @return true if and only if the connector service can use a user id.
@ -306,7 +335,7 @@ public interface IConnectorService extends IRSEModelObject {
public boolean supportsUserId(); public boolean supportsUserId();
/** /**
* Report if this connector service requires a user id. * Reports if this connector service requires a user id.
* Returns true in default implementation. * Returns true in default implementation.
* Typically used to indicate if a login dialog can allow an empty user id. * Typically used to indicate if a login dialog can allow an empty user id.
* Must be ignored if supportsUserId() is false. * Must be ignored if supportsUserId() is false.
@ -315,17 +344,20 @@ public interface IConnectorService extends IRSEModelObject {
public boolean requiresUserId(); public boolean requiresUserId();
/** /**
* Can be used to determine if a password field is present on a login dialog for this connector service. * Determines if this connector service understand the concept of a
* password.
* The default implementation of this interface should return true. * The default implementation of this interface should return true.
* @return true if the subsystem can use a password, false if a password is irrelevant. * @return true if the connector service can use a password,
* false if a password is irrelevant.
*/ */
public boolean supportsPassword(); public boolean supportsPassword();
/** /**
* If a password is supported this is used to determine if the password is required. * Determines if a password is required for this connector service.
* Must be ignored if supportsPassword() returns false. * Must be ignored if {@link #supportsPassword()} returns false.
* The default implementation of this interface should return true. * The default implementation of this interface should return true.
* @return true if the connector service requires a password, false if a password may be empty. * @return true if the connector service requires a password,
* false if a password may be empty.
*/ */
public boolean requiresPassword(); public boolean requiresPassword();

View file

@ -50,6 +50,19 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
_port = port; _port = port;
} }
public final boolean isServerLaunchTypeEnabled(ISubSystem subsystem, ServerLaunchType serverLaunchType) {
IServerLauncher sl = getRemoteServerLauncher();
if (sl instanceof RemoteServerLauncher) {
RemoteServerLauncher isl = (RemoteServerLauncher) sl;
return isl.isEnabledServerLaunchType(serverLaunchType);
} else
return subsystem.getSubSystemConfiguration().supportsServerLaunchType(serverLaunchType);
}
public IServerLauncher getRemoteServerLauncher() {
return null;
}
public boolean supportsRemoteServerLaunching() { public boolean supportsRemoteServerLaunching() {
return false; return false;
} }
@ -65,15 +78,15 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
public void setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher) { public void setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher) {
} }
public boolean hasRemoteServerLauncherProperties() { public final boolean hasRemoteServerLauncherProperties() {
return false; return getRemoteServerLauncherProperties() != null;
} }
/** /**
* <i>Fully implemented, no need to override.</i><br> * <i>Fully implemented, no need to override.</i><br>
* @see IConnectorService#addCommunicationsListener(ICommunicationsListener) * @see IConnectorService#addCommunicationsListener(ICommunicationsListener)
*/ */
public void addCommunicationsListener(ICommunicationsListener listener) { public final void addCommunicationsListener(ICommunicationsListener listener) {
if (!commListeners.contains(listener)) { if (!commListeners.contains(listener)) {
commListeners.add(listener); commListeners.add(listener);
} }
@ -83,7 +96,7 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
* <i>Fully implemented, no need to override.</i><br> * <i>Fully implemented, no need to override.</i><br>
* @see IConnectorService#removeCommunicationsListener(ICommunicationsListener) * @see IConnectorService#removeCommunicationsListener(ICommunicationsListener)
*/ */
public void removeCommunicationsListener(ICommunicationsListener listener) { public final void removeCommunicationsListener(ICommunicationsListener listener) {
commListeners.remove(listener); commListeners.remove(listener);
} }
@ -112,14 +125,6 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
commListeners.clear(); commListeners.clear();
} }
public final IHost getHost() {
return _host;
}
public final void setHost(IHost host) {
_host = host;
}
/** /**
* <i><b>Private</b> - used internally.</i><br> * <i><b>Private</b> - used internally.</i><br>
* Helper method for firing communication events * Helper method for firing communication events
@ -135,6 +140,14 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
} }
public final IHost getHost() {
return _host;
}
public final void setHost(IHost host) {
_host = host;
}
public final String getDescription() { public final String getDescription() {
return _description; return _description;
} }
@ -146,7 +159,7 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
return _name; return _name;
} }
public void setPort(int port) { public final void setPort(int port) {
if (port != _port) if (port != _port)
{ {
_port = port; _port = port;
@ -154,7 +167,7 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
} }
} }
public int getPort() { public final int getPort() {
return _port; return _port;
} }
@ -177,7 +190,7 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
/** /**
* Set the subsystem, when its not known at constructor time * Set the subsystem, when its not known at constructor time
*/ */
public void registerSubSystem(ISubSystem ss) { public final void registerSubSystem(ISubSystem ss) {
if (!_registeredSubSystems.contains(ss)) if (!_registeredSubSystems.contains(ss))
{ {
_registeredSubSystems.add(ss); _registeredSubSystems.add(ss);
@ -192,7 +205,7 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
_registeredSubSystems.remove(ss); _registeredSubSystems.remove(ss);
} }
public boolean commit() { public final boolean commit() {
return RSECorePlugin.getThePersistenceManager().commit(getHost()); return RSECorePlugin.getThePersistenceManager().commit(getHost());
} }
@ -208,6 +221,18 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
return ""; //$NON-NLS-1$ return ""; //$NON-NLS-1$
} }
/**
* <i>Not implemented, you should override if possible.</i><br>
* Return the temp directory of the remote system for the current user, if available.
* <p>
* Up to each implementer to decide how to implement, and if this will be cached.
* <p>
* Returns an empty string by default, override if possible
*/
public String getTempDirectory() {
return ""; //$NON-NLS-1$
}
/** /**
* <i>Useful utility method. Fully implemented, do not override.</i><br> * <i>Useful utility method. Fully implemented, do not override.</i><br>
* Returns the system type for this connection:<br> <code>getSubSystem().getSystemConnection().getSystemType()</code> * Returns the system type for this connection:<br> <code>getSubSystem().getSystemConnection().getSystemType()</code>
@ -265,26 +290,26 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
public void reset() { public void reset() {
} }
public void notifyDisconnection() { protected void notifyDisconnection() {
// Fire comm event to signal state changed // Fire comm event to signal state changed
if (!isConnected()) fireCommunicationsEvent(CommunicationsEvent.AFTER_DISCONNECT); if (!isConnected()) fireCommunicationsEvent(CommunicationsEvent.AFTER_DISCONNECT);
} }
public void notifyConnection() { protected void notifyConnection() {
if (isConnected()) fireCommunicationsEvent(CommunicationsEvent.AFTER_CONNECT); if (isConnected()) fireCommunicationsEvent(CommunicationsEvent.AFTER_CONNECT);
} }
public void notifyError() { protected void notifyError() {
fireCommunicationsEvent(CommunicationsEvent.CONNECTION_ERROR); fireCommunicationsEvent(CommunicationsEvent.CONNECTION_ERROR);
} }
public boolean isUsingSSL() { public final boolean isUsingSSL() {
return _usingSSL; return _usingSSL;
} }
public void setIsUsingSSL(boolean flag) { public final void setIsUsingSSL(boolean flag) {
if (_usingSSL != flag) if (_usingSSL != flag)
{ {
_usingSSL = flag; _usingSSL = flag;
@ -307,58 +332,6 @@ public abstract class SuperAbstractConnectorService extends RSEModelObject imple
return (ISubSystem[])_registeredSubSystems.toArray(new ISubSystem[_registeredSubSystems.size()]); return (ISubSystem[])_registeredSubSystems.toArray(new ISubSystem[_registeredSubSystems.size()]);
} }
/**
* <i>Not implemented, you should override if possible.</i><br>
* Return the temp directory of the remote system for the current user, if available.
* <p>
* Up to each implementer to decide how to implement, and if this will be cached.
* <p>
* Returns an empty string by default, override if possible
*/
public String getTempDirectory() {
return ""; //$NON-NLS-1$
}
/**
* This methods returns the enablement state per server launch type.
* If {@link RemoteServerLauncher#enableServerLaunchType(ServerLaunchType, boolean)} has not been
* called for this server launch type, then it is enabled by default.
* @see org.eclipse.rse.core.subsystems.ServerLaunchType
*/
protected boolean isEnabledServerLaunchType(ISubSystem subsystem, ServerLaunchType serverLaunchType) {
IServerLauncherProperties sl = getRemoteServerLauncherProperties();
if (sl instanceof RemoteServerLauncher)
{
RemoteServerLauncher isl = (RemoteServerLauncher)sl;
return isl.isEnabledServerLaunchType(serverLaunchType);
}
else
return subsystem.getSubSystemConfiguration().supportsServerLaunchType(serverLaunchType);
}
/**
* Return the remote server launcher, which implements IServerLauncher.
* This is called by the default implementation of connect() and disconnect(), if
* subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true.
* <p>This returns null be default!
*/
public IServerLauncher getRemoteServerLauncher() {
return null;
}
/**
* <i>You must override</i>
* unless subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties
* returns true.
* <p>
* Attempt to connect to the remote system.<br>
* If the subsystem supports server launch,
* the default behavior is to get the remote server launcher by
* {@link #getRemoteServerLauncher()}, and if {@link IServerLauncher#isLaunched()}
* returns false, to call {@link IServerLauncher#launch(IProgressMonitor)}.
* <p>
* This is called, by default, from the connect(...) methods of the subsystem.
*/
protected abstract void internalConnect(IProgressMonitor monitor) throws Exception; protected abstract void internalConnect(IProgressMonitor monitor) throws Exception;
protected abstract void internalDisconnect(IProgressMonitor monitor) throws Exception; protected abstract void internalDisconnect(IProgressMonitor monitor) throws Exception;

View file

@ -240,30 +240,6 @@ public abstract class AbstractDelegatingConnectorService implements IDelegatingC
return false; return false;
} }
public void notifyConnection() {
IConnectorService conServ = getRealConnectorService();
if (conServ != null)
{
conServ.notifyConnection();
}
}
public void notifyDisconnection() {
IConnectorService conServ = getRealConnectorService();
if (conServ != null)
{
conServ.notifyDisconnection();
}
}
public void notifyError() {
IConnectorService conServ = getRealConnectorService();
if (conServ != null)
{
conServ.notifyError();
}
}
public void promptForPassword(boolean forcePrompt) public void promptForPassword(boolean forcePrompt)
throws InterruptedException { throws InterruptedException {
IConnectorService conServ = getRealConnectorService(); IConnectorService conServ = getRealConnectorService();