diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 9babbd8157f..e882faf4a39 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186525] Move keystoreProviders to core * Martin Oberhuber (Wind River) - [181939] Deferred class loading for keystoreProviders + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.core; @@ -261,10 +262,10 @@ public class RSECorePlugin extends Plugin { // Get reference to the plug-in registry IExtensionRegistry registry = Platform.getExtensionRegistry(); // Get configured extenders - IConfigurationElement[] subsystemFactoryExtensions = + IConfigurationElement[] subsystemConfigurationExtensions = registry.getConfigurationElementsFor("org.eclipse.rse.core","subsystemConfigurations"); //$NON-NLS-1$ //$NON-NLS-2$ - return subsystemFactoryExtensions; + return subsystemConfigurationExtensions; } /** diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/SystemRemoteObjectMatcher.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/SystemRemoteObjectMatcher.java index 7955a9441f1..3bc67dc037e 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/SystemRemoteObjectMatcher.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/SystemRemoteObjectMatcher.java @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.core; @@ -84,23 +85,23 @@ public class SystemRemoteObjectMatcher private boolean genericSubSystemEnd = false; /** - * Historical constructor that doesn't support "subsystemFactoryCategory" or "systemTypes". + * Historical constructor that doesn't support "subsystemConfigurationCategory" or "systemTypes". */ - public SystemRemoteObjectMatcher(String subsystemFactoryId, String categoryFilter, + public SystemRemoteObjectMatcher(String subsystemConfigurationId, String categoryFilter, String nameFilter, String typeFilter, String subtypeFilter, String subsubtypeFilter) { - this(subsystemFactoryId, null, categoryFilter, null, nameFilter, typeFilter, subtypeFilter, subsubtypeFilter); + this(subsystemConfigurationId, null, categoryFilter, null, nameFilter, typeFilter, subtypeFilter, subsubtypeFilter); } /** - * Constructor that supports "subsystemFactoryCategory" and "systemTypes". + * Constructor that supports "subsystemConfigurationCategory" and "systemTypes". */ - public SystemRemoteObjectMatcher(String subsystemFactoryId, String subsystemFactoryCategoryFilter, String categoryFilter, + public SystemRemoteObjectMatcher(String subsystemConfigurationId, String subsystemConfigurationCategoryFilter, String categoryFilter, String systemTypes, String nameFilter, String typeFilter, String subtypeFilter, String subsubtypeFilter) { - this.subsystemCategoryFilter = subsystemFactoryCategoryFilter; - this.subsystemfilter = subsystemFactoryId; + this.subsystemCategoryFilter = subsystemConfigurationCategoryFilter; + this.subsystemfilter = subsystemConfigurationId; this.systypesfilter = systemTypes; this.categoryfilter = categoryFilter; this.namefilter = nameFilter; diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java index 41467a9587d..38595b2915b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java @@ -17,6 +17,7 @@ * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [189123] Prepare ISystemRegistry for move into non-UI + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.core.model; @@ -182,7 +183,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { /** * Return the profiles currently selected by the user as his "active" profiles - * @deprecated use getSystemProfileManager().getActiveSystemProfiles() + * @see ISystemProfileManager.getActiveSystemProfiles() */ public ISystemProfile[] getActiveSystemProfiles(); @@ -195,20 +196,20 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { /** * Return all defined profiles - * @deprecated use getSystemProfileManager().getAllSystemProfiles() + * @deprecated use getSystemProfileManager().getSystemProfiles() */ public ISystemProfile[] getAllSystemProfiles(); /** * Return all defined profile names - * @deprecated use getSystemProfileManager().getAllSystemProfiles() + * @deprecated use getSystemProfileManager().getSystemProfiles() * and get the names out of the returned array */ public String[] getAllSystemProfileNames(); /** * Return all defined profile names as a vector - * @deprecated use getAllSystemProfileManager().getAllSystemProfiles() + * @deprecated use getAllSystemProfileManager().getSystemProfiles() * and process the array to get a vector */ public Vector getAllSystemProfileNamesVector(); @@ -313,13 +314,15 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { /** * Resolve a subsystem from it's profile, connection and subsystem name. * + * @deprecated use other search methods in ISystemRegistry + * * @param srcProfileName the name of the profile * @param srcConnectionName the name of the connection - * @param subsystemFactoryId the id of the subsystem + * @param subsystemConfigurationId the id of the subsystem * * @return the subsystem */ - public ISubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemFactoryId); + public ISubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemConfigurationId); /** * Resolve a subsystem from it's absolute name @@ -371,8 +374,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { * in its plugin.xml file. * * @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories - * @deprecated use {@link #getSubSystemConfiguration(String).getSubSystems(connection, true) - * and filter the result by the category string + * @deprecated use {@link #getSubSystemConfigurationProxiesByCategory(String)} + * and instantiate only those subsystem configurations from the proxy + * that are really needed. Then, use {@link ISubSystemConfiguration#getSubSystems(boolean)} + * with a parameter true. */ public ISubSystem[] getSubSystemsBySubSystemConfigurationCategory(String factoryCategory, IHost connection); @@ -426,7 +431,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { * @deprecated use {@link #getSubSystemConfiguration(String)} and * {@link #getHostsBySubSystemConfiguration(ISubSystemConfiguration)} */ - public IHost[] getHostsBySubSystemConfigurationId(String factoryId); + public IHost[] getHostsBySubSystemConfigurationId(String configId); /** * Return all connections for which there exists one or more @@ -480,7 +485,8 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable { /** * Return the number of SystemConnection objects within the given profile. - * @deprecated use {@link #getSystemProfile(ISystemProfile)} + * @deprecated use {@link #getSystemProfile(String)} with + * {@link #getHostCount(ISystemProfile)} */ public int getHostCount(String profileName); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java index a81f1e1c753..03416a9332b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemStartHere.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.core.model; @@ -108,12 +109,17 @@ public class SystemStartHere *

* SAME AS: getSystemRegistry().getSubSystems(subsystemConfigurationId) * @param subsystemConfigurationId The subsystem configuration id as given in its plugin.xml id attribute for the subsystemConfigurations extension point - * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(String) - * @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getId() + * @see ISystemRegistry#getSubSystemConfiguration(String) + * @see ISubSystemConfiguration#getSubSystems(boolean) + * @see ISubSystemConfiguration#getId() */ public static ISubSystem[] getSubSystems(String subsystemConfigurationId) { - return getSystemRegistry().getSubSystems(subsystemConfigurationId); + ISystemRegistry sr = getSystemRegistry(); + ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId); + if (config == null) + return (new ISubSystem[0]); + return config.getSubSystems(true); } /** * STEP 3b. Get all subsystems for the given connection for your subsystem configuration, identified by subsystemConfigurationId. @@ -121,12 +127,16 @@ public class SystemStartHere * SAME AS: getSystemRegistry().getSubSystems(subsystemConfigurationId, connection) * @param subsystemConfigurationId The subsystem configuration id as given in its plugin.xml id attribute for the subsystemConfigurations extension point * @param connection The connection object you wish to get the subsystems for. Typically there is only one subsystem per object. - * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(String, IHost) - * @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getId() + * @see ISystemRegistry#getSubSystemConfiguration(String) + * @see ISubSystemConfiguration#getSubSystems(IHost, boolean) */ public static ISubSystem[] getSubSystems(String subsystemConfigurationId, IHost connection) { - return getSystemRegistry().getSubSystems(subsystemConfigurationId, connection); + ISystemRegistry sr = getSystemRegistry(); + ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId); + if (config == null) + return (new ISubSystem[0]); + return config.getSubSystems(connection, true); } /** * STEP 3c. Same as {@link #getSubSystems(String,IHost)} by used when you know @@ -138,7 +148,7 @@ public class SystemStartHere */ public static ISubSystem getSubSystem(String subsystemConfigurationId, IHost connection) { - ISubSystem[] subsystems = getSystemRegistry().getSubSystems(subsystemConfigurationId, connection); + ISubSystem[] subsystems = getSubSystems(subsystemConfigurationId, connection); if ((subsystems == null) || (subsystems.length==0)) return null; else diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java index d372d0e9c15..ac6a7fc8347 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java @@ -13,6 +13,7 @@ * Contributors: * David Dykstal (IBM) - 168870: move core function from UI to core * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -104,7 +105,7 @@ public interface ISubSystemConfigurationProxy { // /** // * Return an instance of the IConnectorService class identified by the "systemClass" attribute - // * of this subsystemFactory extension point. Note each call to this method returns a + // * of this subsystemConfigurations extension point. Note each call to this method returns a // * new instance of the class, or null if no "systemClass" attribute was specified. // */ // public IConnectorService getSystemObject(); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java index c2ef46fa7dd..b4842139591 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java @@ -14,6 +14,7 @@ * David Dykstal (IBM) - 142806: refactoring persistence framework * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.persistence; @@ -142,7 +143,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager { */ public ISystemProfile[] commitProfiles(long timeout) { List failed = new ArrayList(10); - ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getAllSystemProfiles(); + ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfiles(); for (int idx = 0; idx < profiles.length; idx++) { ISystemProfile profile = profiles[idx]; try { diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java index ea4874f409c..1d62acc6a06 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java @@ -13,6 +13,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.persistence.dom; @@ -234,10 +235,12 @@ public class RSEDOMImporter { ((IServiceSubSystem) subSystem).switchServiceFactory(serviceFactory); } } else { - ISubSystem[] existingSubSystems = _registry.getSubSystems(type, host); - - if (existingSubSystems != null && existingSubSystems.length > 0) { - subSystem = existingSubSystems[0]; + ISubSystemConfiguration config = _registry.getSubSystemConfiguration(type); + if (config!=null) { + ISubSystem[] existingSubSystems = config.getSubSystems(host, true); + if (existingSubSystems != null && existingSubSystems.length > 0) { + subSystem = existingSubSystems[0]; + } } } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java index 9c6f3b9ccef..e7954228202 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java @@ -14,6 +14,7 @@ * David Dykstal (IBM) - moved SystemPreferencesManager to a new package * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; @@ -82,8 +83,8 @@ public class SystemQualifiedRemoteFolderCombo extends Composite private SystemHistoryCombo folderCombo = null; private Button browseButton = null; //private RemoteFileSubSystem subsystem = null; - //private RemoteFileSubSystemConfiguration subsystemFactory = null; - //private String subsystemFactoryID = null; + //private RemoteFileSubSystemConfiguration subsystemConfiguration = null; + //private String subsystemConfigurationID = null; //private IRemoteFile[] folders = null; private Hashtable resolvedFolders = new Hashtable(); //private String[] folderStrings = null; @@ -594,10 +595,10 @@ public class SystemQualifiedRemoteFolderCombo extends Composite // turn folder name into folder object... IRemoteFile remoteFolder = null; ISubSystem[] filesubsystems = null; - //if (subsystemFactoryID == null) + //if (subsystemConfigurationID == null) filesubsystems = RemoteFileUtility.getFileSubSystems(conn); //else - // filesubsystems = sr.getSubSystems(subsystemFactoryID, conn); + // filesubsystems = sr.getSubSystems(subsystemConfigurationID, conn); if (filesubsystems.length == 0) { diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemRemoteFolderCombo.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemRemoteFolderCombo.java index 8a6b61ae086..030b8243ecf 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemRemoteFolderCombo.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemRemoteFolderCombo.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.files.ui.widgets; @@ -71,7 +72,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo private SystemHistoryCombo folderCombo = null; private Button browseButton = null; //private RemoteFileSubSystem subsystem = null; - //private RemoteFileSubSystemConfiguration subsystemFactory = null; + //private RemoteFileSubSystemConfiguration subsystemConfiguration = null; private IRSESystemType[] systemTypes = null; private IHost connection = null; private boolean showNewConnectionPrompt = true; @@ -545,7 +546,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo } /** * Returns action to be called when Browse... pressed. - * Either connection or subsystemFactoryId better be set! + * Either connection or subsystemConfigurationId better be set! */ protected SystemSelectRemoteFolderAction getBrowseAction(Shell shell) { diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemNewFileFilterAction.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemNewFileFilterAction.java index 9069a335330..074b4f6a0ad 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemNewFileFilterAction.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemNewFileFilterAction.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2002, 2007 IBM Corporation and others. 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 @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.files.ui.actions; @@ -39,7 +39,7 @@ public class SystemNewFileFilterAction /** * Constructor */ - public SystemNewFileFilterAction(IRemoteFileSubSystemConfiguration subsystemFactory, ISystemFilterPool parentPool, Shell shell) + public SystemNewFileFilterAction(IRemoteFileSubSystemConfiguration subsystemConfiguration, ISystemFilterPool parentPool, Shell shell) { super(shell, parentPool, SystemFileResources.ACTION_NEWFILTER_LABEL, SystemFileResources.ACTION_NEWFILTER_TOOLTIP, diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java index 96fa640a9a2..f969a0c9f25 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2002, 2007 IBM Corporation and others. 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 @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; @@ -25,7 +25,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf /** * This class is a provider of root nodes to the remote systems tree viewer part. - * It is used when the intial connections are to be subset to those that support a particular remote file subsystem factory, + * It is used when the initial connections are to be subset to those that support a particular remote file subsystem factory, * and subsystems shown within those connections are to be subset to only those from this subsystem factory. */ public class SystemFileSubSystemConfigurationAPIProviderImpl @@ -34,18 +34,20 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl { - private IRemoteFileSubSystemConfiguration subsystemFactory = null; + private IRemoteFileSubSystemConfiguration subsystemConfiguration = null; //protected Object[] emptyList = new Object[0]; /** * Constructor - * @param subsystemFactory The remote file subsystem factory. Users will drill down from connections that support this factory. + * @param subsystemConfiguration The remote file subsystem configuration. + * Users will drill down from connections that support this subsystem + * configuration. * @param directoryMode true if you only want to traverse directories, false for both files and directories. */ - public SystemFileSubSystemConfigurationAPIProviderImpl(IRemoteFileSubSystemConfiguration subsystemFactory, boolean directoryMode) + public SystemFileSubSystemConfigurationAPIProviderImpl(IRemoteFileSubSystemConfiguration subsystemConfiguration, boolean directoryMode) { super(directoryMode); - this.subsystemFactory = subsystemFactory; + this.subsystemConfiguration = subsystemConfiguration; } /** @@ -53,7 +55,7 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl */ public IRemoteFileSubSystemConfiguration getSubSystemConfiguration() { - return subsystemFactory; + return subsystemConfiguration; } // ---------------------------------- @@ -111,7 +113,7 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl */ public IHost[] getConnections() { - return sr.getHostsBySubSystemConfiguration(subsystemFactory); + return sr.getHostsBySubSystemConfiguration(subsystemConfiguration); } /** * Return a count of all connections which have at least one subsystem that implements/extends RemoteFileSubSystem @@ -125,7 +127,7 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl */ public boolean hasConnections() { - ISubSystem[] allOurSubSystems = subsystemFactory.getSubSystems(true); // true => full get; do restore from disk if not already + ISubSystem[] allOurSubSystems = subsystemConfiguration.getSubSystems(true); // true => full get; do restore from disk if not already return ((allOurSubSystems!=null) && (allOurSubSystems.length>0)); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/dialogs/SystemTestFilterStringDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/dialogs/SystemTestFilterStringDialog.java index 30438f7cb49..401860c9a38 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/dialogs/SystemTestFilterStringDialog.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/dialogs/SystemTestFilterStringDialog.java @@ -12,6 +12,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.ui.dialogs; @@ -21,6 +22,7 @@ import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.view.SystemTestFilterStringAPIProviderImpl; import org.eclipse.rse.internal.ui.view.SystemViewForm; @@ -53,7 +55,7 @@ public class SystemTestFilterStringDialog { protected ISubSystem subsystem = null; protected ISystemRegistry sr = null; - protected String subsystemFactoryId = null; + protected String subsystemConfigurationId = null; protected String filterString = null; protected SystemTestFilterStringAPIProviderImpl inputProvider = null; // GUI widgets @@ -86,7 +88,7 @@ public class SystemTestFilterStringDialog setBlockOnOpen(true); // always modal this.subsystem = subsystem; this.filterString = filterString; - this.subsystemFactoryId = subsystem.getSubSystemConfiguration().getId(); + this.subsystemConfigurationId = subsystem.getSubSystemConfiguration().getId(); sr = RSECorePlugin.getTheSystemRegistry(); setNeedsProgressMonitor(true); //pack(); @@ -175,7 +177,7 @@ public class SystemTestFilterStringDialog { this.subsystem = subsystem; this.filterString = filterString; - //this.subsystemFactoryId = subsystem.getParentSubSystemConfiguration().getId(); + //this.subsystemConfigurationId = subsystem.getParentSubSystemConfiguration().getId(); inputProvider.setSubSystem(subsystem); inputProvider.setFilterString(filterString); tree.reset(inputProvider); @@ -197,13 +199,15 @@ public class SystemTestFilterStringDialog { //System.out.println("connection changed"); IHost newConnection = connectionCombo.getHost(); - ISubSystem[] newSubSystems = sr.getSubSystems(subsystemFactoryId, newConnection); ISubSystem newSubSystem = null; - if ((newSubSystems != null) && (newSubSystems.length>0)) - { - newSubSystem = newSubSystems[0]; - subsystemFactoryId = subsystem.getSubSystemConfiguration().getId(); - } + ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId); + if (config!=null) { + ISubSystem[] newSubSystems = config.getSubSystems(newConnection, true); + if (newSubSystems != null && newSubSystems.length > 0) { + newSubSystem = newSubSystems[0]; + subsystemConfigurationId = subsystem.getSubSystemConfiguration().getId(); + } + } inputProvider.setSubSystem(newSubSystem); tree.reset(inputProvider); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java index 820df41f3ae..b980c4186a9 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -61,8 +62,8 @@ public class SystemSelectRemoteObjectAPIProviderImpl protected boolean listConnectionsMode = false; protected boolean showNewConnectionPrompt = false; protected boolean singleConnectionMode = false; - protected String subsystemFactoryId; - protected String subsystemFactoryCategory; + protected String subsystemConfigurationId; + protected String subsystemConfigurationCategory; protected String filterSuffix; protected IRSESystemType[] systemTypes; protected String preSelectFilterChild; @@ -97,19 +98,19 @@ public class SystemSelectRemoteObjectAPIProviderImpl * While this could be deduced from the first two pieces of information, it is safer to ask the * caller to explicitly identify these. If null is passed, then there is no restrictions. * - * @param factoryId The subsystemFactoryId to restrict connections and subsystems to + * @param configId The subsystemConfigurationId to restrict connections and subsystems to * An alternative to factoryCategory. Specify only one, pass null for the other. - * @param factoryCategory The subsystemFactory category to restrict connections and subsystems to. + * @param configCategory The subsystem configuration category to restrict connections and subsystems to. * An alternative to factoryId. Specify only one, pass null for the other. * @param showNewConnectionPrompt true if to show "New Connection" prompt, false if not to * @param systemTypes Optional list of system types to restrict the "New Connection" wizard to. Pass null for no restrictions */ - public SystemSelectRemoteObjectAPIProviderImpl(String factoryId, String factoryCategory, + public SystemSelectRemoteObjectAPIProviderImpl(String configId, String configCategory, boolean showNewConnectionPrompt, IRSESystemType[] systemTypes) { super(); - this.subsystemFactoryId = factoryId; - this.subsystemFactoryCategory = factoryCategory; + this.subsystemConfigurationId = configId; + this.subsystemConfigurationCategory = configCategory; this.systemTypes = systemTypes; this.showNewConnectionPrompt = showNewConnectionPrompt; this.listConnectionsMode = true; @@ -135,7 +136,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl /** * Specify system types to restrict what types of connections * the user can create, and see. - * This will override subsystemFactoryId,if that has been set! + * This will override subsystemConfigurationId,if that has been set! * * @param systemTypes An array of system types, or * null to allow all registered valid system types. @@ -406,7 +407,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl ISubSystem subsystem = subsystems[0]; // always just use first. Hopefully never a problem! if (subsystems.length > 1) - SystemBasePlugin.logWarning(this.getClass().getName() + ": More than one subsystem meeting criteria. SSFID = "+subsystemFactoryId+", SSFCat = "+subsystemFactoryCategory); //$NON-NLS-1$ //$NON-NLS-2$ + SystemBasePlugin.logWarning(this.getClass().getName() + ": More than one subsystem meeting criteria. SSFID = "+subsystemConfigurationId+", SSFCat = "+subsystemConfigurationCategory); //$NON-NLS-1$ //$NON-NLS-2$ if (quickFilters != null) { @@ -538,10 +539,12 @@ public class SystemSelectRemoteObjectAPIProviderImpl conns = inputConnections; else if (systemTypes != null) conns = sr.getHostsBySystemTypes(systemTypes); - else if (subsystemFactoryId != null) - conns = sr.getHostsBySubSystemConfigurationId(subsystemFactoryId); - else if (subsystemFactoryCategory != null) - conns = sr.getHostsBySubSystemConfigurationCategory(subsystemFactoryCategory); + else if (subsystemConfigurationId != null) { + ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId); + conns = sr.getHostsBySubSystemConfiguration(config); + } + else if (subsystemConfigurationCategory != null) + conns = sr.getHostsBySubSystemConfigurationCategory(subsystemConfigurationCategory); else conns = sr.getHosts(); @@ -571,15 +574,21 @@ public class SystemSelectRemoteObjectAPIProviderImpl /** * Given a connection, return the subsystem(s) appropriate for the given - * ssfactoryid or category + * subsystem configuration id or category */ protected ISubSystem[] getSubSystems(IHost selectedConnection) { ISubSystem[] subsystems = null; - if (subsystemFactoryId != null) - subsystems = sr.getSubSystems(subsystemFactoryId, selectedConnection); - else if (subsystemFactoryCategory != null) - subsystems = sr.getSubSystemsBySubSystemConfigurationCategory(subsystemFactoryCategory, selectedConnection); + if (subsystemConfigurationId != null) { + ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId); + if (config==null) + subsystems = new ISubSystem[0]; + else + subsystems = config.getSubSystems(selectedConnection, true); + } + else if (subsystemConfigurationCategory != null) { + subsystems = sr.getSubSystemsBySubSystemConfigurationCategory(subsystemConfigurationCategory, selectedConnection); + } else subsystems = sr.getSubSystems(selectedConnection); return subsystems; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewContentProvider.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewContentProvider.java index 18af8a5ac9b..cac1a731076 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewContentProvider.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewContentProvider.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.internal.ui.view.team; @@ -61,7 +62,7 @@ public class SystemTeamViewContentProvider extends WorkbenchContentProvider if (element instanceof IProject) { //IProject rseProject = (IProject)element; - ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getAllSystemProfiles(); + ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfiles(); children = profiles; //return profiles; } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java index 985e6470f3e..d48e2c8373e 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java @@ -20,6 +20,7 @@ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.ui; @@ -166,7 +167,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab public SystemConnectionForm(ISystemMessageLine msgLine, ISystemConnectionFormCaller caller) { this.msgLine = msgLine; this.caller = caller; - this.defaultProfileNames = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfileNames(); + this.defaultProfileNames = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getActiveSystemProfileNames(); callerInstanceOfWizardPage = caller instanceof IWizardPage; callerInstanceOfSystemPromptDialog = caller instanceof ISystemPromptDialog; callerInstanceOfPropertyPage = caller instanceof IWorkbenchPropertyPage; @@ -1453,7 +1454,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab */ public static ISystemValidator[] getConnectionNameValidators() { ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); - ISystemProfile[] profiles = sr.getActiveSystemProfiles(); + ISystemProfile[] profiles = sr.getSystemProfileManager().getActiveSystemProfiles(); ISystemValidator[] connNameValidators = new ISystemValidator[profiles.length]; for (int idx = 0; idx < profiles.length; idx++) { Vector v = sr.getHostAliasNames(profiles[idx]); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java index 11c657056d7..3c7ea50c040 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/filters/SystemFilterStringEditPane.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2002, 2007 IBM Corporation and others. 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 @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.ui.filters; @@ -275,8 +275,8 @@ public class SystemFilterStringEditPane implements SelectionListener } /** * Getter method, for the use of subclasses. Do not override.
- * Return the contextual system filter pool manager provider (ie subsystemFactory) that - * this was launched from. Will be null if not launched from a subsystem factory, or + * Return the contextual system filter pool manager provider (ie subsystem configuration) that + * this was launched from. Will be null if not launched from a subsystem configuration, or * a filter pool or filter (or reference). *

* This is not used by default but made available for subclasses. diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java index caa4fc13063..2841f2cdf78 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/SystemHostCombo.java @@ -15,6 +15,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.ui.widgets; @@ -206,14 +207,14 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, * @param style SWT style flags for overall composite widget. Typically just pass SWT.NULL * @param defaultConnection the system connection to preselect. Pass null to preselect first connection. * @param showNewButton true if a New... button is to be included in this composite - * @param ssFactoryCategory Only connections with subsystems owned by factories of this category are returned. + * @param ssConfigCategory Only connections with subsystems owned by factories of this category are returned. * @param showLabel true if a 'Connection' label is to be included in this composite */ - public SystemHostCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton, String ssFactoryCategory, boolean showLabel) { + public SystemHostCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton, String ssConfigCategory, boolean showLabel) { super(parent, style); if (showNewButton) // this is expensive, so only need to do this if New is enabled { - ISubSystemConfigurationProxy[] ssfProxies = RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationProxiesByCategory(ssFactoryCategory); + ISubSystemConfigurationProxy[] ssfProxies = RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationProxiesByCategory(ssConfigCategory); Vector vTypes = new Vector(); for (int idx = 0; idx < ssfProxies.length; idx++) { // Do not call ISubSystemConfigurationProxy.getSystemTypes() directly. If @@ -229,8 +230,8 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, restrictSystemTypesTo = (IRSESystemType[])vTypes.toArray(new IRSESystemType[vTypes.size()]); } init(parent, showNewButton, showLabel); - populateSSFactoryCategory = ssFactoryCategory; - populateConnectionCombo(connectionCombo, defaultConnection, ssFactoryCategory); + populateSSFactoryCategory = ssConfigCategory; + populateConnectionCombo(connectionCombo, defaultConnection, ssConfigCategory); setConnectionToolTipText(); addOurConnectionSelectionListener(); } @@ -617,7 +618,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, return composite; } /** - * Creates a new readonly connection combobox instance and sets the default + * Creates a new read-only connection combobox instance and sets the default * layout data, with tooltip text. * Assign the listener to the passed in implementer of Listener. *

@@ -657,7 +658,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, } /** - * Populates a readonly connection combobox instance with system connections for the given + * Populates a read-only connection combobox instance with system connections for the given * system type. *

* This fills the combination with the names of all the active connections of the given @@ -675,7 +676,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, } /** - * Populates a readonly connection combobox instance with system connections for the given + * Populates a read-only connection combobox instance with system connections for the given * system type. *

* This fills the combination with the names of all the active connections of the given @@ -746,7 +747,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, return matchFound; } /** - * Populates a readonly connection combobox instance with system connections for the given + * Populates a read-only connection combobox instance with system connections for the given * array of system types. * @param combo composite to populate * @param systemTypes the system types to restrict the connection list to. Pass null or * for all system types @@ -767,46 +768,48 @@ public class SystemHostCombo extends Composite implements ISelectionProvider, select(0); } /** - * Populates a readonly connection combobox instance with system connections which have subsystems + * Populates a read-only connection combobox instance with system connections which have subsystems * owned by the given subsystem factory. *

* @param combo composite to populate - * @param ssFactory the subsystem factory to restrict the connection list to. + * @param ssConfig the subsystem factory to restrict the connection list to. * @param defaultConnection the default system connection to preselect. * @return true if given default connection was found and selected */ - protected boolean populateConnectionCombo(Combo combo, ISubSystemConfiguration ssFactory, IHost defaultConnection) + protected boolean populateConnectionCombo(Combo combo, ISubSystemConfiguration ssConfig, IHost defaultConnection) { - connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfiguration(ssFactory); + connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfiguration(ssConfig); return addConnections(combo, connections, defaultConnection); } /** - * Populates a readonly connection combobox instance with system connections which have subsystems + * Populates a read-only connection combobox instance with system connections which have subsystems * owned by a subsystem factory of the given subsystem factory id. *

* @param combo composite to populate * @param defaultConnection the default system connection to preselect. - * @param ssFactoryId the subsystem factory id to restrict the connection list by. + * @param ssConfigId the subsystem factory id to restrict the connection list by. * @return true if given default connection was found and selected */ - protected boolean populateConnectionCombo(Combo combo, String ssFactoryId, IHost defaultConnection) + protected boolean populateConnectionCombo(Combo combo, String ssConfigId, IHost defaultConnection) { - connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationId(ssFactoryId); + org.eclipse.rse.core.model.ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); + ISubSystemConfiguration config = sr.getSubSystemConfiguration(ssConfigId); + connections = sr.getHostsBySubSystemConfiguration(config); return addConnections(combo, connections, defaultConnection); } /** - * Populates a readonly connection combobox instance with system connections which have subsystems + * Populates a read-only connection combobox instance with system connections which have subsystems * owned by a subsystem factory of the given subsystem factory category. *

* @param combo composite to populate * @param defaultConnection the default system connection to preselect. - * @param ssFactoryCategory the subsystem factory category to restrict the connection list by. + * @param ssConfigCategory the subsystem factory category to restrict the connection list by. * @return true if given default connection was found and selected */ - protected boolean populateConnectionCombo(Combo combo, IHost defaultConnection, String ssFactoryCategory) + protected boolean populateConnectionCombo(Combo combo, IHost defaultConnection, String ssConfigCategory) { - connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(ssFactoryCategory); + connections = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(ssConfigCategory); return addConnections(combo, connections, defaultConnection); } /** diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java index 0ff2edbe897..635618b0f20 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewProfileWizardMainPage.java @@ -12,11 +12,15 @@ * * Contributors: * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.ui.wizards; +import java.util.Vector; + import org.eclipse.jface.wizard.Wizard; import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.RSEUIPlugin; @@ -62,7 +66,12 @@ public class SystemNewProfileWizardMainPage super(wizard, "NewProfile", //$NON-NLS-1$ SystemResources.RESID_NEWPROFILE_PAGE1_TITLE, SystemResources.RESID_NEWPROFILE_PAGE1_DESCRIPTION); - nameValidator = new ValidatorProfileName(RSECorePlugin.getTheSystemRegistry().getAllSystemProfileNamesVector()); + ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfiles(); + Vector profileNames = new Vector(profiles.length); + for (int i=0; i 0); + return (subsystemConfigurationSuppliedWizardPages != null) && (subsystemConfigurationSuppliedWizardPages.length > 0); } /** * Return the first additional page to show when user presses Next on the main page */ protected ISystemNewConnectionWizardPage getFirstAdditionalPage() { - if ((subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length > 0)) { + if ((subsystemConfigurationSuppliedWizardPages != null) && (subsystemConfigurationSuppliedWizardPages.length > 0)) { IWizardPage previousPage = mainPage; - for (int idx = 0; idx < subsystemFactorySuppliedWizardPages.length; idx++) { - ((IWizardPage)subsystemFactorySuppliedWizardPages[idx]).setPreviousPage(previousPage); - previousPage = (IWizardPage)subsystemFactorySuppliedWizardPages[idx]; + for (int idx = 0; idx < subsystemConfigurationSuppliedWizardPages.length; idx++) { + ((IWizardPage)subsystemConfigurationSuppliedWizardPages[idx]).setPreviousPage(previousPage); + previousPage = (IWizardPage)subsystemConfigurationSuppliedWizardPages[idx]; } - return subsystemFactorySuppliedWizardPages[0]; + return subsystemConfigurationSuppliedWizardPages[0]; } else return null; } @@ -437,10 +438,10 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar return null; else { int index = getAdditionalPageIndex(page); - if ((index == (subsystemFactorySuppliedWizardPages.length - 1))) + if ((index == (subsystemConfigurationSuppliedWizardPages.length - 1))) // last page or page not found return null; - return (IWizardPage)subsystemFactorySuppliedWizardPages[index + 1]; + return (IWizardPage)subsystemConfigurationSuppliedWizardPages[index + 1]; } } @@ -452,8 +453,8 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar } private int getAdditionalPageIndex(IWizardPage page) { - for (int idx = 0; idx < subsystemFactorySuppliedWizardPages.length; idx++) { - if (page == subsystemFactorySuppliedWizardPages[idx]) + for (int idx = 0; idx < subsystemConfigurationSuppliedWizardPages.length; idx++) { + if (page == subsystemConfigurationSuppliedWizardPages[idx]) return idx; } return -1; @@ -466,8 +467,8 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar boolean ok = mainPage.isPageComplete(); if (ok && hasAdditionalPages()) { - for (int idx = 0; ok && (idx < subsystemFactorySuppliedWizardPages.length); idx++) - ok = subsystemFactorySuppliedWizardPages[idx].isPageComplete(); + for (int idx = 0; ok && (idx < subsystemConfigurationSuppliedWizardPages.length); idx++) + ok = subsystemConfigurationSuppliedWizardPages[idx].isPageComplete(); } return ok; } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java index e78d8a2be28..84d2798aced 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java @@ -29,6 +29,7 @@ * Martin Oberhuber (Wind River) - [186773] split SystemRegistryUI from SystemRegistry implementation * Martin Oberhuber (Wind River) - [189123] Prepare ISystemRegistry for move into non-UI * Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core + * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods ********************************************************************************/ package org.eclipse.rse.ui.internal.model; @@ -113,7 +114,7 @@ public class SystemRegistry implements ISystemRegistry private int modelListenerCount = 0; private int remoteListCount = 0; - private ISubSystemConfigurationProxy[] subsystemFactoryProxies = null; + private ISubSystemConfigurationProxy[] subsystemConfigurationProxies = null; private boolean errorLoadingFactory = false; /** @@ -200,14 +201,14 @@ public class SystemRegistry implements ISystemRegistry return true; // much faster and safer /* boolean hasSubsystems = false; - if (subsystemFactoryProxies != null) + if (subsystemConfigurationProxies != null) { - for (int idx = 0; (!hasSubsystems) && (idx < subsystemFactoryProxies.length); idx++) + for (int idx = 0; (!hasSubsystems) && (idx < subsystemConfigurationProxies.length); idx++) { - if (subsystemFactoryProxies[idx].appliesToSystemType(selectedConnection.getSystemType().getName()) && - subsystemFactoryProxies[idx].isSubSystemConfigurationActive()) + if (subsystemConfigurationProxies[idx].appliesToSystemType(selectedConnection.getSystemType().getName()) && + subsystemConfigurationProxies[idx].isSubSystemConfigurationActive()) { - SubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); + SubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration(); if (factory != null) { SubSystem[] sss = factory.getSubSystems(selectedConnection, SubSystemConfiguration.LAZILY); @@ -247,7 +248,7 @@ public class SystemRegistry implements ISystemRegistry */ public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies) { - subsystemFactoryProxies = proxies; + subsystemConfigurationProxies = proxies; //for (int idx=0; idxprofileName.connectionName:subsystemFactoryId + * is denoted by profileName.connectionName:subsystemConfigurationId * * @param absoluteSubSystemName the name of the subsystem * @@ -1019,30 +1020,41 @@ public class SystemRegistry implements ISystemRegistry String srcProfileName = absoluteSubSystemName.substring(0, profileDelim); String srcConnectionName = absoluteSubSystemName.substring(profileDelim + 1, connectionDelim); String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length()); - - return getSubSystem(srcProfileName, srcConnectionName, srcSubSystemConfigurationId); + + ISystemProfile profile = getSystemProfile(srcProfileName); + return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId); } return null; } + /* + * (non-Javadoc) + * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystem(java.lang.String, java.lang.String, java.lang.String) + */ + public ISubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemConfigurationId) + { + ISystemProfile profile = getSystemProfile(srcProfileName); + return getSubSystem(profile, srcConnectionName, subsystemConfigurationId); + } + /** * Resolve a subsystem from it's profile, connection and subsystem name. * - * @param srcProfileName the name of the profile + * @param profile the profile to search * @param srcConnectionName the name of the connection - * @param subsystemFactoryId the factory Id of the subsystem + * @param subsystemConfigurationId the factory Id of the subsystem * * @return the subsystem */ - public ISubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemFactoryId) + public ISubSystem getSubSystem(ISystemProfile profile, String srcConnectionName, String subsystemConfigurationId) { // find the src connection - IHost[] connections = registry.getHostsByProfile(srcProfileName); + IHost[] connections = getHostsByProfile(profile); if (connections == null) { // if the profile can't be found, get all connections - connections = registry.getHosts(); + connections = getHosts(); } for (int i = 0; i < connections.length; i++) @@ -1057,7 +1069,7 @@ public class SystemRegistry implements ISystemRegistry { ISubSystem subsystem = subsystems[s]; String compareId = subsystem.getConfigurationId(); - if (compareId.equals(subsystemFactoryId)) + if (compareId.equals(subsystemConfigurationId)) { return subsystem; } @@ -1065,7 +1077,7 @@ public class SystemRegistry implements ISystemRegistry { // for migration purposes, test the against the name // we used to use the subsystem name instead of the factory Id - if (subsystem.getName().equals(subsystemFactoryId)) + if (subsystem.getName().equals(subsystemConfigurationId)) { return subsystem; } @@ -1130,13 +1142,13 @@ public class SystemRegistry implements ISystemRegistry ISubSystem[] subsystems = null; Vector v = new Vector(); - if (subsystemFactoryProxies != null) + if (subsystemConfigurationProxies != null) { - for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) + for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++) { - if (subsystemFactoryProxies[idx].appliesToSystemType(conn.getSystemType()) && subsystemFactoryProxies[idx].isSubSystemConfigurationActive()) + if (subsystemConfigurationProxies[idx].appliesToSystemType(conn.getSystemType()) && subsystemConfigurationProxies[idx].isSubSystemConfigurationActive()) { - ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); + ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration(); if (factory != null) { ISubSystem[] sss = factory.getSubSystems(conn, ISubSystemConfiguration.LAZILY); @@ -1209,12 +1221,12 @@ public class SystemRegistry implements ISystemRegistry * Get a list of subsystem objects for given connection, owned by the subsystem factory * identified by its given plugin.xml-described id. Array will never be null but may be length zero. */ - public ISubSystem[] getSubSystems(String factoryId, IHost connection) + public ISubSystem[] getSubSystems(String configId, IHost connection) { - ISubSystemConfiguration factory = getSubSystemConfiguration(factoryId); - if (factory == null) + ISubSystemConfiguration config = getSubSystemConfiguration(configId); + if (config == null) return (new ISubSystem[0]); - return factory.getSubSystems(connection, ISubSystemConfiguration.FORCE_INTO_MEMORY); + return config.getSubSystems(connection, ISubSystemConfiguration.FORCE_INTO_MEMORY); } /** * Get a list of subsystem objects for given connection, owned by a subsystem factory @@ -1488,13 +1500,13 @@ public class SystemRegistry implements ISystemRegistry public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory) { Vector v = new Vector(); - if (subsystemFactoryProxies != null) + if (subsystemConfigurationProxies != null) { - for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) + for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++) { - if (subsystemFactoryProxies[idx].getCategory().equals(factoryCategory)) + if (subsystemConfigurationProxies[idx].getCategory().equals(factoryCategory)) { - ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); + ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration(); if (factory != null) { ISubSystem[] subsystems = factory.getSubSystems(true); // true ==> force full restore @@ -1654,7 +1666,14 @@ public class SystemRegistry implements ISystemRegistry */ public Vector getHostAliasNames(ISystemProfile profile) { - return getHostAliasNames(profile.getName()); + ISystemHostPool pool = getHostPool(profile); + Vector names = new Vector(); + IHost[] conns = pool.getHosts(); + for (int idx = 0; idx < conns.length; idx++) + { + names.addElement(conns[idx].getAliasName()); + } + return names; } /* @@ -1667,7 +1686,7 @@ public class SystemRegistry implements ISystemRegistry Vector allNames = new Vector(); for (int idx = 0; idx < allPools.length; idx++) { - Vector v = getHostAliasNames(getSystemProfileName(allPools[idx])); + Vector v = getHostAliasNames(getSystemProfile(allPools[idx])); for (int jdx = 0; jdx < v.size(); jdx++) allNames.addElement(v.elementAt(jdx)); }