1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 07:35:24 +02:00

[175680] [api] ISystemRegistry API should be cleaned up, action items 1 and 4

This commit is contained in:
Uwe Stieber 2007-02-27 11:17:30 +00:00
parent 8e6cb9781b
commit c5cb2ba26e
2 changed files with 50 additions and 0 deletions

View file

@ -21,6 +21,7 @@ import java.util.Vector;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterStartHere;
import org.eclipse.rse.core.subsystems.IConnectorService;
@ -36,6 +37,8 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
* The idea here is that connections are grouped by system profile. At any
* time, there is a user-specified number of profiles "active" and connections
* from each active profile are worked with.
* <p>
* This interface is not intended to be implemented by clients.
*/
public interface ISystemRegistry extends ISchedulingRule {
@ -109,6 +112,12 @@ public interface ISystemRegistry extends ISchedulingRule {
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory);
/**
* Return all subsystem factories which support the given system type. If the type is null,
* returns all.
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType);
/**
* Return all subsystem factories which support the given system type. If the type is null,
* returns all.
@ -368,6 +377,15 @@ public interface ISystemRegistry extends ISchedulingRule {
*/
public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory);
/**
* Returns all connections for all active profiles, for the given system type.
* If the specified system type is null, an empty array is returned.
*
* @param systemType The system type instance.
* @return The list of connections or an empty array.
*/
public IHost[] getHostsBySystemType(IRSESystemType systemType);
/**
* Return all connections for all active profiles, for the given system type.
*/

View file

@ -602,6 +602,16 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
return factories;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystemConfigurationsBySystemType(org.eclipse.rse.core.IRSESystemType)
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType) {
return getSubSystemConfigurationsBySystemType(systemType != null ? systemType.getName() : null);
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystemConfigurationsBySystemType(java.lang.String)
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType)
{
return getSubSystemConfigurationsBySystemType(systemType, false);
@ -1757,6 +1767,28 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
return conns;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(org.eclipse.rse.core.IRSESystemType)
*/
public IHost[] getHostsBySystemType(IRSESystemType systemType) {
List connections = new ArrayList();
if (systemType != null) {
IHost[] candidates = getHosts();
for (int i = 0; i < candidates.length; i++) {
IHost candidate = candidates[i];
//FIXME: If IHost.getSystemType() returns the id or the IRSESystemType
// object, this comparisation must be adapted.
IRSESystemType candidateType = RSECorePlugin.getDefault().getRegistry().getSystemType(candidate.getSystemType());
if (systemType.equals(candidateType)) {
connections.add(candidate);
}
}
}
return (IHost[])connections.toArray(new IHost[connections.size()]);
}
/**
* Return all connections for all active profiles, for the given system type.
* Never returns null!