1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

[168864] Add IRSEUserIdConstants. Change references where compatible from ISystemUserIdConstants to IRSEUserIdConstants.

This commit is contained in:
David Dykstal 2006-12-21 21:51:57 +00:00
parent 8151b81c20
commit 966ed36c7c
11 changed files with 100 additions and 48 deletions

View file

@ -0,0 +1,51 @@
/********************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
********************************************************************************/
package org.eclipse.rse.core;
/**
* Constants for user id management. Used when specifying the scope of a user id when
* setting a user id.
*/
public interface IRSEUserIdConstants {
/**
* Value 0. Location of user id has not yet been set. Used only as a return value.
*/
public static final int USERID_LOCATION_NOTSET = 0;
/**
* Value 1. Location of user id is scoped to the connector service inside the host.
*/
public static final int USERID_LOCATION_CONNECTORSERVICE = 1;
/**
* Value 2. Location of user id is scoped to the host, sometimes call "connection".
*/
public static final int USERID_LOCATION_HOST = 2;
/**
* Value 3. Location of user id is scoped to system type. It will be the default
* for all hosts of this system type that do not have a specified user id assigned.
*/
public static final int USERID_LOCATION_DEFAULT_SYSTEMTYPE = 3;
/**
* Value 4. Location of user id is scoped to workspace.
*/
public static final int USERID_LOCATION_DEFAULT_OVERALL = 4;
}

View file

@ -32,8 +32,7 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
/**
* Registry or front door for all remote system connections.
* There is a singleton of the class implementation of this interface.
* To get it, call the {@link org.eclipse.rse.ui.RSEUIPlugin#getTheSystemRegistry() getTheSystemRegistry}
* method in the RSEUIPlugin object.
* To get it, call the {@link org.eclipse.rse.core.RSECorePlugin#getSystemRegistry()}.
* <p>
* 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
@ -259,15 +258,15 @@ public interface ISystemRegistry extends ISchedulingRule
/**
* Return the absolute name for the specified subsystem
* @param the subsystem
* @param subsystem the subsystem to query
* @return the absolute name of the subsystem
*/
public String getAbsoluteNameForSubSystem(ISubSystem subsystem);
/**
* Return the absolute name for the specified connection
* @param the connection
* @return the absolute name of the connection
* Return the absolute name for the specified host (connection)
* @param connection the host (aka connection) object to query
* @return the absolute name of the host
*/
public String getAbsoluteNameForConnection(IHost connection);
@ -419,16 +418,15 @@ public interface ISystemRegistry extends ISchedulingRule
public IHost createLocalHost(ISystemProfile profile, String name, String userId);
/**
* Create a connection object, given the connection pool and given all the possible attributes.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN
* THE POOL YOU SPECIFY. THE POOL IS ALSO SAVED TO DISK.
* Create a host object, sometimes called a "connection",
* given the containing profile and given all the possible attributes.
* The profile is then scheduled to be persisted.
* <p>
* This method:
* <ul>
* <li>creates and saves a new connection within the given profile
* <li>calls all subsystem factories to give them a chance to create a subsystem instance
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* <li>creates and saves a new connection within the given profile
* <li>calls all subsystem factories to give them a chance to create a subsystem instance
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* </ul>
* <p>
* @param profileName Name of the system profile the connection is to be added to.
@ -438,12 +436,12 @@ public interface ISystemRegistry extends ISchedulingRule
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants}
* that tells us where to set the user Id
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to store the user Id
* @param newConnectionWizardPages when called from the New Connection wizard this is union of the list of additional
* wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null.
* wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null.
* @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary.
* because the connectionName is not unique. Call getLastException() if necessary.
*/
public IHost createHost(String profileName, String systemType,
String connectionName, String hostName,
@ -541,9 +539,8 @@ public interface ISystemRegistry extends ISchedulingRule
* <li>The connection's name must be unique in pool.
* <li>Fires a single ISystemResourceChangeEvent event of type EVENT_MOVE, if the pool is the private pool.
* </ul>
* <b>TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION?</b>
* @param conns Array of SystemConnections to move.
* @param newPosition new zero-based position for the connection
* @param delta new zero-based position for the connection
*/
public void moveHosts(String profileName, IHost conns[], int delta);
/**

View file

@ -27,6 +27,7 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemBasePlugin;
@ -117,7 +118,7 @@ public class SystemConnectionForm
protected int descriptionLength = 100;
// state/output
protected int userIdLocation = USERID_LOCATION_CONNECTION;
protected int userIdLocation = IRSEUserIdConstants.USERID_LOCATION_HOST;
protected boolean callerInstanceOfWizardPage, callerInstanceOfSystemPromptDialog, callerInstanceOfPropertyPage;
protected boolean userIdFromSystemTypeDefault;
protected boolean updateMode = false;
@ -463,12 +464,12 @@ public class SystemConnectionForm
{
isLocal = textUserId.isLocal();
if (isLocal)
userIdLocation = USERID_LOCATION_CONNECTION; // edit this connection's local value
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_HOST; // edit this connection's local value
else
userIdLocation = USERID_LOCATION_DEFAULT_SYSTEMTYPE; // edit the preference value
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE; // edit the preference value
}
else
userIdLocation = USERID_LOCATION_NOTSET;
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET;
SystemPreferencesManager.getPreferencesManager().setVerifyConnection(verifyHostNameCB.getSelection());
}
@ -593,7 +594,7 @@ public class SystemConnectionForm
if ((textUserId != null) && (textUserId.getText().trim().length()>0))
return userIdLocation;
else
return USERID_LOCATION_NOTSET;
return IRSEUserIdConstants.USERID_LOCATION_NOTSET;
}
// --------------------
@ -798,7 +799,7 @@ public class SystemConnectionForm
caller.systemTypeSelected(restrictSystemTypesTo[0], true);
if (textUserId == null)
userIdLocation = USERID_LOCATION_NOTSET;
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET;
return composite_prompts; // composite;
}

View file

@ -22,6 +22,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemPreferencesManager;
@ -467,12 +468,12 @@ public class SystemViewConnectionAdapter
else if (property.equals(P_HOSTNAME))
{
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
original_hostName, conn.getDescription(), conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
original_hostName, conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
}
else if (property.equals(P_DESCRIPTION))
{
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
conn.getHostName(), original_description, conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
conn.getHostName(), original_description, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
}
}
/**
@ -480,7 +481,7 @@ public class SystemViewConnectionAdapter
*/
private void updateDefaultUserId(IHost conn, SystemInheritablePropertyData data)
{
int whereToUpdate = USERID_LOCATION_CONNECTION;
int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST;
//if (!data.getIsLocal())
//whereToUpdate = USERID_LOCATION_DEFAULT_SYSTEMTYPE;
String userId = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override
@ -513,7 +514,7 @@ public class SystemViewConnectionAdapter
if (!((String)value).equalsIgnoreCase(conn.getHostName()))
{
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
(String)value, conn.getDescription(), conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
(String)value, conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_hostName = true;
}
}
@ -524,7 +525,7 @@ public class SystemViewConnectionAdapter
if (!((String)value).equalsIgnoreCase(conn.getDescription()))
{
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(),
conn.getHostName(), (String)value, conn.getDefaultUserId(), USERID_LOCATION_NOTSET);
conn.getHostName(), (String)value, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_description = true;
}
}

View file

@ -256,7 +256,7 @@ public class RSENewConnectionWizardDefaultDelegateMainPage
}
/**
* Return location where default user id is to be set.
* @see org.eclipse.rse.core.ISystemUserIdConstants
* @see org.eclipse.rse.core.IRSEUserIdConstants
*/
public int getDefaultUserIdLocation()
{

View file

@ -246,7 +246,7 @@ public class SystemNewConnectionWizardDefaultMainPage
}
/**
* Return location where default user id is to be set.
* @see org.eclipse.rse.core.ISystemUserIdConstants
* @see org.eclipse.rse.core.IRSEUserIdConstants
*/
public int getDefaultUserIdLocation()
{

View file

@ -20,7 +20,7 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.SystemPreferencesManager;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemHostPool;
@ -160,7 +160,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
public IHost createHost(String systemType, String aliasName, String hostName)
throws Exception
{
return createHost(systemType,aliasName,hostName,null,null,ISystemUserIdConstants.USERID_LOCATION_CONNECTION);
return createHost(systemType,aliasName,hostName,null,null,IRSEUserIdConstants.USERID_LOCATION_HOST);
}
/**
* Create a connection object, given all the possible attributes except default userId.
@ -177,7 +177,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
public IHost createHost(String systemType, String aliasName, String hostName, String description)
throws Exception
{
return createHost(systemType,aliasName,hostName,description,null,ISystemUserIdConstants.USERID_LOCATION_CONNECTION);
return createHost(systemType,aliasName,hostName,description,null,IRSEUserIdConstants.USERID_LOCATION_HOST);
}
/**
* Create a connection object, given all the possible attributes.
@ -211,7 +211,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
conn.setHostPool(this);
conn.setAliasName(aliasName);
// if default userID is null, and location is in the connection we should retrieve it and use it as the initial value.
if (defaultUserId == null && defaultUserIdLocation == ISystemUserIdConstants.USERID_LOCATION_CONNECTION) {
if (defaultUserId == null && defaultUserIdLocation == IRSEUserIdConstants.USERID_LOCATION_HOST) {
defaultUserId = conn.getDefaultUserId();
}
updateHost(conn, systemType, aliasName, hostName, description, defaultUserId, defaultUserIdLocation);
@ -249,16 +249,16 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
renameHost(conn,aliasName);
conn.setSystemType(systemType);
conn.setHostName(hostName);
if (defaultUserIdLocation != ISystemUserIdConstants.USERID_LOCATION_NOTSET)
if (defaultUserIdLocation != IRSEUserIdConstants.USERID_LOCATION_NOTSET)
{
if (defaultUserIdLocation != ISystemUserIdConstants.USERID_LOCATION_CONNECTION)
if (defaultUserIdLocation != IRSEUserIdConstants.USERID_LOCATION_HOST)
{
conn.setDefaultUserId(null); // clear what was there, to ensure inheritance
SystemPreferencesManager prefMgr = SystemPreferencesManager.getPreferencesManager();
boolean forceToUpperCase = conn.getForceUserIdToUpperCase();
if (forceToUpperCase && (defaultUserId != null))
defaultUserId = defaultUserId.toUpperCase();
if (defaultUserIdLocation == ISystemUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE)
if (defaultUserIdLocation == IRSEUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE)
{
prefMgr.setDefaultUserId(systemType, defaultUserId);
}
@ -423,7 +423,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
{
IHost copy =
targetPool.createHost(conn.getSystemType(), aliasName,
conn.getHostName(), conn.getDescription(), conn.getLocalDefaultUserId(), ISystemUserIdConstants.USERID_LOCATION_CONNECTION);
conn.getHostName(), conn.getDescription(), conn.getLocalDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_HOST);
return copy;
}

View file

@ -44,7 +44,7 @@ public interface ISystemRegistryUI extends ISystemRegistry {
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants}
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
* @param defaultUserId userId to use as the default for the subsystems.
*/

View file

@ -29,7 +29,7 @@ import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.SystemBasePlugin;
@ -2122,7 +2122,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
// DY: defect 42101, description cannot be null
// null, // description
userId, // default user Id
ISystemUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE, null);
IRSEUserIdConstants.USERID_LOCATION_DEFAULT_SYSTEMTYPE, null);
}
catch (Exception exc)
@ -2152,7 +2152,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants}
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
* @param newConnectionWizardPages when called from the New Connection wizard this is union of the list of additional
* wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null.
@ -2268,7 +2268,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
public IHost createHost(String profileName, String systemType, String connectionName, String hostName, String description)
throws Exception
{
return createHost(profileName, systemType, connectionName, hostName, description, null, ISystemUserIdConstants.USERID_LOCATION_CONNECTION, null);
return createHost(profileName, systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, null);
}
/**
* Create a connection object. This is a very simplified version that defaults to the user's
@ -2298,7 +2298,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
ISystemProfile profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
if (profile == null)
profile = getSystemProfileManager().getActiveSystemProfiles()[0];
return createHost(profile.getName(), systemType, connectionName, hostName, description, null, ISystemUserIdConstants.USERID_LOCATION_CONNECTION, null);
return createHost(profile.getName(), systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, null);
}
/**
* Return the previous connection as would be shown in the view
@ -2342,7 +2342,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants}
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/
public void updateHost(Shell shell, IHost conn, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)

View file

@ -20,6 +20,7 @@ import java.util.List;
import java.util.Vector;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.ISystemUserIdConstants;
import org.eclipse.rse.core.PasswordPersistenceManager;
import org.eclipse.rse.core.SystemBasePlugin;
@ -666,7 +667,7 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
ISubSystemConfiguration ssc = subsystem.getSubSystemConfiguration();
ssc.updateSubSystem(subsystem, true, userId, false, 0);
} else { // it seems intuitive to update the connection object. defect 42709. Phil
int whereToUpdate = USERID_LOCATION_CONNECTION;
int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST;
IHost conn = subsystem.getHost();
ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(), conn.getDescription(), userId, whereToUpdate);

View file

@ -17,6 +17,7 @@
package org.eclipse.rse.core;
/**
* Constants for user Id management
* @deprecated use {@link IRSEUserIdConstants} instead.
*/
public interface ISystemUserIdConstants
{