1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +02:00

[175680] Deprecate obsolete ISystemRegistry methods

This commit is contained in:
Martin Oberhuber 2007-05-25 15:48:45 +00:00
parent 14be9af209
commit ac27934fec
20 changed files with 276 additions and 202 deletions

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186525] Move keystoreProviders to core * Martin Oberhuber (Wind River) - [186525] Move keystoreProviders to core
* Martin Oberhuber (Wind River) - [181939] Deferred class loading for keystoreProviders * Martin Oberhuber (Wind River) - [181939] Deferred class loading for keystoreProviders
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -261,10 +262,10 @@ public class RSECorePlugin extends Plugin {
// Get reference to the plug-in registry // Get reference to the plug-in registry
IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionRegistry registry = Platform.getExtensionRegistry();
// Get configured extenders // Get configured extenders
IConfigurationElement[] subsystemFactoryExtensions = IConfigurationElement[] subsystemConfigurationExtensions =
registry.getConfigurationElementsFor("org.eclipse.rse.core","subsystemConfigurations"); //$NON-NLS-1$ //$NON-NLS-2$ registry.getConfigurationElementsFor("org.eclipse.rse.core","subsystemConfigurations"); //$NON-NLS-1$ //$NON-NLS-2$
return subsystemFactoryExtensions; return subsystemConfigurationExtensions;
} }
/** /**

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * 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) - [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; package org.eclipse.rse.core;
@ -84,23 +85,23 @@ public class SystemRemoteObjectMatcher
private boolean genericSubSystemEnd = false; 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 nameFilter, String typeFilter,
String subtypeFilter, String subsubtypeFilter) 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 systemTypes, String nameFilter, String typeFilter,
String subtypeFilter, String subsubtypeFilter) String subtypeFilter, String subsubtypeFilter)
{ {
this.subsystemCategoryFilter = subsystemFactoryCategoryFilter; this.subsystemCategoryFilter = subsystemConfigurationCategoryFilter;
this.subsystemfilter = subsystemFactoryId; this.subsystemfilter = subsystemConfigurationId;
this.systypesfilter = systemTypes; this.systypesfilter = systemTypes;
this.categoryfilter = categoryFilter; this.categoryfilter = categoryFilter;
this.namefilter = nameFilter; this.namefilter = nameFilter;

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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) - [189123] Prepare ISystemRegistry for move into non-UI
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; 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 * Return the profiles currently selected by the user as his "active" profiles
* @deprecated use getSystemProfileManager().getActiveSystemProfiles() * @see ISystemProfileManager.getActiveSystemProfiles()
*/ */
public ISystemProfile[] getActiveSystemProfiles(); public ISystemProfile[] getActiveSystemProfiles();
@ -195,20 +196,20 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable {
/** /**
* Return all defined profiles * Return all defined profiles
* @deprecated use getSystemProfileManager().getAllSystemProfiles() * @deprecated use getSystemProfileManager().getSystemProfiles()
*/ */
public ISystemProfile[] getAllSystemProfiles(); public ISystemProfile[] getAllSystemProfiles();
/** /**
* Return all defined profile names * Return all defined profile names
* @deprecated use getSystemProfileManager().getAllSystemProfiles() * @deprecated use getSystemProfileManager().getSystemProfiles()
* and get the names out of the returned array * and get the names out of the returned array
*/ */
public String[] getAllSystemProfileNames(); public String[] getAllSystemProfileNames();
/** /**
* Return all defined profile names as a vector * Return all defined profile names as a vector
* @deprecated use getAllSystemProfileManager().getAllSystemProfiles() * @deprecated use getAllSystemProfileManager().getSystemProfiles()
* and process the array to get a vector * and process the array to get a vector
*/ */
public Vector getAllSystemProfileNamesVector(); public Vector getAllSystemProfileNamesVector();
@ -313,13 +314,15 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable {
/** /**
* Resolve a subsystem from it's profile, connection and subsystem name. * 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 srcProfileName the name of the profile
* @param srcConnectionName the name of the connection * @param srcConnectionName the name of the connection
* @param subsystemFactoryId the id of the subsystem * @param subsystemConfigurationId the id of the subsystem
* *
* @return 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 * Resolve a subsystem from it's absolute name
@ -371,8 +374,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable {
* in its plugin.xml file. * in its plugin.xml file.
* *
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories * @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
* @deprecated use {@link #getSubSystemConfiguration(String).getSubSystems(connection, true) * @deprecated use {@link #getSubSystemConfigurationProxiesByCategory(String)}
* and filter the result by the category 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); public ISubSystem[] getSubSystemsBySubSystemConfigurationCategory(String factoryCategory, IHost connection);
@ -426,7 +431,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable {
* @deprecated use {@link #getSubSystemConfiguration(String)} and * @deprecated use {@link #getSubSystemConfiguration(String)} and
* {@link #getHostsBySubSystemConfiguration(ISubSystemConfiguration)} * {@link #getHostsBySubSystemConfiguration(ISubSystemConfiguration)}
*/ */
public IHost[] getHostsBySubSystemConfigurationId(String factoryId); public IHost[] getHostsBySubSystemConfigurationId(String configId);
/** /**
* Return all connections for which there exists one or more * 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. * 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); public int getHostCount(String profileName);

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -108,12 +109,17 @@ public class SystemStartHere
* <p> * <p>
* SAME AS: <code>getSystemRegistry().getSubSystems(subsystemConfigurationId)</code> * SAME AS: <code>getSystemRegistry().getSubSystems(subsystemConfigurationId)</code>
* @param subsystemConfigurationId The subsystem configuration id as given in its plugin.xml id attribute for the subsystemConfigurations extension point * @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 ISystemRegistry#getSubSystemConfiguration(String)
* @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getId() * @see ISubSystemConfiguration#getSubSystems(boolean)
* @see ISubSystemConfiguration#getId()
*/ */
public static ISubSystem[] getSubSystems(String subsystemConfigurationId) 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. * 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: <code>getSystemRegistry().getSubSystems(subsystemConfigurationId, connection)</code> * SAME AS: <code>getSystemRegistry().getSubSystems(subsystemConfigurationId, connection)</code>
* @param subsystemConfigurationId The subsystem configuration id as given in its plugin.xml id attribute for the subsystemConfigurations extension point * @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. * @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 ISystemRegistry#getSubSystemConfiguration(String)
* @see org.eclipse.rse.core.subsystems.ISubSystemConfiguration#getId() * @see ISubSystemConfiguration#getSubSystems(IHost, boolean)
*/ */
public static ISubSystem[] getSubSystems(String subsystemConfigurationId, IHost connection) 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 * 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) 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)) if ((subsystems == null) || (subsystems.length==0))
return null; return null;
else else

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 168870: move core function from UI to core * David Dykstal (IBM) - 168870: move core function from UI to core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; 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 // * 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. // * new instance of the class, or null if no "systemClass" attribute was specified.
// */ // */
// public IConnectorService getSystemObject(); // public IConnectorService getSystemObject();

View file

@ -14,6 +14,7 @@
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -142,7 +143,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
*/ */
public ISystemProfile[] commitProfiles(long timeout) { public ISystemProfile[] commitProfiles(long timeout) {
List failed = new ArrayList(10); List failed = new ArrayList(10);
ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getAllSystemProfiles(); ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfiles();
for (int idx = 0; idx < profiles.length; idx++) { for (int idx = 0; idx < profiles.length; idx++) {
ISystemProfile profile = profiles[idx]; ISystemProfile profile = profiles[idx];
try { try {

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * 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; package org.eclipse.rse.internal.persistence.dom;
@ -234,12 +235,14 @@ public class RSEDOMImporter {
((IServiceSubSystem) subSystem).switchServiceFactory(serviceFactory); ((IServiceSubSystem) subSystem).switchServiceFactory(serviceFactory);
} }
} else { } else {
ISubSystem[] existingSubSystems = _registry.getSubSystems(type, host); ISubSystemConfiguration config = _registry.getSubSystemConfiguration(type);
if (config!=null) {
ISubSystem[] existingSubSystems = config.getSubSystems(host, true);
if (existingSubSystems != null && existingSubSystems.length > 0) { if (existingSubSystems != null && existingSubSystems.length > 0) {
subSystem = existingSubSystems[0]; subSystem = existingSubSystems[0];
} }
} }
}
if (subSystem == null) { if (subSystem == null) {
// subSystem = factory.createSubSystemInternal(host); // subSystem = factory.createSubSystemInternal(host);

View file

@ -14,6 +14,7 @@
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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; package org.eclipse.rse.files.ui.widgets;
@ -82,8 +83,8 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
private SystemHistoryCombo folderCombo = null; private SystemHistoryCombo folderCombo = null;
private Button browseButton = null; private Button browseButton = null;
//private RemoteFileSubSystem subsystem = null; //private RemoteFileSubSystem subsystem = null;
//private RemoteFileSubSystemConfiguration subsystemFactory = null; //private RemoteFileSubSystemConfiguration subsystemConfiguration = null;
//private String subsystemFactoryID = null; //private String subsystemConfigurationID = null;
//private IRemoteFile[] folders = null; //private IRemoteFile[] folders = null;
private Hashtable resolvedFolders = new Hashtable(); private Hashtable resolvedFolders = new Hashtable();
//private String[] folderStrings = null; //private String[] folderStrings = null;
@ -594,10 +595,10 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
// turn folder name into folder object... // turn folder name into folder object...
IRemoteFile remoteFolder = null; IRemoteFile remoteFolder = null;
ISubSystem[] filesubsystems = null; ISubSystem[] filesubsystems = null;
//if (subsystemFactoryID == null) //if (subsystemConfigurationID == null)
filesubsystems = RemoteFileUtility.getFileSubSystems(conn); filesubsystems = RemoteFileUtility.getFileSubSystems(conn);
//else //else
// filesubsystems = sr.getSubSystems(subsystemFactoryID, conn); // filesubsystems = sr.getSubSystems(subsystemConfigurationID, conn);
if (filesubsystems.length == 0) if (filesubsystems.length == 0)
{ {

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * 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; package org.eclipse.rse.files.ui.widgets;
@ -71,7 +72,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo
private SystemHistoryCombo folderCombo = null; private SystemHistoryCombo folderCombo = null;
private Button browseButton = null; private Button browseButton = null;
//private RemoteFileSubSystem subsystem = null; //private RemoteFileSubSystem subsystem = null;
//private RemoteFileSubSystemConfiguration subsystemFactory = null; //private RemoteFileSubSystemConfiguration subsystemConfiguration = null;
private IRSESystemType[] systemTypes = null; private IRSESystemType[] systemTypes = null;
private IHost connection = null; private IHost connection = null;
private boolean showNewConnectionPrompt = true; private boolean showNewConnectionPrompt = true;
@ -545,7 +546,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo
} }
/** /**
* Returns action to be called when Browse... pressed. * 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) protected SystemSelectRemoteFolderAction getBrowseAction(Shell shell)
{ {

View file

@ -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 * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * 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. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions; package org.eclipse.rse.internal.files.ui.actions;
@ -39,7 +39,7 @@ public class SystemNewFileFilterAction
/** /**
* Constructor * 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, super(shell, parentPool, SystemFileResources.ACTION_NEWFILTER_LABEL, SystemFileResources.ACTION_NEWFILTER_TOOLTIP,

View file

@ -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 * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * 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. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.subsystems.files.core; 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. * 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. * and subsystems shown within those connections are to be subset to only those from this subsystem factory.
*/ */
public class SystemFileSubSystemConfigurationAPIProviderImpl public class SystemFileSubSystemConfigurationAPIProviderImpl
@ -34,18 +34,20 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl
{ {
private IRemoteFileSubSystemConfiguration subsystemFactory = null; private IRemoteFileSubSystemConfiguration subsystemConfiguration = null;
//protected Object[] emptyList = new Object[0]; //protected Object[] emptyList = new Object[0];
/** /**
* Constructor * 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. * @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); super(directoryMode);
this.subsystemFactory = subsystemFactory; this.subsystemConfiguration = subsystemConfiguration;
} }
/** /**
@ -53,7 +55,7 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl
*/ */
public IRemoteFileSubSystemConfiguration getSubSystemConfiguration() public IRemoteFileSubSystemConfiguration getSubSystemConfiguration()
{ {
return subsystemFactory; return subsystemConfiguration;
} }
// ---------------------------------- // ----------------------------------
@ -111,7 +113,7 @@ public class SystemFileSubSystemConfigurationAPIProviderImpl
*/ */
public IHost[] getConnections() 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 * 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() 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)); return ((allOurSubSystems!=null) && (allOurSubSystems.length>0));
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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; 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.IHost;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.ISubSystem; 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.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemTestFilterStringAPIProviderImpl; import org.eclipse.rse.internal.ui.view.SystemTestFilterStringAPIProviderImpl;
import org.eclipse.rse.internal.ui.view.SystemViewForm; import org.eclipse.rse.internal.ui.view.SystemViewForm;
@ -53,7 +55,7 @@ public class SystemTestFilterStringDialog
{ {
protected ISubSystem subsystem = null; protected ISubSystem subsystem = null;
protected ISystemRegistry sr = null; protected ISystemRegistry sr = null;
protected String subsystemFactoryId = null; protected String subsystemConfigurationId = null;
protected String filterString = null; protected String filterString = null;
protected SystemTestFilterStringAPIProviderImpl inputProvider = null; protected SystemTestFilterStringAPIProviderImpl inputProvider = null;
// GUI widgets // GUI widgets
@ -86,7 +88,7 @@ public class SystemTestFilterStringDialog
setBlockOnOpen(true); // always modal setBlockOnOpen(true); // always modal
this.subsystem = subsystem; this.subsystem = subsystem;
this.filterString = filterString; this.filterString = filterString;
this.subsystemFactoryId = subsystem.getSubSystemConfiguration().getId(); this.subsystemConfigurationId = subsystem.getSubSystemConfiguration().getId();
sr = RSECorePlugin.getTheSystemRegistry(); sr = RSECorePlugin.getTheSystemRegistry();
setNeedsProgressMonitor(true); setNeedsProgressMonitor(true);
//pack(); //pack();
@ -175,7 +177,7 @@ public class SystemTestFilterStringDialog
{ {
this.subsystem = subsystem; this.subsystem = subsystem;
this.filterString = filterString; this.filterString = filterString;
//this.subsystemFactoryId = subsystem.getParentSubSystemConfiguration().getId(); //this.subsystemConfigurationId = subsystem.getParentSubSystemConfiguration().getId();
inputProvider.setSubSystem(subsystem); inputProvider.setSubSystem(subsystem);
inputProvider.setFilterString(filterString); inputProvider.setFilterString(filterString);
tree.reset(inputProvider); tree.reset(inputProvider);
@ -197,12 +199,14 @@ public class SystemTestFilterStringDialog
{ {
//System.out.println("connection changed"); //System.out.println("connection changed");
IHost newConnection = connectionCombo.getHost(); IHost newConnection = connectionCombo.getHost();
ISubSystem[] newSubSystems = sr.getSubSystems(subsystemFactoryId, newConnection);
ISubSystem newSubSystem = null; ISubSystem newSubSystem = null;
if ((newSubSystems != null) && (newSubSystems.length>0)) ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId);
{ if (config!=null) {
ISubSystem[] newSubSystems = config.getSubSystems(newConnection, true);
if (newSubSystems != null && newSubSystems.length > 0) {
newSubSystem = newSubSystems[0]; newSubSystem = newSubSystems[0];
subsystemFactoryId = subsystem.getSubSystemConfiguration().getId(); subsystemConfigurationId = subsystem.getSubSystemConfiguration().getId();
}
} }
inputProvider.setSubSystem(newSubSystem); inputProvider.setSubSystem(newSubSystem);
tree.reset(inputProvider); tree.reset(inputProvider);

View file

@ -14,6 +14,7 @@
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * 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; package org.eclipse.rse.internal.ui.view;
@ -61,8 +62,8 @@ public class SystemSelectRemoteObjectAPIProviderImpl
protected boolean listConnectionsMode = false; protected boolean listConnectionsMode = false;
protected boolean showNewConnectionPrompt = false; protected boolean showNewConnectionPrompt = false;
protected boolean singleConnectionMode = false; protected boolean singleConnectionMode = false;
protected String subsystemFactoryId; protected String subsystemConfigurationId;
protected String subsystemFactoryCategory; protected String subsystemConfigurationCategory;
protected String filterSuffix; protected String filterSuffix;
protected IRSESystemType[] systemTypes; protected IRSESystemType[] systemTypes;
protected String preSelectFilterChild; 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 * 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. * 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. * 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. * 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 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 * @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) boolean showNewConnectionPrompt, IRSESystemType[] systemTypes)
{ {
super(); super();
this.subsystemFactoryId = factoryId; this.subsystemConfigurationId = configId;
this.subsystemFactoryCategory = factoryCategory; this.subsystemConfigurationCategory = configCategory;
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
this.showNewConnectionPrompt = showNewConnectionPrompt; this.showNewConnectionPrompt = showNewConnectionPrompt;
this.listConnectionsMode = true; this.listConnectionsMode = true;
@ -135,7 +136,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
/** /**
* Specify system types to restrict what types of connections * Specify system types to restrict what types of connections
* the user can create, and see. * 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 * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types. * <code>null</code> 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! ISubSystem subsystem = subsystems[0]; // always just use first. Hopefully never a problem!
if (subsystems.length > 1) 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) if (quickFilters != null)
{ {
@ -538,10 +539,12 @@ public class SystemSelectRemoteObjectAPIProviderImpl
conns = inputConnections; conns = inputConnections;
else if (systemTypes != null) else if (systemTypes != null)
conns = sr.getHostsBySystemTypes(systemTypes); conns = sr.getHostsBySystemTypes(systemTypes);
else if (subsystemFactoryId != null) else if (subsystemConfigurationId != null) {
conns = sr.getHostsBySubSystemConfigurationId(subsystemFactoryId); ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId);
else if (subsystemFactoryCategory != null) conns = sr.getHostsBySubSystemConfiguration(config);
conns = sr.getHostsBySubSystemConfigurationCategory(subsystemFactoryCategory); }
else if (subsystemConfigurationCategory != null)
conns = sr.getHostsBySubSystemConfigurationCategory(subsystemConfigurationCategory);
else else
conns = sr.getHosts(); conns = sr.getHosts();
@ -571,15 +574,21 @@ public class SystemSelectRemoteObjectAPIProviderImpl
/** /**
* Given a connection, return the subsystem(s) appropriate for the given * Given a connection, return the subsystem(s) appropriate for the given
* ssfactoryid or category * subsystem configuration id or category
*/ */
protected ISubSystem[] getSubSystems(IHost selectedConnection) protected ISubSystem[] getSubSystems(IHost selectedConnection)
{ {
ISubSystem[] subsystems = null; ISubSystem[] subsystems = null;
if (subsystemFactoryId != null) if (subsystemConfigurationId != null) {
subsystems = sr.getSubSystems(subsystemFactoryId, selectedConnection); ISubSystemConfiguration config = sr.getSubSystemConfiguration(subsystemConfigurationId);
else if (subsystemFactoryCategory != null) if (config==null)
subsystems = sr.getSubSystemsBySubSystemConfigurationCategory(subsystemFactoryCategory, selectedConnection); subsystems = new ISubSystem[0];
else
subsystems = config.getSubSystems(selectedConnection, true);
}
else if (subsystemConfigurationCategory != null) {
subsystems = sr.getSubSystemsBySubSystemConfigurationCategory(subsystemConfigurationCategory, selectedConnection);
}
else else
subsystems = sr.getSubSystems(selectedConnection); subsystems = sr.getSubSystems(selectedConnection);
return subsystems; return subsystems;

View file

@ -14,6 +14,7 @@
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * 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) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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; package org.eclipse.rse.internal.ui.view.team;
@ -61,7 +62,7 @@ public class SystemTeamViewContentProvider extends WorkbenchContentProvider
if (element instanceof IProject) if (element instanceof IProject)
{ {
//IProject rseProject = (IProject)element; //IProject rseProject = (IProject)element;
ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getAllSystemProfiles(); ISystemProfile[] profiles = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getSystemProfiles();
children = profiles; children = profiles;
//return profiles; //return profiles;
} }

View file

@ -20,6 +20,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
@ -166,7 +167,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
public SystemConnectionForm(ISystemMessageLine msgLine, ISystemConnectionFormCaller caller) { public SystemConnectionForm(ISystemMessageLine msgLine, ISystemConnectionFormCaller caller) {
this.msgLine = msgLine; this.msgLine = msgLine;
this.caller = caller; this.caller = caller;
this.defaultProfileNames = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfileNames(); this.defaultProfileNames = RSECorePlugin.getTheSystemRegistry().getSystemProfileManager().getActiveSystemProfileNames();
callerInstanceOfWizardPage = caller instanceof IWizardPage; callerInstanceOfWizardPage = caller instanceof IWizardPage;
callerInstanceOfSystemPromptDialog = caller instanceof ISystemPromptDialog; callerInstanceOfSystemPromptDialog = caller instanceof ISystemPromptDialog;
callerInstanceOfPropertyPage = caller instanceof IWorkbenchPropertyPage; callerInstanceOfPropertyPage = caller instanceof IWorkbenchPropertyPage;
@ -1453,7 +1454,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
*/ */
public static ISystemValidator[] getConnectionNameValidators() { public static ISystemValidator[] getConnectionNameValidators() {
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISystemProfile[] profiles = sr.getActiveSystemProfiles(); ISystemProfile[] profiles = sr.getSystemProfileManager().getActiveSystemProfiles();
ISystemValidator[] connNameValidators = new ISystemValidator[profiles.length]; ISystemValidator[] connNameValidators = new ISystemValidator[profiles.length];
for (int idx = 0; idx < profiles.length; idx++) { for (int idx = 0; idx < profiles.length; idx++) {
Vector v = sr.getHostAliasNames(profiles[idx]); Vector v = sr.getHostAliasNames(profiles[idx]);

View file

@ -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 * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * 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. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.filters; package org.eclipse.rse.ui.filters;
@ -275,8 +275,8 @@ public class SystemFilterStringEditPane implements SelectionListener
} }
/** /**
* <i>Getter method, for the use of subclasses. Do not override.</i><br> * <i>Getter method, for the use of subclasses. Do not override.</i><br>
* Return the contextual system filter pool manager provider (ie subsystemFactory) that * 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 factory, or * this was launched from. Will be null if not launched from a subsystem configuration, or
* a filter pool or filter (or reference). * a filter pool or filter (or reference).
* <p> * <p>
* This is not used by default but made available for subclasses. * This is not used by default but made available for subclasses.

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.widgets; 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 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 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 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 * @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); super(parent, style);
if (showNewButton) // this is expensive, so only need to do this if New is enabled 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(); Vector vTypes = new Vector();
for (int idx = 0; idx < ssfProxies.length; idx++) { for (int idx = 0; idx < ssfProxies.length; idx++) {
// Do not call ISubSystemConfigurationProxy.getSystemTypes() directly. If // 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()]); restrictSystemTypesTo = (IRSESystemType[])vTypes.toArray(new IRSESystemType[vTypes.size()]);
} }
init(parent, showNewButton, showLabel); init(parent, showNewButton, showLabel);
populateSSFactoryCategory = ssFactoryCategory; populateSSFactoryCategory = ssConfigCategory;
populateConnectionCombo(connectionCombo, defaultConnection, ssFactoryCategory); populateConnectionCombo(connectionCombo, defaultConnection, ssConfigCategory);
setConnectionToolTipText(); setConnectionToolTipText();
addOurConnectionSelectionListener(); addOurConnectionSelectionListener();
} }
@ -617,7 +618,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
return composite; 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. * layout data, with tooltip text.
* Assign the listener to the passed in implementer of Listener. * Assign the listener to the passed in implementer of Listener.
* <p> * <p>
@ -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. * system type.
* <p> * <p>
* This fills the combination with the names of all the active connections of the given * 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. * system type.
* <p> * <p>
* This fills the combination with the names of all the active connections of the given * 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; 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. * array of system types.
* @param combo composite to populate * @param combo composite to populate
* @param systemTypes the system types to restrict the connection list to. Pass null or * for all system types * @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); 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. * owned by the given subsystem factory.
* <p> * <p>
* @param combo composite to populate * @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. * @param defaultConnection the default system connection to preselect.
* @return true if given default connection was found and selected * @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); 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. * owned by a subsystem factory of the given subsystem factory id.
* <p> * <p>
* @param combo composite to populate * @param combo composite to populate
* @param defaultConnection the default system connection to preselect. * @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 * @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); 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. * owned by a subsystem factory of the given subsystem factory category.
* <p> * <p>
* @param combo composite to populate * @param combo composite to populate
* @param defaultConnection the default system connection to preselect. * @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 * @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); return addConnections(combo, connections, defaultConnection);
} }
/** /**

View file

@ -12,11 +12,15 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards; package org.eclipse.rse.ui.wizards;
import java.util.Vector;
import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
@ -62,7 +66,12 @@ public class SystemNewProfileWizardMainPage
super(wizard, "NewProfile", //$NON-NLS-1$ super(wizard, "NewProfile", //$NON-NLS-1$
SystemResources.RESID_NEWPROFILE_PAGE1_TITLE, SystemResources.RESID_NEWPROFILE_PAGE1_TITLE,
SystemResources.RESID_NEWPROFILE_PAGE1_DESCRIPTION); 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<profiles.length; i++) {
profileNames.add(profiles[i].getName());
}
nameValidator = new ValidatorProfileName(profileNames);
setHelp(HELPID_PREFIX+"0000"); //$NON-NLS-1$ setHelp(HELPID_PREFIX+"0000"); //$NON-NLS-1$
} }

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
@ -58,7 +59,7 @@ import org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter;
public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizard { public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizard {
private RSEDefaultNewConnectionWizardMainPage mainPage; private RSEDefaultNewConnectionWizardMainPage mainPage;
private ISystemNewConnectionWizardPage[] subsystemFactorySuppliedWizardPages; private ISystemNewConnectionWizardPage[] subsystemConfigurationSuppliedWizardPages;
private Map ssfWizardPagesPerSystemType = new Hashtable(); private Map ssfWizardPagesPerSystemType = new Hashtable();
private String defaultUserId; private String defaultUserId;
private String defaultConnectionName; private String defaultConnectionName;
@ -89,7 +90,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
super.dispose(); super.dispose();
mainPage = null; mainPage = null;
subsystemFactorySuppliedWizardPages = null; subsystemConfigurationSuppliedWizardPages = null;
ssfWizardPagesPerSystemType.clear(); ssfWizardPagesPerSystemType.clear();
defaultUserId = null; defaultUserId = null;
defaultHostName = null; defaultHostName = null;
@ -109,7 +110,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
IRSESystemType systemType = getSystemType(); IRSESystemType systemType = getSystemType();
mainPage.setTitle(getPageTitle()); mainPage.setTitle(getPageTitle());
mainPage.setSystemType(systemType); mainPage.setSystemType(systemType);
subsystemFactorySuppliedWizardPages = getAdditionalWizardPages(systemType); subsystemConfigurationSuppliedWizardPages = getAdditionalWizardPages(systemType);
} }
} }
@ -153,7 +154,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
mainPage = new RSEDefaultNewConnectionWizardMainPage(this, getPageTitle(), SystemResources.RESID_NEWCONN_PAGE1_DESCRIPTION); mainPage = new RSEDefaultNewConnectionWizardMainPage(this, getPageTitle(), SystemResources.RESID_NEWCONN_PAGE1_DESCRIPTION);
mainPage.setTitle(getPageTitle()); mainPage.setTitle(getPageTitle());
mainPage.setSystemType(systemType); mainPage.setSystemType(systemType);
subsystemFactorySuppliedWizardPages = systemType != null ? getAdditionalWizardPages(systemType) : null; subsystemConfigurationSuppliedWizardPages = systemType != null ? getAdditionalWizardPages(systemType) : null;
} }
return mainPage; return mainPage;
@ -293,10 +294,10 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
if (!ok) if (!ok)
setPageError(mainPage); setPageError(mainPage);
else if (ok && hasAdditionalPages()) { else if (ok && hasAdditionalPages()) {
for (int idx = 0; ok && (idx < subsystemFactorySuppliedWizardPages.length); idx++) { for (int idx = 0; ok && (idx < subsystemConfigurationSuppliedWizardPages.length); idx++) {
ok = subsystemFactorySuppliedWizardPages[idx].performFinish(); ok = subsystemConfigurationSuppliedWizardPages[idx].performFinish();
if (!ok) if (!ok)
setPageError((IWizardPage)subsystemFactorySuppliedWizardPages[idx]); setPageError((IWizardPage)subsystemConfigurationSuppliedWizardPages[idx]);
} }
} }
if (ok) { if (ok) {
@ -330,7 +331,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
SystemConnectionForm form = mainPage.getSystemConnectionForm(); SystemConnectionForm form = mainPage.getSystemConnectionForm();
IHost conn = sr.createHost(form.getProfileName(), systemType, form.getConnectionName(), form.getHostName(), IHost conn = sr.createHost(form.getProfileName(), systemType, form.getConnectionName(), form.getHostName(),
form.getConnectionDescription(), form.getDefaultUserId(), form.getUserIdLocation(), form.getConnectionDescription(), form.getDefaultUserId(), form.getUserIdLocation(),
subsystemFactorySuppliedWizardPages); subsystemConfigurationSuppliedWizardPages);
setBusyCursor(false); setBusyCursor(false);
cursorSet = false; cursorSet = false;
@ -376,8 +377,8 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
private ISystemNewConnectionWizardPage[] getAdditionalWizardPages(IRSESystemType systemType) { private ISystemNewConnectionWizardPage[] getAdditionalWizardPages(IRSESystemType systemType) {
assert systemType != null; assert systemType != null;
// this query is expensive, so only do it once... // this query is expensive, so only do it once...
subsystemFactorySuppliedWizardPages = (ISystemNewConnectionWizardPage[])ssfWizardPagesPerSystemType.get(systemType); subsystemConfigurationSuppliedWizardPages = (ISystemNewConnectionWizardPage[])ssfWizardPagesPerSystemType.get(systemType);
if (subsystemFactorySuppliedWizardPages == null) { if (subsystemConfigurationSuppliedWizardPages == null) {
// query all affected subsystems for their list of additional wizard pages... // query all affected subsystems for their list of additional wizard pages...
Vector additionalPages = new Vector(); Vector additionalPages = new Vector();
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
@ -393,12 +394,12 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
} }
} }
} }
subsystemFactorySuppliedWizardPages = new ISystemNewConnectionWizardPage[additionalPages.size()]; subsystemConfigurationSuppliedWizardPages = new ISystemNewConnectionWizardPage[additionalPages.size()];
for (int idx = 0; idx < subsystemFactorySuppliedWizardPages.length; idx++) for (int idx = 0; idx < subsystemConfigurationSuppliedWizardPages.length; idx++)
subsystemFactorySuppliedWizardPages[idx] = (ISystemNewConnectionWizardPage)additionalPages.elementAt(idx); subsystemConfigurationSuppliedWizardPages[idx] = (ISystemNewConnectionWizardPage)additionalPages.elementAt(idx);
ssfWizardPagesPerSystemType.put(systemType, subsystemFactorySuppliedWizardPages); ssfWizardPagesPerSystemType.put(systemType, subsystemConfigurationSuppliedWizardPages);
} }
return subsystemFactorySuppliedWizardPages; return subsystemConfigurationSuppliedWizardPages;
} }
/** /**
@ -406,20 +407,20 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
* on the main page * on the main page
*/ */
protected boolean hasAdditionalPages() { protected boolean hasAdditionalPages() {
return (subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length > 0); return (subsystemConfigurationSuppliedWizardPages != null) && (subsystemConfigurationSuppliedWizardPages.length > 0);
} }
/** /**
* Return the first additional page to show when user presses Next on the main page * Return the first additional page to show when user presses Next on the main page
*/ */
protected ISystemNewConnectionWizardPage getFirstAdditionalPage() { protected ISystemNewConnectionWizardPage getFirstAdditionalPage() {
if ((subsystemFactorySuppliedWizardPages != null) && (subsystemFactorySuppliedWizardPages.length > 0)) { if ((subsystemConfigurationSuppliedWizardPages != null) && (subsystemConfigurationSuppliedWizardPages.length > 0)) {
IWizardPage previousPage = mainPage; IWizardPage previousPage = mainPage;
for (int idx = 0; idx < subsystemFactorySuppliedWizardPages.length; idx++) { for (int idx = 0; idx < subsystemConfigurationSuppliedWizardPages.length; idx++) {
((IWizardPage)subsystemFactorySuppliedWizardPages[idx]).setPreviousPage(previousPage); ((IWizardPage)subsystemConfigurationSuppliedWizardPages[idx]).setPreviousPage(previousPage);
previousPage = (IWizardPage)subsystemFactorySuppliedWizardPages[idx]; previousPage = (IWizardPage)subsystemConfigurationSuppliedWizardPages[idx];
} }
return subsystemFactorySuppliedWizardPages[0]; return subsystemConfigurationSuppliedWizardPages[0];
} else } else
return null; return null;
} }
@ -437,10 +438,10 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
return null; return null;
else { else {
int index = getAdditionalPageIndex(page); int index = getAdditionalPageIndex(page);
if ((index == (subsystemFactorySuppliedWizardPages.length - 1))) if ((index == (subsystemConfigurationSuppliedWizardPages.length - 1)))
// last page or page not found // last page or page not found
return null; 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) { private int getAdditionalPageIndex(IWizardPage page) {
for (int idx = 0; idx < subsystemFactorySuppliedWizardPages.length; idx++) { for (int idx = 0; idx < subsystemConfigurationSuppliedWizardPages.length; idx++) {
if (page == subsystemFactorySuppliedWizardPages[idx]) if (page == subsystemConfigurationSuppliedWizardPages[idx])
return idx; return idx;
} }
return -1; return -1;
@ -466,8 +467,8 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
boolean ok = mainPage.isPageComplete(); boolean ok = mainPage.isPageComplete();
if (ok && hasAdditionalPages()) { if (ok && hasAdditionalPages()) {
for (int idx = 0; ok && (idx < subsystemFactorySuppliedWizardPages.length); idx++) for (int idx = 0; ok && (idx < subsystemConfigurationSuppliedWizardPages.length); idx++)
ok = subsystemFactorySuppliedWizardPages[idx].isPageComplete(); ok = subsystemConfigurationSuppliedWizardPages[idx].isPageComplete();
} }
return ok; return ok;
} }

View file

@ -29,6 +29,7 @@
* Martin Oberhuber (Wind River) - [186773] split SystemRegistryUI from SystemRegistry implementation * 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] Prepare ISystemRegistry for move into non-UI
* Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core * 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; package org.eclipse.rse.ui.internal.model;
@ -113,7 +114,7 @@ public class SystemRegistry implements ISystemRegistry
private int modelListenerCount = 0; private int modelListenerCount = 0;
private int remoteListCount = 0; private int remoteListCount = 0;
private ISubSystemConfigurationProxy[] subsystemFactoryProxies = null; private ISubSystemConfigurationProxy[] subsystemConfigurationProxies = null;
private boolean errorLoadingFactory = false; private boolean errorLoadingFactory = false;
/** /**
@ -200,14 +201,14 @@ public class SystemRegistry implements ISystemRegistry
return true; // much faster and safer return true; // much faster and safer
/* /*
boolean hasSubsystems = false; 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()) && if (subsystemConfigurationProxies[idx].appliesToSystemType(selectedConnection.getSystemType().getName()) &&
subsystemFactoryProxies[idx].isSubSystemConfigurationActive()) subsystemConfigurationProxies[idx].isSubSystemConfigurationActive())
{ {
SubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); SubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
{ {
SubSystem[] sss = factory.getSubSystems(selectedConnection, SubSystemConfiguration.LAZILY); SubSystem[] sss = factory.getSubSystems(selectedConnection, SubSystemConfiguration.LAZILY);
@ -247,7 +248,7 @@ public class SystemRegistry implements ISystemRegistry
*/ */
public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies) public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies)
{ {
subsystemFactoryProxies = proxies; subsystemConfigurationProxies = proxies;
//for (int idx=0; idx<proxies.length; idx++) //for (int idx=0; idx<proxies.length; idx++)
// proxies[idx].setLogFile(logFile); // proxies[idx].setLogFile(logFile);
} }
@ -256,7 +257,7 @@ public class SystemRegistry implements ISystemRegistry
*/ */
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies() public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies()
{ {
return subsystemFactoryProxies; return subsystemConfigurationProxies;
} }
/** /**
@ -266,11 +267,11 @@ public class SystemRegistry implements ISystemRegistry
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory) public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory)
{ {
Vector v = new Vector(); 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))
v.addElement(subsystemFactoryProxies[idx]); v.addElement(subsystemConfigurationProxies[idx]);
} }
ISubSystemConfigurationProxy[] proxies = new ISubSystemConfigurationProxy[v.size()]; ISubSystemConfigurationProxy[] proxies = new ISubSystemConfigurationProxy[v.size()];
for (int idx = 0; idx < v.size(); idx++) for (int idx = 0; idx < v.size(); idx++)
@ -317,13 +318,13 @@ public class SystemRegistry implements ISystemRegistry
public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory) public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory)
{ {
Vector v = new Vector(); 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) if (factory != null)
v.addElement(factory); v.addElement(factory);
} }
@ -347,11 +348,11 @@ public class SystemRegistry implements ISystemRegistry
List serviceTypesAdded = new ArrayList(); List serviceTypesAdded = new ArrayList();
List serviceImplsAdded = new ArrayList(); List serviceImplsAdded = new ArrayList();
Vector v = new Vector(); 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++)
{ {
ISubSystemConfigurationProxy ssfProxy = subsystemFactoryProxies[idx]; ISubSystemConfigurationProxy ssfProxy = subsystemConfigurationProxies[idx];
if (ssfProxy.appliesToSystemType(systemType)) if (ssfProxy.appliesToSystemType(systemType))
{ {
ISubSystemConfiguration ssFactory = ssfProxy.getSubSystemConfiguration(); ISubSystemConfiguration ssFactory = ssfProxy.getSubSystemConfiguration();
@ -440,13 +441,13 @@ public class SystemRegistry implements ISystemRegistry
*/ */
public void setShowFilterPools(boolean show) public void setShowFilterPools(boolean show)
{ {
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].isSubSystemConfigurationActive()) if (subsystemConfigurationProxies[idx].isSubSystemConfigurationActive())
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if ((factory != null) && factory.supportsFilters()) if ((factory != null) && factory.supportsFilters())
factory.setShowFilterPools(show); factory.setShowFilterPools(show);
} }
@ -458,13 +459,13 @@ public class SystemRegistry implements ISystemRegistry
* *
public void setShowFilterStrings(boolean show) public void setShowFilterStrings(boolean show)
{ {
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].isSubSystemConfigurationActive()) if (subsystemConfigurationProxies[idx].isSubSystemConfigurationActive())
{ {
SubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); SubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if ((factory!=null)&&factory.supportsFilters()) if ((factory!=null)&&factory.supportsFilters())
factory.setShowFilterStrings(show); factory.setShowFilterStrings(show);
} }
@ -748,9 +749,9 @@ public class SystemRegistry implements ISystemRegistry
if (newConns != null) if (newConns != null)
for (int idx = 0; idx < newConns.length; idx++) for (int idx = 0; idx < newConns.length; idx++)
deleteHost(newConns[idx]); deleteHost(newConns[idx]);
for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++)
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
factory.deletingSystemProfile(newProfile); factory.deletingSystemProfile(newProfile);
} }
@ -798,11 +799,11 @@ public class SystemRegistry implements ISystemRegistry
deleteHost(connections[idx]); deleteHost(connections[idx]);
} }
// step 2: bring to life every factory and ask it to delete all filter pools for this profile // step 2: bring to life every factory and ask it to delete all filter pools for this profile
if (subsystemFactoryProxies != null) if (subsystemConfigurationProxies != null)
{ {
for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++)
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
factory.deletingSystemProfile(profile); factory.deletingSystemProfile(profile);
} }
@ -827,13 +828,13 @@ public class SystemRegistry implements ISystemRegistry
{ {
// Test if there are any filter pools in this profile that are referenced by another active profile... // Test if there are any filter pools in this profile that are referenced by another active profile...
Vector activeReferenceVector = new Vector(); Vector activeReferenceVector = new Vector();
if (!makeActive && (subsystemFactoryProxies != null)) if (!makeActive && (subsystemConfigurationProxies != null))
{ {
for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++)
{ {
//if (subsystemFactoryProxies[idx].isSubSystemConfigurationActive()) // don't bother if not yet alive //if (subsystemConfigurationProxies[idx].isSubSystemConfigurationActive()) // don't bother if not yet alive
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
{ {
ISubSystem[] activeReferences = factory.testForActiveReferences(profile); ISubSystem[] activeReferences = factory.testForActiveReferences(profile);
@ -873,13 +874,13 @@ public class SystemRegistry implements ISystemRegistry
// To be safe, we tell each subsystem factory about the change in status. // To be safe, we tell each subsystem factory about the change in status.
// At a minimum, each factory may have to load the subsystems for connections that // At a minimum, each factory may have to load the subsystems for connections that
// are suddenly active. // are suddenly active.
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].isSubSystemConfigurationActive()) // don't bother if not yet alive if (subsystemConfigurationProxies[idx].isSubSystemConfigurationActive()) // don't bother if not yet alive
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
factory.changingSystemProfileActiveStatus(profile, makeActive); factory.changingSystemProfileActiveStatus(profile, makeActive);
} }
@ -974,13 +975,13 @@ public class SystemRegistry implements ISystemRegistry
ISubSystem[] subsystems = null; ISubSystem[] subsystems = null;
Vector v = new Vector(); 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())) // if (subsystemConfigurationProxies[idx].appliesToSystemType(conn.getSystemType()))
// { // {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
{ {
ISubSystem[] sss = factory.getSubSystems(conn, force); ISubSystem[] sss = factory.getSubSystems(conn, force);
@ -1002,7 +1003,7 @@ public class SystemRegistry implements ISystemRegistry
/** /**
* Resolve a subsystem from it's absolute name. The absolute name of a subsystem * Resolve a subsystem from it's absolute name. The absolute name of a subsystem
* is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemFactoryId</I> * is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I>
* *
* @param absoluteSubSystemName the name of the subsystem * @param absoluteSubSystemName the name of the subsystem
* *
@ -1020,29 +1021,40 @@ public class SystemRegistry implements ISystemRegistry
String srcConnectionName = absoluteSubSystemName.substring(profileDelim + 1, connectionDelim); String srcConnectionName = absoluteSubSystemName.substring(profileDelim + 1, connectionDelim);
String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length()); String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length());
return getSubSystem(srcProfileName, srcConnectionName, srcSubSystemConfigurationId); ISystemProfile profile = getSystemProfile(srcProfileName);
return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId);
} }
return null; 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. * 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 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 * @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 // find the src connection
IHost[] connections = registry.getHostsByProfile(srcProfileName); IHost[] connections = getHostsByProfile(profile);
if (connections == null) if (connections == null)
{ {
// if the profile can't be found, get all connections // if the profile can't be found, get all connections
connections = registry.getHosts(); connections = getHosts();
} }
for (int i = 0; i < connections.length; i++) for (int i = 0; i < connections.length; i++)
@ -1057,7 +1069,7 @@ public class SystemRegistry implements ISystemRegistry
{ {
ISubSystem subsystem = subsystems[s]; ISubSystem subsystem = subsystems[s];
String compareId = subsystem.getConfigurationId(); String compareId = subsystem.getConfigurationId();
if (compareId.equals(subsystemFactoryId)) if (compareId.equals(subsystemConfigurationId))
{ {
return subsystem; return subsystem;
} }
@ -1065,7 +1077,7 @@ public class SystemRegistry implements ISystemRegistry
{ {
// for migration purposes, test the against the name // for migration purposes, test the against the name
// we used to use the subsystem name instead of the factory Id // we used to use the subsystem name instead of the factory Id
if (subsystem.getName().equals(subsystemFactoryId)) if (subsystem.getName().equals(subsystemConfigurationId))
{ {
return subsystem; return subsystem;
} }
@ -1130,13 +1142,13 @@ public class SystemRegistry implements ISystemRegistry
ISubSystem[] subsystems = null; ISubSystem[] subsystems = null;
Vector v = new Vector(); 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) if (factory != null)
{ {
ISubSystem[] sss = factory.getSubSystems(conn, ISubSystemConfiguration.LAZILY); 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 * 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. * 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); ISubSystemConfiguration config = getSubSystemConfiguration(configId);
if (factory == null) if (config == null)
return (new ISubSystem[0]); 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 * 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) public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory)
{ {
Vector v = new Vector(); 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) if (factory != null)
{ {
ISubSystem[] subsystems = factory.getSubSystems(true); // true ==> force full restore ISubSystem[] subsystems = factory.getSubSystems(true); // true ==> force full restore
@ -1654,7 +1666,14 @@ public class SystemRegistry implements ISystemRegistry
*/ */
public Vector getHostAliasNames(ISystemProfile profile) 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(); Vector allNames = new Vector();
for (int idx = 0; idx < allPools.length; idx++) 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++) for (int jdx = 0; jdx < v.size(); jdx++)
allNames.addElement(v.elementAt(jdx)); allNames.addElement(v.elementAt(jdx));
} }