Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.core.model
Class DummyHost

java.lang.Object
  extended by 

org.eclipse.core.runtime.PlatformObject
      extended by 
org.eclipse.rse.core.model.DummyHost
All Implemented Interfaces:
IAdaptable, IHost, IPropertySetContainer, IRSEModelObject, IRSEPersistableContainer

public class DummyHost
extends PlatformObject
implements IHost

A DummyHost is used as a placeholder during the construction of hosts by wizards.


Field Summary
protected   String _hostName
           
protected   IRSESystemType _systemType
           
 
Fields inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
DummyHost ( String hostName, IRSESystemType systemType)
          Constructor.
 
Method Summary
 boolean addPropertySet ( IPropertySet set)
          Adds an existing property set to this container.
 boolean addPropertySets ( IPropertySet[] sets)
          Adds a number of existing property sets to this container.
 void beginRestore ()
           
 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)
          Compare two userIds taking case sensitivity into account.
  IPropertySet createPropertySet ( String name)
          Creates a new property set of a particular name in this container.
  IPropertySet createPropertySet ( String name, String description)
          Creates a new property set of a particular name and description in this container.
 void deletingHost ()
          Notification method called when this connection is being deleted.
 void endRestore ()
           
  String getAliasName ()
          Get the unique user-visible connection name.
  IConnectorService[] getConnectorServices ()
          Returns all the connector services currently configured for this host
  String getDefaultEncoding (boolean checkRemote)
          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 ()
          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.
  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.
  IPropertySet getPropertySet ( String name)
          Retrieves a particular property set by its name.
  IPropertySet[] getPropertySets ()
          Retrieves an array all property sets known to this container.
  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 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 ()
          Check if this host is promptable.
 boolean isTainted ()
          An object is tainted if it contains an object that is dirty somewhere in its containment hierarchy.
 boolean removePropertySet ( String name)
          Removes a particular property set from this container.
 void renamingSystemProfile ( String oldName, String newName)
          Notification method called when this connection's profile is being renamed.
 void setAliasName ( String value)
          Set the unique user-visible connection name.
 void setDefaultEncoding ( String encoding, boolean fromRemote)
          Set the default encoding of the host.
 void setDefaultUserId ( String value)
          Intercept of setDefaultUserId so we can force it to uppercase.
 void setDescription ( String value)
          Set the description of this host.
 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)
          Set the host name or IP address.
 void setHostPool ( ISystemHostPool pool)
          Set the parent connection pool this is owned by.
 void setOffline (boolean value)
          Specify if this connection is offline or not.
 void setPromptable (boolean value)
          Set the promptable attribute.
 void setSystemType ( IRSESystemType value)
          Set the system type.
 void setTainted (boolean flag)
          Sets the tainted attribute for this object.
 void setWasRestored (boolean flag)
          Sets the restored state of the object.
 boolean wasRestored ()
          An object was restored if it originated from a persistent form.
 
Methods inherited from class org.eclipse.core.runtime. PlatformObject
getAdapter
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime. IAdaptable
getAdapter
 

Field Detail

_hostName

protected 
String _hostName

_systemType

protected 
IRSESystemType _systemType
Constructor Detail

DummyHost

public DummyHost(
String hostName,
                 
IRSESystemType systemType)
Constructor.

Parameters:
hostName - name of the dummy host
systemType - sytem type. May be null.
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
Returns:
the profile which contains this host

getSystemProfileName

public 
String getSystemProfileName()
Description copied from interface: IHost
Return the name of the system profile that owns this connection FIXME Check how this is different from getSystemProfile().getName()

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 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
Notification method called when this connection is being deleted. Allows doing pre-death cleanup in overriders.

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
Notification method called when this connection's profile is being renamed. Allows doing pre-death cleanup in overriders.

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.

Specified by:
renamingSystemProfile in interface IHost

getForceUserIdToUpperCase

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

Specified by:
getForceUserIdToUpperCase in interface IHost
Returns:
true if the user id is to be uppercased.

compareUserIds

public boolean compareUserIds(
String userId1,
                              
String userId2)
Description copied from interface: IHost
Compare two userIds taking case sensitivity into account.

Specified by:
compareUserIds in interface IHost
Parameters:
userId1 - first id to compare
userId2 - second id to compare

getSystemType

public 
IRSESystemType getSystemType()
Description copied from interface: IHost
Get the system type.

Specified by:
getSystemType in interface IHost
Returns:
The value of the SystemType attribute

setSystemType

public void setSystemType(
IRSESystemType value)
Description copied from interface: IHost
Set the system type.

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

getAliasName

public 
String getAliasName()
Description copied from interface: IHost
Get the unique user-visible connection name. This is a key that is unique per connection pool.

Specified by:
getAliasName in interface IHost
Returns:
The value of the AliasName attribute

setAliasName

public void setAliasName(
String value)
Description copied from interface: IHost
Set the unique user-visible connection name. This needs to be a key that is unique per connection pool.

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

getHostName

public 
String getHostName()
Description copied from interface: IHost
Get the host name or IP address.

Specified by:
getHostName in interface IHost
Returns:
The value of the HostName attribute

setHostName

public void setHostName(
String value)
Description copied from interface: IHost
Set the host name or IP address.

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

getDescription

public 
String getDescription()
Description copied from interface: IHost
Return the description of this host.

Specified by:
getDescription in interface IHost
Specified by:
getDescription in interface IRSEModelObject
Returns:
The value of the Description attribute

setDescription

public void setDescription(
String value)
Description copied from interface: IHost
Set the description of this host.

Specified by:
setDescription in interface IHost
Parameters:
value - The new value of the Description attribute

getDefaultUserId

public 
String getDefaultUserId()
Description copied from interface: IHost
Return the default user Id for this host. Note that we don't store it directly in an attribute, as we don't want the team to share it. The actual user Id is stored in the preference store keyed by this connection's unique name (profile.connName) instead, and that key is stored 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()
Description copied from interface: IHost
Check if this host is promptable.

Specified by:
isPromptable in interface IHost
Returns:
The value of the Promptable attribute

setPromptable

public void setPromptable(boolean value)
Description copied from interface: IHost
Set the promptable attribute.

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.

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.

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

setOffline

public void setOffline(boolean value)
Description copied from interface: IHost
Specify if this connection is offline or not. It is up to each subsystem to honor this flag.

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 currently configured 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()
Description copied from interface: IPropertySetContainer
Retrieves an array all property sets known to this container. It will return an empty array if this container has property sets. The order of these property sets is not dictated by the interface.

Specified by:
getPropertySets in interface IPropertySetContainer
Returns:
an array of property sets.

getPropertySet

public 
IPropertySet getPropertySet(
String name)
Description copied from interface: IPropertySetContainer
Retrieves a particular property set by its name.

Specified by:
getPropertySet in interface IPropertySetContainer
Parameters:
name - the name of the property set.
Returns:
the named property set or null if one by that name does not exist.

createPropertySet

public 
IPropertySet createPropertySet(
String name,
                                      
String description)
Description copied from interface: IPropertySetContainer
Creates a new property set of a particular name and description in this container. If one already exists by this name it is replaced with a new empty property set. In order to have the property set persisted, the implementing class should also implement IRSEPersistableContainer. The IRSEPersistableContainer.commit() method must then be used to commit any changes into persistent storage.

Specified by:
createPropertySet in interface IPropertySetContainer
Parameters:
name - the name of the property set.
description - the description (usually already localized) for this property set.
Returns:
the newly created property set.

createPropertySet

public 
IPropertySet createPropertySet(
String name)
Description copied from interface: IPropertySetContainer
Creates a new property set of a particular name in this container. If one already exists by this name, it is replaced with a new empty property set. In order to have the property set persisted, the implementing class should also implement IRSEPersistableContainer. The IRSEPersistableContainer.commit() method must then be used to commit any changes into persistent storage.

Specified by:
createPropertySet in interface IPropertySetContainer
Parameters:
name - the name of the property set.
Returns:
The property set.

addPropertySet

public boolean addPropertySet(
IPropertySet set)
Description copied from interface: IPropertySetContainer
Adds an existing property set to this container. If the property set already has a container it is removed from that container and added to this one. If this container already has a property set by this name, this one replaces it.

Specified by:
addPropertySet in interface IPropertySetContainer
Parameters:
set - the property set to be added.
Returns:
true if the property set was added.

addPropertySets

public boolean addPropertySets(
IPropertySet[] sets)
Description copied from interface: IPropertySetContainer
Adds a number of existing property sets to this container.

Specified by:
addPropertySets in interface IPropertySetContainer
Parameters:
sets - the sets to be added
Returns:
true if all property sets were added.
See Also:
IPropertySetContainer.addPropertySet(IPropertySet)

removePropertySet

public boolean removePropertySet(
String name)
Description copied from interface: IPropertySetContainer
Removes a particular property set from this container.

Specified by:
removePropertySet in interface IPropertySetContainer
Parameters:
name - the name of the property set to be removed
Returns:
true if the property set was removed; false if a property set was not removed, usually if it does not exist in the container.

isDirty

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

Specified by:
isDirty in interface IRSEPersistableContainer
Returns:
true if the object is dirty

setDirty

public void setDirty(boolean flag)
Description copied from interface: 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.

Persistable changes are:

  • Any modification of a persistable attribute
  • A rename
  • A deletion of a child object
  • A reordering of the list of child objects
  • The addition of a child object

A rename may also cause a parent to be marked dirty if the parent refers to the child by name.

Setting this value to false should be done only in the persistence manager after the object has been written to the DOM.

Marking an object as dirty must cause it and all of its ancestors in the persistence hierarchy to be marked as tainted.

Specified by:
setDirty in interface IRSEPersistableContainer
Parameters:
flag - true if the object must be persisted.

commit

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

Specified by:
commit in interface IRSEPersistableContainer
Returns:
true if the object was persisted.

wasRestored

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

Specified by:
wasRestored in interface 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: IRSEPersistableContainer
Sets the restored state of the object. Only persistence managers should do this. Persistable objects should be initially created with this as false and the persistence manager set this to true. This attribute is "sticky" in the face of most property changes. It should be set false if the object is renamed or re-parented.

Specified by:
setWasRestored in interface IRSEPersistableContainer
Parameters:
flag - true if the object was restored.

getPersistableParent

public 
IRSEPersistableContainer getPersistableParent()
Description copied from interface: IRSEPersistableContainer
Retrieve the parent of this object in the persistence containment hierarchy. This is related to, but not necessarily the same as, the model hierarchy.

Specified by:
getPersistableParent in interface IRSEPersistableContainer
Returns:
the parent persistent object. This is null if there is no parent.

getPersistableChildren

public 
IRSEPersistableContainer[] getPersistableChildren()
Description copied from interface: IRSEPersistableContainer
Retrieves the children of this object in the persistence containment hierarchy. This is related to, but not necessarily the same as, the model hierarchy.

Specified by:
getPersistableChildren in interface IRSEPersistableContainer
Returns:
the array of persistent children in the order they are to be stored in the persistent form. This is an empty array if there are no children. See IRSEPersistableContainer.NO_CHILDREN.

isTainted

public boolean isTainted()
Description copied from interface: IRSEPersistableContainer
An object is tainted if it contains an object that is dirty somewhere in its containment hierarchy.

Specified by:
isTainted in interface IRSEPersistableContainer
Returns:
true if the object is tainted.

beginRestore

public void beginRestore()

endRestore

public void endRestore()

setTainted

public void setTainted(boolean flag)
Description copied from interface: IRSEPersistableContainer
Sets the tainted attribute for this object. This should set to true only by child objects when they have been marked dirty or tainted. Setting this to true will cause all parent objects in the containment hierarchy to be marked tainted. It should be set to false only by a persistence manager when the object has been committed.

Specified by:
setTainted in interface IRSEPersistableContainer
Parameters:
flag - the tainted state of the object.

getDefaultEncoding

public 
String getDefaultEncoding(boolean checkRemote)
Description copied from interface: IHost
Returns the default encoding of the host.

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.

Specified by:
getDefaultEncoding in interface IHost
Parameters:
checkRemote - 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.
Returns:
the default encoding of the host, or null if no encoding was set.
See Also:
IHost.setDefaultEncoding(String, boolean)

setDefaultEncoding

public void setDefaultEncoding(
String encoding,
                               boolean fromRemote)
Description copied from interface: IHost
Set the default encoding of the host.

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).

Specified by:
setDefaultEncoding in interface IHost
Parameters:
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).
See Also:
IHost.getDefaultEncoding(boolean)

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire