diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java
index 5a3e11c91d9..f64f0127eb4 100644
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java
+++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java
@@ -456,9 +456,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements
*/
protected synchronized void internalConnect(IProgressMonitor monitor) throws Exception
{
- if (isConnected())
- {
- // could have been called b4
+ if (isConnected()) {
return;
}
@@ -476,7 +474,8 @@ public class DStoreConnectorService extends AbstractConnectorService implements
clientConnection.setHost(getHostName());
clientConnection.setPort(Integer.toString(getPort()));
- ISubSystem ss = getPrimarySubSystem();
+// ISubSystem ss = getPrimarySubSystem();
+ getPrimarySubSystem();
IIBMServerLauncher serverLauncher = getIBMServerLauncher();
ServerLaunchType serverLauncherType = null;
@@ -1239,19 +1238,19 @@ public class DStoreConnectorService extends AbstractConnectorService implements
/**
* @see org.eclipse.rse.core.subsystems.AbstractConnectorService#isPasswordCached()
*/
- public boolean isPasswordCached()
- {
- // For Windows we never prompt for userid / password so we don't need
- // to clear the password cache
- if (getPrimarySubSystem().getHost().getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
- {
- return false;
- }
- else
- {
- return super.isPasswordCached();
- }
- }
+// public boolean isPasswordCached() // DWD is this method needed?
+// {
+// // For Windows we never prompt for userid / password so we don't need
+// // to clear the password cache
+// if (getPrimarySubSystem().getHost().getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
+// {
+// return false;
+// }
+// else
+// {
+// return super.isPasswordCached();
+// }
+// }
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSEPreferenceNames.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSEPreferenceNames.java
new file mode 100644
index 00000000000..d2b173e548d
--- /dev/null
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSEPreferenceNames.java
@@ -0,0 +1,18 @@
+/********************************************************************************
+ * Copyright (c) 2006 IBM Corporation. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kushal Munir (IBM) - Initial API and implementation.
+ ********************************************************************************/
+package org.eclipse.rse.core;
+
+/**
+ * These constants define the set of preference names that the RSE core uses.
+ */
+public interface IRSEPreferenceNames {
+ public static final String ST_DEFAULT_USERID = "systemType.defaultUserId";
+ public static final String ST_ENABLED = "systemType.enabled";
+}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java
index 8e8855cccd2..6657cf6e885 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java
@@ -18,10 +18,15 @@ package org.eclipse.rse.ui;
import java.net.MalformedURLException;
import java.net.URL;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.rse.core.IRSEPreferenceNames;
import org.eclipse.rse.core.IRSESystemType;
+import org.eclipse.rse.core.RSECorePlugin;
import org.osgi.framework.Bundle;
/**
@@ -83,31 +88,33 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
}
/**
- * Create an url from the argument absolute or relative path. The bundle
- * parameter is used as the base for relative paths and is allowed to be
- * null.
- *
- * @param value
- * the absolute or relative path
- * @param definingBundle
- * bundle to be used for relative paths (may be null)
- * @return
- */
- public static URL getUrl(String value, Bundle definingBundle) {
- try {
- if (value != null)
- return new URL(value);
- } catch (MalformedURLException e) {
- if (definingBundle != null)
- return Platform.find(definingBundle, new Path(value));
- }
-
- return null;
- }
+ * Create a URL from the argument absolute or relative path. The bundle parameter is
+ * used as the base for relative paths and may be null.
+ *
+ * @param value
+ * the absolute or relative path
+ * @param definingBundle
+ * bundle to be used for relative paths (may be null)
+ * @return the URL to the resource
+ */
+ public static URL getUrl(String value, Bundle definingBundle) {
+ URL result = null;
+ try {
+ if (value != null) {
+ result = new URL(value);
+ }
+ } catch (MalformedURLException e) {
+ if (definingBundle != null) {
+ IPath path = new Path(value);
+ result = FileLocator.find(definingBundle, path, null);
+ }
+ }
+ return result;
+ }
/**
- * Returns the name of the system type if the object passed in is of type IRSESystemType
.
- * Otherwise, returns the value of the parent implementation.
+ * Returns the name of the system type if the object passed in is of type IRSESystemType
. Otherwise, returns the value of the parent implementation.
+ *
* @see org.eclipse.ui.model.WorkbenchAdapter#getLabel(java.lang.Object)
*/
public String getLabel(Object object) {
@@ -136,10 +143,8 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
}
public boolean isEnableOffline(Object object) {
-
if ((object != null) && (object instanceof IRSESystemType)) {
String property = ((IRSESystemType)object).getProperty(ENABLE_OFFLINE);
-
if (property != null) {
return Boolean.valueOf(property).booleanValue();
}
@@ -152,21 +157,89 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
}
}
+ /**
+ * Returns the enabled state of a particular system type.
+ * @param object the object being adapted, usually a system type.
+ * @return true if that system type is enabled. false if the object is
+ * not a system type or if it is not enabled.
+ */
public boolean isEnabled(Object object) {
- //TODO
- return true;
+ boolean result = false;
+ IRSESystemType systemType = getSystemType(object);
+ if ( systemType != null) {
+ Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
+ String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_ENABLED);
+ if (!prefs.contains(key)) {
+ prefs.setDefault(key, true);
+ }
+ result = prefs.getBoolean(key);
+ }
+ return result;
}
+ /**
+ * Sets the enabled state of a particular system type.
+ * @param object The system type being adapted.
+ * @param isEnabled true if the system type is enabled. false if it is not.
+ */
public void setIsEnabled(Object object, boolean isEnabled) {
- //TODO
+ IRSESystemType systemType = getSystemType(object);
+ if ( systemType != null) {
+ Plugin core = RSECorePlugin.getDefault();
+ Preferences prefs = core.getPluginPreferences();
+ String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_ENABLED);
+ prefs.setValue(key, isEnabled);
+ core.savePluginPreferences();
+ }
}
+ /**
+ * Return the default user id for a particular system type. If none
+ * is defined then the "user.name" system property is used.
+ * @param object The system type being adapted.
+ * @return The default user id. Will be null if the object is not a system type
+ */
public String getDefaultUserId(Object object) {
- //TODO
- return "";
+ String result = null;
+ IRSESystemType systemType = getSystemType(object);
+ if ( systemType != null) {
+ Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
+ String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
+ if (!prefs.contains(key)) {
+ prefs.setDefault(key, System.getProperty("user.name"));
+ }
+ result = prefs.getString(key);
+ }
+ return result;
}
+ /**
+ * Set the default user id for this system type. Stored in the RSE core preferences.
+ * @param object the system type that we are adapting
+ * @param defaultUserId the id to set for this system type
+ */
public void setDefaultUserId(Object object, String defaultUserId) {
- //TODO
+ IRSESystemType systemType = getSystemType(object);
+ if ( systemType != null) {
+ Plugin core = RSECorePlugin.getDefault();
+ Preferences prefs = core.getPluginPreferences();
+ String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
+ prefs.setValue(key, defaultUserId);
+ core.savePluginPreferences();
+ }
}
+
+ private String getPreferencesKey(IRSESystemType systemType, String preference) {
+ String key = systemType.getName() + "." + preference;
+ return key;
+ }
+
+ private IRSESystemType getSystemType(Object systemTypeCandidate) {
+ IRSESystemType result = null;
+ if (systemTypeCandidate instanceof IRSESystemType) {
+ result = (IRSESystemType) systemTypeCandidate;
+ }
+ return result;
+ }
+
}
\ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java
index 6d64c570604..88a195fbc72 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java
@@ -49,20 +49,20 @@ public class SystemClearPasswordAction extends SystemBaseAction
}
/**
- * Override of parent. Called when testing if action should be enabled base on current
- * selection. We check the selected object is one of our subsystems, and we are not
- * already connected.
+ * Override of parent.
+ * Called when testing if an action should be enabled based on the current selection.
+ * The clear password action can be enabled if the selected object is a subsystem
+ * that is not connected and has a password that is saved.
+ * @return true if the clear password action can be enabled.
*/
- public boolean checkObjectType(Object obj)
- {
- if (!(obj instanceof ISubSystem) ||
- ((ISubSystem)obj).getConnectorService().isConnected() ||
- !(((ISubSystem)obj).getConnectorService().isPasswordCached(true))) {
- return false;
- }
- else {
- return true;
+ public boolean checkObjectType(Object obj) {
+ boolean result = false;
+ if (obj instanceof ISubSystem) {
+ ISubSystem subsystem = (ISubSystem) obj;
+ IConnectorService cs = subsystem.getConnectorService();
+ result = !cs.isConnected() && cs.isPasswordCached(true);
}
+ return result;
}
/**
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java
index 7882dc70287..b0875865226 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java
@@ -196,6 +196,7 @@ public class RemoteSystemsPreferencePage
// ---------------------------------------------------------
// GETTERS/SETTERS FOR EACH OF THE USER PREFERENCE VALUES...
// ---------------------------------------------------------
+ // DWD these preferences methods should be moved to SystemPreferencesManager since they are not a proper function of a preference page.
/**
* Return the names of the profiles the user has elected to make "active".
*/
@@ -566,10 +567,11 @@ public class RemoteSystemsPreferencePage
}
/**
- * Save the preference store
+ * Save the preference store.
*/
private static void savePreferenceStore()
{
+ /* plugin preferences and preference stores are actually the same store and are flushed to disk using this call */
RSEUIPlugin.getDefault().savePluginPreferences();
}
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java
index a3818fff388..e70072fb08f 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java
@@ -132,7 +132,7 @@ public class SystemTypeFieldEditor extends FieldEditor
tableViewer.setCellModifier(this);
CellEditor editors[] = new CellEditor[columnHeaders.length];
userIdCellEditor = new TextCellEditor(table);
- enabledCellEditor = new ComboBoxCellEditor(table, enabledStateStrings, SWT.READ_ONLY);
+ enabledCellEditor = new ComboBoxCellEditor(table, enabledStateStrings, SWT.READ_ONLY); // DWD should consider a checkbox for this.
editors[COLUMN_USERID] = userIdCellEditor;
editors[COLUMN_ENABLED] = enabledCellEditor;
tableViewer.setCellEditors(editors);
diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java
index 62ca6c6a89e..58380f1bd73 100644
--- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java
+++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java
@@ -32,12 +32,9 @@ import org.eclipse.rse.ui.SystemResources;
/**
* A pool of host objects.
* There is one pool per profile.
- * It is named the same as its owning profile.
- */
-/*
- * DWD this may be a candidate for elimination. It is not persisted but derived
- * when Host objects come into existance. Not sure it provides much value. Code
- * could be implemented directly in the profile.
+ * It is named the same as its owning profile.
+ * It is not persisted but provides a means of manipulating lists of host objects.
+ * Hosts are created and destroyed by the host pool so that the the relationships between the two can be maintained.
*/
public class SystemHostPool extends RSEModelObject implements ISystemHostPool
{
@@ -50,13 +47,15 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
protected String name = NAME_EDEFAULT;
private java.util.List connections = null;
- /**
- * Default constructor. Typically called by MOF.
+
+ /**
+ * Default constructor.
*/
protected SystemHostPool()
{
super();
}
+
/**
* Reset for a full refresh from disk, such as after a team synch
*/
@@ -209,6 +208,10 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
addHost(conn); // only record internally if saved successfully
conn.setHostPool(this);
conn.setAliasName(aliasName);
+ // DWD if default userID is null, and location is in the connection we should retrieve it and use it as the initial value.
+ if (defaultUserId == null && defaultUserIdLocation == ISystemUserIdConstants.USERID_LOCATION_CONNECTION) {
+ defaultUserId = conn.getDefaultUserId();
+ }
updateHost(conn, systemType, aliasName, hostName, description, defaultUserId, defaultUserIdLocation);
} catch (Exception e)
diff --git a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java
index e81516e4c2a..39d015189f3 100644
--- a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java
+++ b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java
@@ -313,7 +313,6 @@ public class RSEDOMExporter implements IRSEDOMExporter
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE, getBooleanString(host.isPromptable()));
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_HOSTNAME, host.getHostName());
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION, host.getDescription());
- node.addAttribute(IRSEDOMConstants.ATTRIBUTE_USER_ID, host.getDefaultUserId());
}
diff --git a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
index 0d9a290f626..aec9cb75138 100644
--- a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
+++ b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
@@ -120,7 +120,6 @@ public class RSEDOMImporter implements IRSEDOMImporter
String description = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION).getValue();
boolean isOffline = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_OFFLINE).getValue());
boolean isPromptable = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE).getValue());
- String userId = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_USER_ID).getValue();
// create host and set it's attributes
try
@@ -130,7 +129,6 @@ public class RSEDOMImporter implements IRSEDOMImporter
host = profile.createHost(systemType, connectionName, hostName, description);
host.setOffline(isOffline);
host.setPromptable(isPromptable);
- host.setDefaultUserId(userId);
}
catch (Exception e)
{
@@ -275,10 +273,6 @@ public class RSEDOMImporter implements IRSEDOMImporter
subSystem = factory.createSubSystemInternal(host);
}
subSystem.setHidden(isHidden);
-
- // name should always be based on the one in plugin.xml
- // so commenting this out
- //subSystem.setName(name);
subSystem.setHost(host);
subSystem.setSubSystemConfiguration(factory);
subSystem.setWasRestored(true);
@@ -480,10 +474,17 @@ public class RSEDOMImporter implements IRSEDOMImporter
{
ISystemFilterPoolManager filterPoolManager = factory.getFilterPoolManager(subSystem.getSystemProfile());
ISystemFilterPool filterPool = filterPoolManager.getSystemFilterPool(name);
-
- // create reference to the filterpool
- ISystemFilterPoolReferenceManager referenceManager = subSystem.getFilterPoolReferenceManager();
- filterPoolReference = referenceManager.addReferenceToSystemFilterPool(filterPool);
+ /*
+ * DWD filterpool can be null when restoring since there can be forward references.
+ * A profile may be being restored that has references to a filter pool in a profile that doesn't yet exist.
+ * Need to create an "unresolved" reference instead of a null object and then patch them up
+ * at the end.
+ */
+ if (filterPool != null) { // for the time being don't restore a reference if the pool isn't found.
+ // create reference to the filterpool
+ ISystemFilterPoolReferenceManager referenceManager = subSystem.getFilterPoolReferenceManager();
+ filterPoolReference = referenceManager.addReferenceToSystemFilterPool(filterPool);
+ }
}
return filterPoolReference;
diff --git a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java
index dc80aac3969..6ae4210baad 100644
--- a/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java
+++ b/rse/plugins/org.eclipse.rse.ui/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java
@@ -48,7 +48,6 @@ public interface IRSEDOMConstants
public static final String ATTRIBUTE_HOSTNAME = "hostname";
public static final String ATTRIBUTE_OFFLINE = "offline";
public static final String ATTRIBUTE_DESCRIPTION = "description";
- public static final String ATTRIBUTE_USER_ID = "defaultUserId";
// ConnectorService attributes
public static final String ATTRIBUTE_GROUP="group";
diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java
index 8185e9f7645..e226d73c158 100644
--- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java
+++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java
@@ -23,6 +23,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.PasswordPersistenceManager;
import org.eclipse.rse.internal.model.RSEModelObject;
+import org.eclipse.rse.logging.Logger;
+import org.eclipse.rse.logging.LoggerFactory;
import org.eclipse.rse.model.IHost;
import org.eclipse.rse.model.ISystemRegistry;
import org.eclipse.rse.model.SystemSignonInformation;
@@ -40,26 +42,24 @@ import org.eclipse.swt.widgets.Shell;
/**
- * This is a base class to make it easier to create system classes.
+ * This is a base class to make it easier to create connector service classes.
*
- * An {@link org.eclipse.rse.core.subsystems.IConnectorService} object is returned from a subsystem object via getSystem(), and - * it is used to represent the live connection to a particular subsystem. - *
- * All this could have been done in the subsystem object, but that would clutter it - * up too much. + * An {@link org.eclipse.rse.core.subsystems.IConnectorService} object + * is returned from a subsystem object via getSystem(), and + * it is used to represent the live connection to a particular subsystem. *
* You must override/implement *
getSubSystem().getSystemConnection().getSystemType()
*/
- public String getHostType()
+ final public String getHostType()
{
return getHost().getSystemType();
}
@@ -213,12 +216,12 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
/**
*
*/
- public String getName()
+ final public String getName()
{
return _name;
}
- public String getDescription()
+ final public String getDescription()
{
return _description;
}
@@ -228,141 +231,141 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
* Returns the host name for the connection this system's subsystem is associated with:
* getSubSystem().getSystemConnection().getHostName()
*/
- public String getHostName()
+ final public String getHostName()
{
return getHost().getHostName();
}
/**
- * Useful utility method. Fully implemented, do not override.- * By default returns an instance of SystemPasswordPromptDialog. - * Calls forcePasswordToUpperCase() to decide whether the - * user Id and password should be folded to uppercase. - *
- * Calls {@link #getUserIdValidator()} and {@link #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(). - *
- *
- * @return An instance of a dialog class that implements the ISystemPasswordPromptDialog interface
- */
+ * A default implementation is supplied, but can be overridden if desired.
+ * Instantiates and returns the dialog to prompt for the userId.
+ *
+ * By default returns an instance of SystemPasswordPromptDialog. Calls forcePasswordToUpperCase() to decide whether the user Id and password should be folded to uppercase. + *
+ * Calls {@link #getUserIdValidator()} and {@link #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(). + *
+ *
+ * @return An instance of a dialog class that implements the ISystemPasswordPromptDialog interface
+ */
protected final ISystemPasswordPromptDialog getPasswordPromptDialog(Shell shell)
{
ISystemPasswordPromptDialog dlg = new SystemPasswordPromptDialog(shell);
@@ -657,9 +624,9 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
/**
* Useful utility method. Fully implemented, no need to override.
- * Return the password information for this system's subsystem we are associated with.
- * This is transient. Assumes it has been set already. The password stored in
- * SystemSignonInformation is encrypted.
+ * Return the password information for the primary subsystem of this
+ * connector service. Assumes it has been set by the subsystem at the
+ * time the subsystem acquires the connector service.
*/
protected SystemSignonInformation getPasswordInformation()
{
@@ -766,10 +733,10 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
/**
- * This connection method wrappers the others (internal connect) so that registered subsystems can be notified and initialized after a connect
+ * 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()
- *
*/
public final void connect(IProgressMonitor monitor) throws Exception
{
@@ -796,14 +763,15 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
}
/**
- * Abstract - you must override, unless subsystem.getParentSubSystemFactory().supportsServerLaunchProperties
- * returns true
+ * You must override
+ * unless subsystem.getParentSubSystemFactory().supportsServerLaunchProperties
+ * returns true.
*
* Attempt to connect to the remote system.
* If the subsystem supports server launch,
- * the default behaviour here is to get the remote server launcher via
- * {@link #getRemoteServerLauncher()}, and if {@link IServerLauncher#isLaunched()}
- * returns false, to call {@link IServerLauncher#launch(IProgressMonitor)}.
+ * 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)}.
*
* This is called, by default, from the connect(...) methods of the subsystem. */ @@ -1118,6 +1086,10 @@ public abstract class AbstractConnectorService extends RSEModelObject implements return RSEUIPlugin.getThePersistenceManager().commit(getHost()); } + private void logException(Throwable t) { + Logger log = LoggerFactory.getInst(RSEUIPlugin.getDefault()); + log.logError("Unexpected exception", t); + } protected NewPasswordInfo promptForNewPassword(SystemMessage prompt) throws InterruptedException { diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorService.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorService.java index aa1a596185d..0e7aca88927 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorService.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorService.java @@ -22,28 +22,23 @@ import org.eclipse.swt.widgets.Shell; /** - * This is the interface implemented by System objects. + * This is the interface implemented by ConnectorService (formerly System) objects. *
- * A system object manages a live connection to a remote system, with - * operations for connecting and disconnecting, and storing information - * typically cached from a subsystem: user ID, password, port, etc. Any - * information in a System object is thrown out when the workbench goes - * down... it is not modelled for persistence. + * A connector service manages a live connection to a remote system, with + * operations for connecting and disconnecting, and storing information + * typically cached from a subsystem: user ID, password, port, etc. *
- * The SubSystem interface includes a method, getSystem(), which returns an - * instance of this interface for that subsystem. + * The SubSystem interface includes a method, getConnectorService(), which returns an + * instance of an object that implements this interface for that subsystem. *
- * A single system object can be unique to a subsystem (which is always unique - * for a particular tool to a particular connection). It can also be shared - * across multiple subsystems in a single connection if those subsystems share - * their physical connection to the remote system. This sharing is done via - * subclasses of {@link org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager} - * which are returned via another getter method in SubSystem. + * A single connector service object can be unique to a subsystem instance, but + * it can also be shared across multiple subsystems in a single host if those + * subsystems share a physical connection to the remote system. This sharing is done via + * subclasses of {@link org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager} + * which are returned by another getter method in SubSystem. */ public interface IConnectorService extends IRSEModelObject { - - /** * Return the subsystem object this system is associated with diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IIBMServerLauncher.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IIBMServerLauncher.java index e2becfd7809..dabd6965f1f 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IIBMServerLauncher.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IIBMServerLauncher.java @@ -16,42 +16,31 @@ package org.eclipse.rse.core.subsystems; /** - * - * This is the IBM default implementation of {@link IServerLauncherProperties}. It basically allows for numerous types + * This is the implementation of {@link IServerLauncherProperties}. It basically allows for numerous types * of server connecting, as identified in {@link org.eclipse.rse.core.subsystems.ServerLaunchType}. It * also captures the attributes needed to support these. *
* A server launcher is responsible for starting the server-side code needed for this client subsystem to - * access remote resources on the remote system. It starts the server half of the client/server code needed - * for this subsystem. It is consulted in the default implementation of connect() in ISystem, and the - * manages the properties in the Remote Server Launcher property page. - * - * + * access remote resources on the remote system. It starts the server half of the client/server code needed + * for this subsystem. It is consulted in the default implementation of connect() in ISystem, and the + * manages the properties in the Remote Server Launcher property page. *
* The following features are supported: *
* If you have your own attributes and own GUI to prompt for these, then call your own - * method to set your attributes, and call this method via super().xxx(...). + * method to set your attributes, and call this method via super(). *
- * The subsystem will be saved to disk. + * The changes to the subsystem configuration will be saved to disk. * Further, it will be asked to disconnect as this data affects the connection. *
* @param shell parent shell needed in case an error message is displayed @@ -1563,7 +1563,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration /** * Used by child classes that override updateSubSystem to establish if anything really - * needs to be changed. + * needs to be changed. */ protected boolean needsUpdate(ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port) { diff --git a/rse/plugins/org.eclipse.rse.ui/systems/org/eclipse/rse/core/SystemPreferencesManager.java b/rse/plugins/org.eclipse.rse.ui/systems/org/eclipse/rse/core/SystemPreferencesManager.java index 8716e133572..ec8ce06ba8c 100644 --- a/rse/plugins/org.eclipse.rse.ui/systems/org/eclipse/rse/core/SystemPreferencesManager.java +++ b/rse/plugins/org.eclipse.rse.ui/systems/org/eclipse/rse/core/SystemPreferencesManager.java @@ -34,7 +34,6 @@ import org.eclipse.rse.ui.propertypages.RemoteSystemsPreferencePage; * These include: *