|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.model.Host
public class Host
Default implementation of the IHost
interface.
Dynamic system type providers may extend this implementation if needed.
Field Summary | |
---|---|
protected String |
previousUserIdKey
|
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer |
---|
NO_CHILDREN |
Constructor Summary | |
---|---|
Host(ISystemProfile profile)
Constructor |
Method Summary | |
---|---|
void |
clearLocalDefaultUserId()
Clear the local default user Id so next query will return the value from the preference store. |
boolean |
commit()
Request a persistence manager to persist this object. |
boolean |
compareUserIds(String userId1,
String userId2)
Call this to compare two userIds taking case sensitivity |
void |
deletingHost()
Notification method called when this connection is being deleted. |
Object |
getAdapter(Class adapterType)
|
String |
getAliasName()
Get the unique user-visible connection name. |
IConnectorService[] |
getConnectorServices()
Returns all the connector services currently configured for this host |
String |
getDefaultEncoding(boolean fromRemote)
Returns the default encoding of the host. |
String |
getDefaultUserId()
Return the default user Id for this host. |
String |
getDescription()
Return the description of this host. |
boolean |
getForceUserIdToUpperCase()
Call this to query whether the default userId is to be uppercased. |
String |
getHostName()
Get the host name or IP address. |
ISystemHostPool |
getHostPool()
Set the parent connection pool this is owned by. |
String |
getLocalDefaultUserId()
Return the local default user Id without resolving up the food chain. |
protected static String |
getLocalDefaultUserId(String key)
Return the local default user Id without resolving up the food chain. |
String |
getName()
|
IRSEPersistableContainer[] |
getPersistableChildren()
Retrieves the children of this object in the persistence containment hierarchy. |
IRSEPersistableContainer |
getPersistableParent()
Retrieve the parent of this object in the persistence containment hierarchy. |
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 |
ISubSystem[] |
getSubSystems()
Return the subsystem instances under this connection. |
ISystemProfile |
getSystemProfile()
Return the system profile that owns this connection |
String |
getSystemProfileName()
Return the name of the system profile that owns this connection FIXME Check how this is different from getSystemProfile().getName() |
IRSESystemType |
getSystemType()
Get the system type. |
boolean |
getUserIdCaseSensitive()
Call this to query whether the default userId is case sensitive |
boolean |
isOffline()
Returns the value of the 'Offline' attribute. |
boolean |
isPromptable()
Check if this host is promptable. |
void |
renamingSystemProfile(String oldName,
String newName)
Notification method called when this connection's profile is being renamed. |
void |
setAliasName(String newName)
Intercept of setAliasName so we can potentially rename the default-user-id key for the preferences store. |
void |
setDefaultEncoding(String encoding,
boolean fromRemote)
Set the default encoding of the host. |
void |
setDefaultUserId(String newId)
Intercept of setDefaultUserId so we can force it to uppercase. |
void |
setDescription(String newDescription)
Set the description of this host. |
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 |
setHostPool(ISystemHostPool pool)
Set the parent connection pool this is owned by. |
void |
setOffline(boolean newOffline)
Specify if this connection is offline or not. |
void |
setPromptable(boolean newPromptable)
Set the promptable attribute. |
void |
setSystemType(IRSESystemType systemType)
Intercept of setSystemType so we can decide if the user ID is case sensitive |
void |
setUserIdCaseSensitive(boolean caseSensitive)
Call this to turn off the default behaviour of considering case when comparing userIds |
String |
toString()
|
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer |
---|
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet |
Methods inherited from class org.eclipse.rse.core.model.RSEPersistableObject |
---|
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer |
---|
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet |
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer |
---|
isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Field Detail |
---|
protected String previousUserIdKey
Constructor Detail |
---|
public Host(ISystemProfile profile)
Method Detail |
---|
public void setHostPool(ISystemHostPool pool)
IHost
setHostPool
in interface IHost
public ISystemHostPool getHostPool()
IHost
getHostPool
in interface IHost
public IConnectorService[] getConnectorServices()
IHost
getConnectorServices
in interface IHost
public ISubSystem[] getSubSystems()
IHost
ISystemRegistry.getSubSystems(IHost)
getSubSystems
in interface IHost
public void deletingHost()
IHost
What we need to do is delete our entry in the preference store for our default userId.
deletingHost
in interface IHost
public void renamingSystemProfile(String oldName, String newName)
IHost
Implementations must not fork off other threads in the implementation of this method, since the old and new profiles will be locked during the rename operation so deadlock could occur when another thread tries to access theprofile during the time of rename ongoing.
What we need to do is rename our entry in the preference store for our default userId.
renamingSystemProfile
in interface IHost
public ISystemProfile getSystemProfile()
IHost
getSystemProfile
in interface IHost
public String getSystemProfileName()
IHost
getSystemProfileName
in interface IHost
public void setAliasName(String newName)
setAliasName
in interface IHost
newName
- The new value of the AliasName attributepublic void setSystemType(IRSESystemType systemType)
setSystemType
in interface IHost
systemType
- The new value of the SystemType attributepublic void setHostName(String name)
setHostName
in interface IHost
name
- The new value of the HostName attributepublic void setDefaultUserId(String newId)
setDefaultUserId
in interface IHost
newId
- The new value of the DefaultUserId attributepublic String getDefaultUserId()
IHost
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.
getDefaultUserId
in interface IHost
protected static String getLocalDefaultUserId(String key)
getDefaultUserId()
public String getLocalDefaultUserId()
IHost
getLocalDefaultUserId
in interface IHost
IHost.getDefaultUserId()
public void clearLocalDefaultUserId()
IHost
Same as calling setDefaultUserId(null)
clearLocalDefaultUserId
in interface IHost
IHost.setDefaultUserId(String)
protected String getPreferencesKey()
protected String getPreferencesKey(String profileName)
protected String getPreferencesKey(String profileName, String connectionName)
public void setForceUserIdToUpperCase(boolean force)
public void setUserIdCaseSensitive(boolean caseSensitive)
public boolean getForceUserIdToUpperCase()
getForceUserIdToUpperCase
in interface IHost
true
if the user id is to be uppercased.public boolean getUserIdCaseSensitive()
public boolean compareUserIds(String userId1, String userId2)
compareUserIds
in interface IHost
userId1
- first id to compareuserId2
- second id to comparepublic String toString()
toString
in class Object
public Object getAdapter(Class adapterType)
getAdapter
in interface IAdaptable
public IRSESystemType getSystemType()
IHost
getSystemType
in interface IHost
public String getName()
getName
in interface IRSEModelObject
public String getAliasName()
IHost
getAliasName
in interface IHost
public String getHostName()
IHost
getHostName
in interface IHost
public String getDescription()
IHost
getDescription
in interface IHost
getDescription
in interface IRSEModelObject
getDescription
in class RSEModelObject
public void setDescription(String newDescription)
IHost
setDescription
in interface IHost
newDescription
- The new value of the Description attributepublic boolean isPromptable()
IHost
isPromptable
in interface IHost
public void setPromptable(boolean newPromptable)
IHost
setPromptable
in interface IHost
newPromptable
- The new value of the Promptable attributepublic boolean isOffline()
IHost
Query if this connection is offline or not. If so, there is no live connection. Subsystems decide how much to enable while offline. It is up to each subsystem to honor this flag.
isOffline
in interface IHost
IHost.setOffline(boolean)
public void setOffline(boolean newOffline)
IHost
setOffline
in interface IHost
newOffline
- the new value of the 'Offline' attribute.IHost.isOffline()
public boolean commit()
IRSEPersistableContainer
commit
in interface IRSEPersistableContainer
public IRSEPersistableContainer getPersistableParent()
IRSEPersistableContainer
getPersistableParent
in interface IRSEPersistableContainer
public IRSEPersistableContainer[] getPersistableChildren()
IRSEPersistableContainer
getPersistableChildren
in interface IRSEPersistableContainer
IRSEPersistableContainer.NO_CHILDREN
.public String getDefaultEncoding(boolean fromRemote)
IHost
If fromRemote is false
, returns an encoding preference
specified locally without querying the remote system (for example,
an encoding set by a user).
If fromRemote is true
, it first checks to see if there is
a local "overriding" encoding set by the client without querying the
remote system, and if such a "local" encoding preference does not exist,
returns the encoding that was set by the client by querying a remote system.
getDefaultEncoding
in interface IHost
fromRemote
- false
to get the encoding that was
obtained by the client by not querying the remote system,
true
to also check the encoding, if needed, that was
set by the client after querying a remote system.
null
if
no encoding was set.IHost.setDefaultEncoding(String, boolean)
public void setDefaultEncoding(String encoding, boolean fromRemote)
IHost
This method can only be called when no subsystem is connected. The client has to obtain the encoding either by querying the remote system, or by some other means (for example, set by a user).
setDefaultEncoding
in interface IHost
encoding
- the encoding of the host, or null
to erase the current encoding.fromRemote
- true
if the encoding is set by the
client after querying the remote system, or false
otherwise (e.g. setting a local user preference).IHost.getDefaultEncoding(boolean)
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |