diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubsystemConfiguration.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubsystemConfiguration.java index af6df6602a4..39936b851c7 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubsystemConfiguration.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubsystemConfiguration.java @@ -58,9 +58,7 @@ public class DaytimeSubsystemConfiguration extends ServiceSubSystemConfiguration return false; } public boolean supportsUserId() { - // TODO for now, we have to connect in order to pass the hostname to the service - // This should not be necessary in an ideal world - return true; + return false; } public boolean isFactoryFor(Class subSystemType) { return DaytimeSubSystem.class.equals(subSystemType); diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java index 29372c3a41f..4b2aea55aaf 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java @@ -100,6 +100,13 @@ public class DeveloperSubSystemConfiguration extends SubSystemConfiguration { return RSESamplesPlugin.getResourceString("property.type.devrfilter"); //$NON-NLS-1$ } + /* (non-Javadoc) + * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsUserId() + */ + public boolean supportsUserId() { + return false; + } + /* (non-Javadoc) * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.model.IHost) */ diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index 8cdf9465f10..aa15befae23 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -238,7 +238,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS public void setSubSystemConfiguration(ISubSystemConfiguration ssf) { parentSubSystemFactory = ssf; - supportsConnecting = ssf.supportsUserId(); + supportsConnecting = ssf.supportsSubSystemConnect(); //System.out.println("subsystem supports connecting? " + supportsConnecting); } /** @@ -1663,7 +1663,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS protected boolean implicitConnect(boolean isConnectOperation, IProgressMonitor mon, String msg, int totalWorkUnits) throws SystemMessageException, InvocationTargetException, InterruptedException { boolean didConnection = false; - if (doConnection && !isConnected())// caller wants to do connection first as part operation + if ( doConnection && !isConnected())// caller wants to do connection first as part operation { if (isOffline() || (supportsCaching() && getCacheManager().isRestoreFromMemento())) { @@ -2543,7 +2543,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS if (runnableContext instanceof ProgressMonitorDialog) { ((ProgressMonitorDialog) runnableContext).setCancelable(true); } - getConnectorService().promptForPassword(shell, forcePrompt); // prompt for userid and password + if (getSubSystemConfiguration().supportsUserId()) { + getConnectorService().promptForPassword(shell, forcePrompt); // prompt for userid and password + } ConnectJob job = new ConnectJob(); scheduleJob(job, null, shell != null); IStatus status = job.getResult(); @@ -2567,7 +2569,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS boolean ok = false; if (!supportsConnecting) return true; - + if (isOffline()) { // offline so don't bother prompting @@ -2579,6 +2581,13 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS doConnection = true; // this gets handled later when it comes time to connect return true; } + else if (!getSubSystemConfiguration().supportsUserId()) + { + // subsystem needs no user id so dont bother prompting + doConnection = true; // this gets handled later when it comes time to connect + return true; + } + try {