RSE
Release 1.0

org.eclipse.rse.model
Class DummyHost

java.lang.Object
  extended byorg.eclipse.rse.model.DummyHost
All Implemented Interfaces:
IHost, IPropertySetContainer, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer

public class DummyHost
extends Object
implements IHost


Field Summary
protected  String _hostName
           
protected  String _systemType
           
 
Constructor Summary
DummyHost(String hostName, String systemType)
           
 
Method Summary
 boolean addPropertySet(IPropertySet set)
           
 boolean addPropertySets(IPropertySet[] sets)
           
 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
 IPropertySet createPropertySet(String name)
           
 IPropertySet createPropertySet(String name, String description)
           
 void deletingHost()
          Private method called when this connection is being deleted, so we can do any pre-death cleanup we need.
 String getAliasName()
           
 IConnectorService[] getConnectorServices()
          Returns all the connector services provided for this host
 String getDefaultUserId()
          We return the default user Id.
 String getDescription()
           
 boolean getForceUserIdToUpperCase()
          Call this to query whether the default userId is to be uppercased.
 String getHostName()
           
 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.
 String getName()
           
 IPropertySet getPropertySet(String name)
           
 IPropertySet[] getPropertySets()
           
 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
 String getSystemType()
           
 boolean isDirty()
          An object is dirty if a change has been made to it that requires it to be persisted.
 boolean isOffline()
          Returns the value of the 'Offline' attribute
 boolean isPromptable()
           
 boolean removePropertySet(String name)
           
 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 value)
           
 void setDefaultUserId(String value)
          Intercept of setDefaultUserId so we can force it to uppercase.
 void setDescription(String value)
           
 void setDirty(boolean flag)
          An object is dirty if a change has been made to it that requires it to be persisted.
 void setHostName(String value)
           
 void setHostPool(ISystemHostPool pool)
          Set the parent connection pool this is owned by.
 void setOffline(boolean value)
          Sets the value of the 'Offline' attribute
 void setPromptable(boolean value)
           
 void setSystemType(String value)
           
 void setWasRestored(boolean flag)
          The the "restored" state of the object.
 boolean wasRestored()
          An object was restored if it originated from a persistent form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_hostName

protected String _hostName

_systemType

protected String _systemType
Constructor Detail

DummyHost

public DummyHost(String hostName,
                 String systemType)
Method Detail

getSystemProfile

public ISystemProfile getSystemProfile()
Description copied from interface: IHost
Return the system profile that owns this connection

Specified by:
getSystemProfile in interface IHost

getSystemProfileName

public String getSystemProfileName()
Description copied from interface: IHost
Return the name of the system profile that owns this connection

Specified by:
getSystemProfileName in interface IHost

setHostPool

public void setHostPool(ISystemHostPool pool)
Description copied from interface: IHost
Set the parent connection pool this is owned by. Connection pools are internal management objects, one per profile.

Specified by:
setHostPool in interface IHost

getHostPool

public ISystemHostPool getHostPool()
Description copied from interface: IHost
Set the parent connection pool this is owned by. Connection pools are internal management objects, one per profile.

Specified by:
getHostPool in interface IHost

getSubSystems

public ISubSystem[] getSubSystems()
Description copied from interface: IHost
Return the subsystem instances under this connection. Just a shortcut to org.eclipse.rse.model.ISystemRegistry#getSubSystems(IHost)

Specified by:
getSubSystems in interface IHost

getLocalDefaultUserId

public String getLocalDefaultUserId()
Description copied from interface: IHost
Return the local default user Id without resolving up the food chain.

Specified by:
getLocalDefaultUserId in interface IHost
See Also:
IHost.getDefaultUserId()

clearLocalDefaultUserId

public void clearLocalDefaultUserId()
Description copied from interface: IHost
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 IHost
See Also:
IHost.setDefaultUserId(String)

deletingHost

public void deletingHost()
Description copied from interface: IHost
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:
deletingHost in interface IHost

renamingSystemProfile

public void renamingSystemProfile(String oldName,
                                  String newName)
Description copied from interface: IHost
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 IHost

getForceUserIdToUpperCase

public boolean getForceUserIdToUpperCase()
Description copied from interface: IHost
Call this to query whether the default userId is to be uppercased.

Specified by:
getForceUserIdToUpperCase in interface IHost

compareUserIds

public boolean compareUserIds(String userId1,
                              String userId2)
Description copied from interface: IHost
Call this to compare two userIds taking case sensitivity

Specified by:
compareUserIds in interface IHost

getSystemType

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

setSystemType

public void setSystemType(String value)
Specified by:
setSystemType in interface IHost
Parameters:
value - The new value of the SystemType attribute

getAliasName

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

setAliasName

public void setAliasName(String value)
Specified by:
setAliasName in interface IHost
Parameters:
value - The new value of the AliasName attribute

getHostName

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

setHostName

public void setHostName(String value)
Specified by:
setHostName in interface IHost
Parameters:
value - The new value of the HostName attribute

getDescription

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

setDescription

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

getDefaultUserId

public String getDefaultUserId()
Description copied from interface: IHost
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 IHost
Returns:
The value of the DefaultUserId attribute

setDefaultUserId

public void setDefaultUserId(String value)
Description copied from interface: IHost
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 IHost
Parameters:
value - The new value of the DefaultUserId attribute

isPromptable

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

setPromptable

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

isOffline

public boolean isOffline()
Description copied from interface: IHost
Returns the value of the 'Offline' attribute.

Is this connection offline? If so, there is no live connection. Subsystems decide how much to enable while offline.

Specified by:
isOffline in interface IHost
Returns:
the value of the 'Offline' attribute.
See Also:
IHost.setOffline(boolean), org.eclipse.rse.model.ModelPackage#getSystemConnection_Offline()

setOffline

public void setOffline(boolean value)
Description copied from interface: IHost
Sets the value of the 'Offline' attribute.

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

getConnectorServices

public IConnectorService[] getConnectorServices()
Description copied from interface: IHost
Returns all the connector services provided for this host

Specified by:
getConnectorServices in interface IHost
Returns:
the connector services

getName

public String getName()
Specified by:
getName in interface IRSEModelObject

getPropertySets

public IPropertySet[] getPropertySets()
Specified by:
getPropertySets in interface IPropertySetContainer

getPropertySet

public IPropertySet getPropertySet(String name)
Specified by:
getPropertySet in interface IPropertySetContainer

createPropertySet

public IPropertySet createPropertySet(String name,
                                      String description)
Specified by:
createPropertySet in interface IPropertySetContainer

createPropertySet

public IPropertySet createPropertySet(String name)
Specified by:
createPropertySet in interface IPropertySetContainer

addPropertySet

public boolean addPropertySet(IPropertySet set)
Specified by:
addPropertySet in interface IPropertySetContainer

addPropertySets

public boolean addPropertySets(IPropertySet[] sets)
Specified by:
addPropertySets in interface IPropertySetContainer

removePropertySet

public boolean removePropertySet(String name)
Specified by:
removePropertySet in interface IPropertySetContainer

isDirty

public boolean isDirty()
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
An object is dirty if a change has been made to it that requires it to be persisted.

Specified by:
isDirty in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Returns:
true if the object is dirty

setDirty

public void setDirty(boolean flag)
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
An object is dirty if a change has been made to it that requires it to be persisted. Objects should usually mark themselves dirty when a persistable change is made. However, there may be a need to mark related objects dirty as well. Setting this value to false should be done only in the persistence manager after the object has been written to the DOM.

Specified by:
setDirty in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Parameters:
flag - true if the object must be persisted.

commit

public boolean commit()
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
Request a persistence manager to persist this object.

Specified by:
commit in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Returns:
true if the object was persisted.

wasRestored

public boolean wasRestored()
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
An object was restored if it originated from a persistent form.

Specified by:
wasRestored in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Returns:
true if the object was created from its persistent form, false if the object has never been persisted.

setWasRestored

public void setWasRestored(boolean flag)
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
The the "restored" state of the object. Only persistence managers should do this.

Specified by:
setWasRestored in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Parameters:
flag - true if the object was restored.

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.