RSE
Release 3.0

org.eclipse.rse.core
Class AbstractRSESystemType

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.rse.core.AbstractRSESystemType
All Implemented Interfaces:
IAdaptable, IRSESystemType

public abstract class AbstractRSESystemType
extends PlatformObject
implements IRSESystemType

Abstract base class holding core functionality of a system type. Extenders must override IRSESystemType.getSubsystemConfigurationIds() according to their strategy of finding subsystem configuration id's that match their system type. Extenders may override any other method.


Field Summary
protected  Bundle definingBundle
           
protected  String description
           
protected  String id
           
protected  String label
           
protected  String name
           
protected  Map properties
           
 
Fields inherited from interface org.eclipse.rse.core.IRSESystemType
PROPERTY_IS_CASE_SENSITIVE, PROPERTY_IS_LOCAL, PROPERTY_IS_WINDOWS, PROPERTY_SUPPORTS_ENCODING, SYSTEMTYPE_AIX, SYSTEMTYPE_AIX_ID, SYSTEMTYPE_DISCOVERY_ID, SYSTEMTYPE_FTP_ONLY_ID, SYSTEMTYPE_ISERIES, SYSTEMTYPE_ISERIES_ID, SYSTEMTYPE_LINUX, SYSTEMTYPE_LINUX_ID, SYSTEMTYPE_LOCAL, SYSTEMTYPE_LOCAL_ID, SYSTEMTYPE_PASE, SYSTEMTYPE_PASE_ID, SYSTEMTYPE_POWER_LINUX, SYSTEMTYPE_POWER_LINUX_ID, SYSTEMTYPE_SSH_ONLY_ID, SYSTEMTYPE_TELNET_ONLY_ID, SYSTEMTYPE_UNIX, SYSTEMTYPE_UNIX_ID, SYSTEMTYPE_WINDOWS, SYSTEMTYPE_WINDOWS_ID, SYSTEMTYPE_ZSERIES, SYSTEMTYPE_ZSERIES_ID, SYSTEMTYPE_ZSERIES_LINUX, SYSTEMTYPE_ZSERIES_LINUX_ID
 
Constructor Summary
protected AbstractRSESystemType()
          Default constructor.
  AbstractRSESystemType(String id, String name, String label, String description, Bundle definingBundle)
          Constructor for an object representing a system type.
 
Method Summary
 IHost createNewHostInstance(ISystemProfile profile)
          Creates a new IHost object instance.
 boolean equals(Object obj)
          Checks whether two system types are the same.
 Bundle getDefiningBundle()
          Returns the bundle which is responsible for the definition of this system type.
 String getDescription()
          Returns the description of the system type.
 String getId()
          Returns the id of the system type.
 String getLabel()
          Returns the translatable label for use in the UI.
 String getName()
          Returns the name of the system type.
 String getProperty(String key)
          Returns the property of this system type with the given key.
 int hashCode()
          Returns the hashCode for this system type.
 boolean isEnabled()
          Tests whether the system type is currently enabled.
 boolean isLocal()
          Tests whether the system type refers to the local system.
 boolean isWindows()
          Tests whether the system type refers to the Windows system.
 boolean testProperty(String key, boolean expectedValue)
          Tests whether the given boolean property matches the expected value for this system type.
 String toString()
           
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.IRSESystemType
getSubsystemConfigurationIds
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

id

protected String id

name

protected String name

label

protected String label

description

protected String description

definingBundle

protected Bundle definingBundle

properties

protected Map properties
Constructor Detail

AbstractRSESystemType

protected AbstractRSESystemType()
Default constructor. Only subclasses may call this if set the id, name, label, description and properties attributes themselves.


AbstractRSESystemType

public AbstractRSESystemType(String id,
                             String name,
                             String label,
                             String description,
                             Bundle definingBundle)
Constructor for an object representing a system type.

Parameters:
id - unique id of this system type. Must be system unique.
name - a name of this system type to be used for internal checks.
label - a user-visible label of this system type. May be null and falls back to the name in this case.
description - a user-visible description of this system type. May be null and falls back to the label in this case.
Method Detail

equals

public boolean equals(Object obj)
Checks whether two system types are the same. System types are considered the same if they have the same ID.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns the hashCode for this system type. The hashCode is the hashCode of its ID.

Overrides:
hashCode in class Object

getId

public String getId()
Description copied from interface: IRSESystemType
Returns the id of the system type.

Specified by:
getId in interface IRSESystemType
Returns:
the id of the system type

getLabel

public String getLabel()
Description copied from interface: IRSESystemType
Returns the translatable label for use in the UI.

Specified by:
getLabel in interface IRSESystemType
Returns:
The UI label or null if not set.

getName

public String getName()
Description copied from interface: IRSESystemType
Returns the name of the system type.

Specified by:
getName in interface IRSESystemType
Returns:
the name of the system type

getDescription

public String getDescription()
Description copied from interface: IRSESystemType
Returns the description of the system type.

Specified by:
getDescription in interface IRSESystemType
Returns:
the description of the system type

getDefiningBundle

public Bundle getDefiningBundle()
Description copied from interface: IRSESystemType
Returns the bundle which is responsible for the definition of this system type. Typically this is used as a base for searching for images and other files that are needed in presenting the system type.

Specified by:
getDefiningBundle in interface IRSESystemType
Returns:
the bundle which defines this system type or null if none

getProperty

public String getProperty(String key)
Description copied from interface: IRSESystemType
Returns the property of this system type with the given key. null is returned if there is no such key/value pair.

Specified by:
getProperty in interface IRSESystemType
Parameters:
key - the name of the property to return
Returns:
the value associated with the given key or null if none

testProperty

public boolean testProperty(String key,
                            boolean expectedValue)
Description copied from interface: IRSESystemType
Tests whether the given boolean property matches the expected value for this system type. Clients can use their own properties with system types, but should use reverse DNS notation to qualify their property keys (e.g. com.acme.isFoobarSystem. Property keys without qualifying namespace are reserved for RSE internal use.

Specified by:
testProperty in interface IRSESystemType
Parameters:
key - the name of the property to return
expectedValue - the expected boolean value of the property.
Returns:
true if the Property is set on the system type and matches the expected value. Returns false if the property is not set or does not match.

isEnabled

public boolean isEnabled()
Tests whether the system type is currently enabled. The enabled state is a dynamic property of a system type, compared to the static configuration by plugin markup. Enablement is a non-UI property, which can be set by a Product in the Preferences or modified by a user to hide certain system types.

Implementers of custom system types (which are registered by a SystemTypeProvider) can override this method to provide more advanced enabled checks e.g. based on license availability.

Specified by:
isEnabled in interface IRSESystemType
Returns:
true if the system type is currently enabled, or false otherwise.
Since:
org.eclipse.rse.core 3.0
See Also:
IRSESystemType.isEnabled()

isLocal

public boolean isLocal()
Description copied from interface: IRSESystemType
Tests whether the system type refers to the local system. This is a shortcut for
   getId().equals(SYSTEMTYPE_LOCAL_ID) ||
   || testProperty(PROPERTY_IS_LOCAL, true)
 
See IRSESystemType.PROPERTY_IS_LOCAL for properties expected on a Local system. Extenders (contributors of custom system types) may override.

Specified by:
isLocal in interface IRSESystemType
Returns:
true if the system type refers to the local system.

isWindows

public boolean isWindows()
Description copied from interface: IRSESystemType
Tests whether the system type refers to the Windows system. This is a shortcut for
   getId().equals(SYSTEMTYPE_WINDOWS_ID)
   || isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")
   || testProperty(PROPERTY_IS_WINDOWS, true)
 
See IRSESystemType.PROPERTY_IS_WINDOWS for properties expected on a Windows system. This is an "aggregate" property consisting of several smaller properties like isCaseSensitive. In the future, we'll want more fine granular properties to check against. Extenders (contributors of custom system types) may override.

Specified by:
isWindows in interface IRSESystemType
Returns:
true if the system type refers to a Windows system.

createNewHostInstance

public IHost createNewHostInstance(ISystemProfile profile)
Description copied from interface: IRSESystemType
Creates a new IHost object instance. This method is called from SystemHostPool.createHost(IRSESystemType, String, String, String, String, int).

Specified by:
createNewHostInstance in interface IRSESystemType
Parameters:
profile - The system profile to associate with the host.
Returns:
A new IHost object instance.

toString

public String toString()
Overrides:
toString in class Object

RSE
Release 3.0

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