Remote Systems
v6.4.1

com.ibm.etools.systems.model.impl
Class SystemConnectionImpl

java.lang.Object
  extended byEObjectImpl
      extended bycom.ibm.etools.systems.model.impl.SystemConnectionImpl
All Implemented Interfaces:
IAdaptable, SystemConnection

public class SystemConnectionImpl
extends EObjectImpl
implements SystemConnection, IAdaptable

See Also:
Serialized Form

Field Summary
protected static String ALIAS_NAME_EDEFAULT
          The default value of the 'Alias Name' attribute
protected  String aliasName
           
static String copyright
           
protected static String DEFAULT_USER_ID_EDEFAULT
          The default value of the 'Default User Id' attribute
protected  String defaultUserId
           
protected  String description
           
protected static String DESCRIPTION_EDEFAULT
          The default value of the 'Description' attribute
protected static String HOST_NAME_EDEFAULT
          The default value of the 'Host Name' attribute
protected  String hostName
           
protected  boolean offline
          The cached value of the 'Offline' attribute
protected static boolean OFFLINE_EDEFAULT
          The default value of the 'Offline' attribute
protected  String previousUserIdKey
           
protected  boolean promptable
           
protected static boolean PROMPTABLE_EDEFAULT
          The default value of the 'Promptable' attribute
protected static String SYSTEM_TYPE_EDEFAULT
          The default value of the 'System Type' attribute
protected  String systemType
           
 
Constructor Summary
protected SystemConnectionImpl()
          Constructor
 
Method Summary
 void clearLocalDefaultUserId()
          Clear the local default user Id so next query will return the value from the preference store.
 boolean compareUserIds(String userId1, String userId2)
          Call this to compare two userIds taking case sensitivity
 void deletingConnection()
          Private method called when this connection is being deleted, so we can do any pre-death cleanup we need.
 Object eGet(EStructuralFeature eFeature, boolean resolve)
           
 boolean eIsSet(EStructuralFeature eFeature)
           
 void eSet(EStructuralFeature eFeature, Object newValue)
           
protected  EClass eStaticClass()
           
 void eUnset(EStructuralFeature eFeature)
           
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 String getAliasName()
           
 RemoteCmdSubSystem getCmdSubSystem()
          Return the pre-supplied subsystem for command shell access.
 SystemConnectionPool getConnectionPool()
          Set the parent connection pool this is owned by.
 String getDefaultUserId()
          We return the default user Id.
 String getDefaultUserIdGen()
           
 String getDescription()
           
 RemoteFileSubSystem getFileSubSystem()
          Return the pre-supplied subsystem for file system access.
 boolean getForceUserIdToUpperCase()
          Call this to query whether the default userId is to be uppercased.
 String getHostName()
           
 String getLocalDefaultUserId()
          Return the local default user Id without resolving up the food chain.
protected  String getLocalDefaultUserId(String key)
          Return the local default user Id without resolving up the food chain.
protected  String getPreferencesKey()
          Helper method to compute a unique name for a given subsystem instance
protected  String getPreferencesKey(String profileName)
          Helper method to compute a unique name for a given subsystem instance, given a profile name
protected  String getPreferencesKey(String profileName, String connectionName)
          Helper method to compute a unique name for a given subsystem instance, given a profile name and connection name
protected  SystemPreferencesManager getPreferencesManager()
          Helper method to return preference manager
 SubSystem[] getSubSystems()
          Return the subsystem instances under this connection.
 SystemProfile getSystemProfile()
          Return the system profile that owns this connection
 String getSystemProfileName()
          Return the name of system profile that owns this connection
 String getSystemType()
           
 boolean getUserIdCaseSensitive()
          Call this to query whether the default userId is case sensitive
 boolean isOffline()
           Query if this connection is offline or not.
 boolean isPromptable()
           
 void renamingSystemProfile(String oldName, String newName)
          Private method called when this connection's profile is being rename, so we can do any pre-death cleanup we need.
 void setAliasName(String newName)
          Intercept of setAliasName so we can potentially rename the default-user-id key for the preferences store.
 void setAliasNameGen(String newAliasName)
           
 void setConnectionPool(SystemConnectionPool pool)
          Set the parent connection pool this is owned by.
 void setDefaultUserId(String newId)
          Intercept of setDefaultUserId so we can force it to uppercase.
 void setDefaultUserIdGen(String newDefaultUserId)
           
 void setDescription(String newDescription)
           
 void setForceUserIdToUpperCase(boolean force)
          Call this with false to turn off the default behaviour of forcing the default userId to uppercase.
 void setHostName(String name)
          Intercept of setHostName so we can force it to uppercase
 void setHostNameGen(String newHostName)
           
 void setOffline(boolean newOffline)
           Specify if this connection is offline or not.
 void setPromptable(boolean newPromptable)
           
 void setSystemType(String systemType)
          Intercept of setSystemType so we can decide if the user ID is case sensitive
 void setSystemTypeGen(String newSystemType)
           
 void setUserIdCaseSensitive(boolean caseSensitive)
          Call this to turn off the default behaviour of considering case when comparing userIds
 String toString()
           
 String toStringGen()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

SYSTEM_TYPE_EDEFAULT

protected static final String SYSTEM_TYPE_EDEFAULT
The default value of the 'System Type' attribute.

See Also:
getSystemType()

previousUserIdKey

protected String previousUserIdKey

systemType

protected String systemType

ALIAS_NAME_EDEFAULT

protected static final String ALIAS_NAME_EDEFAULT
The default value of the 'Alias Name' attribute.

See Also:
getAliasName()

aliasName

protected String aliasName

HOST_NAME_EDEFAULT

protected static final String HOST_NAME_EDEFAULT
The default value of the 'Host Name' attribute.

See Also:
getHostName()

hostName

protected String hostName

DESCRIPTION_EDEFAULT

protected static final String DESCRIPTION_EDEFAULT
The default value of the 'Description' attribute.

See Also:
getDescription()

description

protected String description

DEFAULT_USER_ID_EDEFAULT

protected static final String DEFAULT_USER_ID_EDEFAULT
The default value of the 'Default User Id' attribute.

See Also:
getDefaultUserId()

defaultUserId

protected String defaultUserId

PROMPTABLE_EDEFAULT

protected static final boolean PROMPTABLE_EDEFAULT
The default value of the 'Promptable' attribute.

See Also:
isPromptable(), Constant Field Values

promptable

protected boolean promptable

OFFLINE_EDEFAULT

protected static final boolean OFFLINE_EDEFAULT
The default value of the 'Offline' attribute.

See Also:
isOffline(), Constant Field Values

offline

protected boolean offline
The cached value of the 'Offline' attribute.

See Also:
isOffline()
Constructor Detail

SystemConnectionImpl

protected SystemConnectionImpl()
Constructor

Method Detail

eStaticClass

protected EClass eStaticClass()


setConnectionPool

public void setConnectionPool(SystemConnectionPool pool)
Set the parent connection pool this is owned by. Connection pools are internal management objects, one per profile.

Specified by:
setConnectionPool in interface SystemConnection

getConnectionPool

public SystemConnectionPool getConnectionPool()
Set the parent connection pool this is owned by. Connection pools are internal management objects, one per profile.

Specified by:
getConnectionPool in interface SystemConnection

getSubSystems

public SubSystem[] getSubSystems()
Return the subsystem instances under this connection.
Just a shortcut to SystemRegistry.getSubSystems(SystemConnection)

Specified by:
getSubSystems in interface SystemConnection

getFileSubSystem

public RemoteFileSubSystem getFileSubSystem()
Return the pre-supplied subsystem for file system access. It is possible, but rare, that will return null, if the connection is for a system type which does not have a file system.
Just a shortcut to SystemRegistry.getFileSubSystem(SystemConnection)

Specified by:
getFileSubSystem in interface SystemConnection

getCmdSubSystem

public RemoteCmdSubSystem getCmdSubSystem()
Return the pre-supplied subsystem for command shell access. It is possible, but rare, that will return null, if the connection is for a system type which does not support a unix/windows-like command shell.
Just a shortcut to SystemRegistry.getCmdSubSystem(SystemConnection)

Specified by:
getCmdSubSystem in interface SystemConnection

deletingConnection

public void deletingConnection()
Private method called when this connection is being deleted, so we can do any pre-death cleanup we need.

What we need to do is delete our entry in the preference store for our default userId.

Specified by:
deletingConnection in interface SystemConnection

renamingSystemProfile

public void renamingSystemProfile(String oldName,
                                  String newName)
Private method called when this connection's profile is being rename, so we can do any pre-death cleanup we need.

What we need to do is rename our entry in the preference store for our default userId.

Specified by:
renamingSystemProfile in interface SystemConnection

getSystemProfile

public SystemProfile getSystemProfile()
Return the system profile that owns this connection

Specified by:
getSystemProfile in interface SystemConnection

getSystemProfileName

public String getSystemProfileName()
Return the name of system profile that owns this connection

Specified by:
getSystemProfileName in interface SystemConnection

setAliasName

public void setAliasName(String newName)
Intercept of setAliasName so we can potentially rename the default-user-id key for the preferences store. That key is profileName.connectionAliasName so is affected when the alias name changes.

Specified by:
setAliasName in interface SystemConnection
Parameters:
newName - The new value of the AliasName attribute

setSystemType

public void setSystemType(String systemType)
Intercept of setSystemType so we can decide if the user ID is case sensitive

Specified by:
setSystemType in interface SystemConnection
Parameters:
systemType - The new value of the SystemType attribute

setHostName

public void setHostName(String name)
Intercept of setHostName so we can force it to uppercase

Specified by:
setHostName in interface SystemConnection
Parameters:
name - The new value of the HostName attribute

setDefaultUserId

public void setDefaultUserId(String newId)
Intercept of setDefaultUserId so we can force it to uppercase. Also, we do not store the user Id per se in the attribute, but rather we store it in the preference with a key name unique to this connection. We store that key name in this attribute. However, this is all transparent to the caller.

Specified by:
setDefaultUserId in interface SystemConnection
Parameters:
newId - The new value of the DefaultUserId attribute

getDefaultUserId

public String getDefaultUserId()
We return the default user Id. Note that we don't store it directly in the mof-modelled attribute, as we don't want the team to share it. Rather, we store the actual user Id in the preference store keyed by this connection's unique name (profile.connName) and store that key in this attribute.

Further, it is possible that there is no default user id. If so, this method will go to the preference store and will try to get the default user Id per this connection's system type.

This is all transparent to the caller though.

Specified by:
getDefaultUserId in interface SystemConnection
Returns:
The value of the DefaultUserId attribute

getLocalDefaultUserId

protected String getLocalDefaultUserId(String key)
Return the local default user Id without resolving up the food chain.

See Also:
getDefaultUserId()

getLocalDefaultUserId

public String getLocalDefaultUserId()
Return the local default user Id without resolving up the food chain.

Specified by:
getLocalDefaultUserId in interface SystemConnection
See Also:
getDefaultUserId()

clearLocalDefaultUserId

public void clearLocalDefaultUserId()
Clear the local default user Id so next query will return the value from the preference store.

Same as calling setDefaultUserId(null)

Specified by:
clearLocalDefaultUserId in interface SystemConnection
See Also:
setDefaultUserId(String)

getPreferencesManager

protected SystemPreferencesManager getPreferencesManager()
Helper method to return preference manager


getPreferencesKey

protected String getPreferencesKey()
Helper method to compute a unique name for a given subsystem instance


getPreferencesKey

protected String getPreferencesKey(String profileName)
Helper method to compute a unique name for a given subsystem instance, given a profile name


getPreferencesKey

protected String getPreferencesKey(String profileName,
                                   String connectionName)
Helper method to compute a unique name for a given subsystem instance, given a profile name and connection name


setForceUserIdToUpperCase

public void setForceUserIdToUpperCase(boolean force)
Call this with false to turn off the default behaviour of forcing the default userId to uppercase.


setUserIdCaseSensitive

public void setUserIdCaseSensitive(boolean caseSensitive)
Call this to turn off the default behaviour of considering case when comparing userIds


getForceUserIdToUpperCase

public boolean getForceUserIdToUpperCase()
Call this to query whether the default userId is to be uppercased.

Specified by:
getForceUserIdToUpperCase in interface SystemConnection

getUserIdCaseSensitive

public boolean getUserIdCaseSensitive()
Call this to query whether the default userId is case sensitive


compareUserIds

public boolean compareUserIds(String userId1,
                              String userId2)
Call this to compare two userIds taking case sensitivity

Specified by:
compareUserIds in interface SystemConnection

toString

public String toString()

getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface IAdaptable

getSystemType

public String getSystemType()
Specified by:
getSystemType in interface SystemConnection
Returns:
The value of the SystemType attribute

getAliasName

public String getAliasName()
Specified by:
getAliasName in interface SystemConnection
Returns:
The value of the AliasName attribute The unique key for this object. Unique per connection pool

getHostName

public String getHostName()
Specified by:
getHostName in interface SystemConnection
Returns:
The value of the HostName attribute

getDescription

public String getDescription()
Specified by:
getDescription in interface SystemConnection
Returns:
The value of the Description attribute

setDescription

public void setDescription(String newDescription)
Specified by:
setDescription in interface SystemConnection
Parameters:
newDescription - The new value of the Description attribute

isPromptable

public boolean isPromptable()
Specified by:
isPromptable in interface SystemConnection
Returns:
The value of the Promptable attribute

setPromptable

public void setPromptable(boolean newPromptable)
Specified by:
setPromptable in interface SystemConnection
Parameters:
newPromptable - The new value of the Promptable attribute

isOffline

public boolean isOffline()
Query if this connection is offline or not. It is up to each subsystem to honor this flag.

Specified by:
isOffline in interface SystemConnection
Returns:
the value of the 'Offline' attribute.
See Also:
SystemConnection.setOffline(boolean), ModelPackage.getSystemConnection_Offline()

setOffline

public void setOffline(boolean newOffline)
Specify if this connection is offline or not. It is up to each subsystem to honor this flag.

Specified by:
setOffline in interface SystemConnection
Parameters:
newOffline - the new value of the 'Offline' attribute.
See Also:
SystemConnection.isOffline()

eGet

public Object eGet(EStructuralFeature eFeature,
                   boolean resolve)


eIsSet

public boolean eIsSet(EStructuralFeature eFeature)

eSet

public void eSet(EStructuralFeature eFeature,
                 Object newValue)

eUnset

public void eUnset(EStructuralFeature eFeature)

setSystemTypeGen

public void setSystemTypeGen(String newSystemType)

setAliasNameGen

public void setAliasNameGen(String newAliasName)

setHostNameGen

public void setHostNameGen(String newHostName)

getDefaultUserIdGen

public String getDefaultUserIdGen()

setDefaultUserIdGen

public void setDefaultUserIdGen(String newDefaultUserId)

toStringGen

public String toStringGen()

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.