RSE
Release 1.0

org.eclipse.rse.core.subsystems
Class SubSystem

java.lang.Object
  extended byorg.eclipse.rse.core.model.PropertySetContainer
      extended byorg.eclipse.rse.core.model.RSEModelObject
          extended byorg.eclipse.rse.core.subsystems.SubSystem
All Implemented Interfaces:
IAdaptable, IPropertySetContainer, IRemoteObjectResolver, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer, ISchedulingRule, ISubSystem, ISystemFilterPoolReferenceManagerProvider, ISystemResourceChangeEvents
Direct Known Subclasses:
org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteCmdSubSystem, RemoteFileSubSystem, RemoteProcessSubSystemImpl, ServiceSubSystem

public abstract class SubSystem
extends RSEModelObject
implements IAdaptable, ISystemFilterPoolReferenceManagerProvider, ISystemResourceChangeEvents, ISubSystem

This class is designed to be subclassed. Its role is three-fold:

  1. Storing of tool-specific persistent properties per connection.
  2. Accessing of an IConnectorService object to enable the subsystem's connect and disconnect actions.
  3. Doing actual remote accessing. This usually just involves overriding the internalResolveFilterString methods to populate the remote resources shown when the subsystem's filters are expanded. It might also involve overriding the inherited internalRunCommand method if this subsystem supports running commands remotely... although typically such subsystems extend ShellServiceSubSystem, not this class.

This is the base class that subsystem suppliers subclass, although this is usually done by subclassing the child class DefaultSubSystemImpl.
Each instance of this class represents a subsystem instance for a particular connection.

When a SystemConnection is created, this subsystem's factory will be asked to create an instance of its subsystem. If desired, your GUI may also allow users to create additional instances.

There are only a handleful of methods to implement in child classes (and indeed most of these are supplied as empty, so you only override those you want to support). These are required:

These are optional:


Nested Class Summary
protected  class SubSystem.ChangeStatusJob
          Represents the operation of changing the connection status of this subsystem.
 class SubSystem.ConnectJob
          Represents the subsystem operation of connecting the subsystem to the remote machine.
protected  class SubSystem.DisconnectJob
          Represents the subsystem operation of disconnecting the subsystem to the remote machine.
static class SubSystem.DisplayErrorMessageJob
          Nested class which extends WorkbenchJob to allow us to show an error message, which is a GUI operation, from a non-GUI thread.
protected  class SubSystem.GetPropertiesJob
          Represents the subsystem operation of getting a set of property values from a remote object.
protected  class SubSystem.GetPropertyJob
          Represents the subsystem operation of getting a property value from a remote object.
protected  class SubSystem.ResolveAbsoluteJob
          Represents the subsystem operation of resolving absolute filter strings.
protected  class SubSystem.ResolveAbsolutesJob
          Represents the subsystem operation of resolving a set of absolute filter strings.
protected  class SubSystem.ResolveRelativeJob
          Represents the subsystem operation of resolving relative filter strings.
protected  class SubSystem.SetPropertiesJob
          Represents the subsystem operation of setting a set of properties of a remote object.
protected  class SubSystem.SetPropertyJob
          Represents the subsystem operation of setting a property of a remote object.
protected  class SubSystem.SubSystemOperationJob
          Represents an operation that can be performed by the subsystem.
 
Field Summary
protected  boolean _connectionError
           
protected  IConnectorService _connectorService
           
protected  boolean _disconnecting
           
protected  boolean _hidden
           
protected  IHost _host
           
protected  String _name
           
protected  String _subsystemConfigurationId
           
protected  boolean cancelable
           
protected  boolean doConnection
           
protected  ISystemFilterPoolReferenceManager filterPoolReferenceManager
           
protected static int OPERATION_CANCEL_SHELL
           
protected static int OPERATION_CONNECT
           
protected static int OPERATION_DISCONNECT
           
protected static int OPERATION_GET_PROPERTIES
           
protected static int OPERATION_GET_PROPERTY
           
protected static int OPERATION_REMOVE_SHELL
           
protected static int OPERATION_RESOLVE_ABSOLUTE
           
protected static int OPERATION_RESOLVE_ABSOLUTES
           
protected static int OPERATION_RESOLVE_RELATIVE
           
protected static int OPERATION_RUN_COMMAND
           
protected static int OPERATION_RUN_SHELL
           
protected static int OPERATION_SEND_COMMAND_TO_SHELL
           
protected static int OPERATION_SET_PROPERTIES
           
protected static int OPERATION_SET_PROPERTY
           
protected  ISubSystemConfiguration parentSubSystemConfiguration
           
protected  ProgressMonitorDialog pmDialog
           
protected  String previousUserIdKey
           
protected  boolean runInThread
           
protected  String saveFileName
           
protected  Shell shell
           
protected  boolean sortResults
           
protected static String SUBSYSTEM_FILE_NAME
           
protected  boolean supportsConnecting
           
 
Fields inherited from class org.eclipse.rse.core.model.RSEModelObject
_isDirty, _wasRestored
 
Fields inherited from interface org.eclipse.rse.model.ISystemResourceChangeEvents
EVENT_ADD, EVENT_ADD_FILTER_REFERENCE, EVENT_ADD_FILTERSTRING_REFERENCE, EVENT_ADD_MANY, EVENT_ADD_RELATIVE, EVENT_CHANGE_CHILDREN, EVENT_CHANGE_FILTER_REFERENCE, EVENT_CHANGE_FILTERSTRING_REFERENCE, EVENT_COLLAPSE_ALL, EVENT_COLLAPSE_SELECTED, EVENT_COMMAND_FINISHED, EVENT_COMMAND_HISTORY_UPDATE, EVENT_COMMAND_MESSAGE, EVENT_COMMAND_RUN, EVENT_COMMAND_SHELL_FINISHED, EVENT_COMMAND_SHELL_REMOVED, EVENT_COMPILE_COMMAND_RUN, EVENT_DELETE, EVENT_DELETE_FILTER_REFERENCE, EVENT_DELETE_FILTERSTRING_REFERENCE, EVENT_DELETE_MANY, EVENT_EXPAND_SELECTED, EVENT_ICON_CHANGE, EVENT_MOVE_FILTER_REFERENCES, EVENT_MOVE_FILTERSTRING_REFERENCES, EVENT_MOVE_MANY, EVENT_MUST_COLLAPSE, EVENT_PROPERTY_CHANGE, EVENT_PROPERTYSHEET_UPDATE, EVENT_REFRESH, EVENT_REFRESH_REMOTE, EVENT_REFRESH_SELECTED, EVENT_REFRESH_SELECTED_FILTER, EVENT_REFRESH_SELECTED_PARENT, EVENT_RENAME, EVENT_RENAME_FILTER_REFERENCE, EVENT_REPLACE_CHILDREN, EVENT_REVEAL_AND_SELECT, EVENT_SEARCH_FINISHED, EVENT_SELECT, EVENT_SELECT_EXPAND, EVENT_SELECT_REMOTE, PROPERTYSHEET_UPDATE_EVENT
 
Constructor Summary
protected SubSystem(IHost host, IConnectorService connectorService)
           
 
Method Summary
protected  void addResolvedFilterStringObjects(Vector allChildrenSoFar, Object[] childrenForThisFilterString, String[] allFilterStrings, int currFilterStringIndex)
          Overridable extension point for adding the results of a filter string to the overall list of results.
 void checkIsConnected()
          This is a helper method you can call when performing actions that must be certain there is a connection.
 void clearLocalUserId()
          Called to clear the local user Id such that subsequent requests to getUserId() will return the parent connection's default user Id.
 boolean commit()
          Request a persistence manager to persist this object.
 void connect()
          Attempt to connect to the remote system when a Shell is not available.
 void connect(boolean forcePrompt)
          Connect to the remote system, optionally forcing a signon prompt even if the password is cached in memory or on disk.
 boolean contains(ISchedulingRule rule)
           
 void deletingConnection()
          Private method called when the parent connection is being deleted, so the subsystem can do any pre-death cleanup it needs to.
 void disconnect()
          Disconnect from the remote system You do not need to override this, as it does the progress monitor and error message displaying for you.
 void disconnect(boolean collapseTree)
          Disconnect from the remote system You do not need to override this, as it does the progress monitor and error message displaying for you.
protected  void displayAsyncMsg(SystemMessageException msg)
          Display message on message thread
 boolean doesFilterListContentsOf(ISystemFilter filter, String remoteObjectAbsoluteName)
          Return true if the given filter lists the contents of the given remote object.
 boolean doesFilterMatch(ISystemFilter filter, String remoteObjectAbsoluteName)
          Return true if the given remote object name will pass the filtering criteria for any of the filter strings in this filter.
 boolean doesFilterStringListContentsOf(ISystemFilterString filterString, String remoteObjectAbsoluteName)
          Return true if the given filter string lists the contents of the given remote object.
 boolean doesFilterStringMatch(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive)
          Return true if the given remote object name will pass the filtering criteria for the given filter string.
protected  boolean doesFilterTypeMatch(ISystemFilter filter, String remoteObjectAbsoluteName)
          Override this method if you support typed filters.
 void filterEventFilterCreated(Object selectedObject, ISystemFilter newFilter)
          A new filter has been created.
 void filterEventFilterPoolReferenceCreated(ISystemFilterPoolReference newPoolRef)
          A new filter pool reference has been created.
 void filterEventFilterPoolReferenceDeleted(ISystemFilterPoolReference filterPoolRef)
          A filter pool reference has been deleted
 void filterEventFilterPoolReferenceRenamed(ISystemFilterPoolReference poolRef, String oldName)
          A filter pool reference has been renamed (ie, its reference filter pool renamed)
 void filterEventFilterPoolReferenceReset(ISystemFilterPoolReference filterPoolRef)
          A single filter pool reference has been reset to reference a new pool
 void filterEventFilterPoolReferencesRePositioned(ISystemFilterPoolReference[] poolRefs, int delta)
          One or more filter pool references have been re-ordered within their manager
 void filterEventFilterPoolReferencesReset()
          All filter pool references has been reset.
 void filterEventFilterStringCreated(Object selectedObject, ISystemFilterString newFilterString)
          A new filter string has been created.
protected  void fireEvent(Object[] multiSrc, int eventId, Object parent)
           
protected  void fireEvent(Object[] src, int eventId, Object parent, int position)
           
protected  void fireEvent(Object src, int eventId, Object parent)
           
protected  void fireEvent(Object src, int eventId, Object parent, Object grandParent)
           
protected  void fireEvent(SystemResourceChangeEvent event)
           
protected  void fireEvent(SystemResourceChangeEvent event, Object grandParent)
           
 boolean forceUserIdToUpperCase()
          Return true if userId and password should be forced to uppercase.
static Shell getActiveWorkbenchShell()
          Helper/convenience method.
static IWorkbenchWindow getActiveWorkbenchWindow()
          Helper/convenience method.
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 ICacheManager getCacheManager()
          Return the CacheManager for this subsystem.
 Object[] getChildren()
          Return the children of this subsystem, to populate the GUI subtree of this subsystem.
 String getConfigurationId()
          Private.
 String getConnectionOwnedFilterPoolName(String profileName, String connectionName)
          Constructs the name of a connection specific filter pool from its parts.
 ISystemFilterPool getConnectionPrivateFilterPool(boolean createIfNotFound)
          Find or create a new filter pool, unique to this subsystem's connection.
 IConnectorService getConnectorService()
          Return the IConnectorService object that represents the live connection for this system.
 String[] getExecutedCommands()
          Provide list of executed commands on subsystem.This is only applicable if the subsystem factory reports true for supportsCommands().
 ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
          Private.
protected  Object getFilterReferenceWithAbsoluteName(String key)
          Return the filter reference that corresponds to the specified key.
protected  String getFirstParentFilterString(Object parent)
          Called by resolveFilterString when given null for the filter string, meaning we defer getting a filter string until later, where we query it from the parent.
 IHost getHost()
          Return the connection object this subsystem is associated with.
 String getHostAliasName()
          Return the name of system connection object this subsystem is associated with.
 String getHostName()
          Return the host name for the connection this system's subsystem is associated with
 String getLocalUserId()
          Alternative to getUserId when we don't want to resolve it from parent connection.
protected  String getLocalUserId(String key)
          Internal-use method for getting the local user ID, without resolution.
 String getName()
          Private.
 Object getObjectWithAbsoluteName(String key)
          For drag and drop, and clipboard, support of remote objects.
protected  String getPreferencesKey()
          Helper method to compute a unique name for a given subsystem instance
protected  String getPreferencesKey(String profileName, String connectionName)
          Helper method to compute a unique name for a given subsystem instance, given a profile and connection name
protected  SystemPreferencesManager getPreferencesManager()
          Helper method to return preference manager
 ISubSystem getPrimarySubSystem()
          Return the primary subsystem associated with this subsystem's IConnectorService
 String[] getProperties(Object subject, String[] keys)
          Get a remote property.
 String getProperty(Object subject, String key)
          Get a remote property.
 PropertyPage getPropertyPage(Composite parent)
          Return the single property page to show in the tabbed notebook for the for SubSystem property of the parent Connection.
protected static String getQueryingMessage()
          Helper method to return the message "Querying properties..."
protected static String getQueryingMessage(String key)
          Helper method to return the message "Querying &1..."
 String getRemoteAttribute(String attributeName)
          Deprecated.  
protected static String getResolvingMessage(String filterString)
          Helper method to return the message "Resolving to &1..."
protected  IRunnableContext getRunnableContext()
          Get the progress monitor dialog for this operation.
protected static String getRunningMessage(String cmd)
          Helper method to return the message "Running command &1..."
protected static String getSettingMessage()
          Helper method to return the message "Setting properties..."
protected static String getSettingMessage(String key)
          Helper method to return the message "Setting &1..."
protected  Shell getShell()
          Return the shell for the current operation
 ISubSystemConfiguration getSubSystemConfiguration()
          Return the parent subsystem factory that owns this subsystem.
 ISystemFilterPoolReferenceManager getSystemFilterPoolReferenceManager()
          Return the system filter pool reference manager, as per the interface SystemFilterPoolReferenceManagerProvider
 ISystemProfile getSystemProfile()
          Return the system profile object this subsystem is associated with.
 String getSystemProfileName()
          Return the name of system profile object this subsystem is associated with.
 String getSystemType()
          Return the system type for this connection.
 Object getTargetForFilter(ISystemFilterReference filterRef)
          Returns the parent object associated with a filter reference.
 Object[] getTargetsForFilter(ISystemFilterReference filterRef)
           
 ISystemFilterPool getUniqueOwningSystemFilterPool(boolean createIfNotFound)
          Return the owning filter pool that is unique to this provider.
 String getUserId()
          Returns the value of this subsystem's local user id if it is not null.
 String getVendorAttribute(String vendor, String attributeName)
          For business partners defining their own subsystems.
 boolean hasChildren()
          CHILD CLASSES MAY OVERRIDE THIS.
protected  boolean implicitConnect(boolean isConnectOperation, IProgressMonitor mon, String msg, int totalWorkUnits)
           
abstract  void initializeSubSystem(IProgressMonitor monitor)
          This gets called after the corresponding IConnectorService connect method finishes.
protected  void internalConnect(IProgressMonitor monitor)
          Connect to the remote host.
protected  void internalDisconnect(IProgressMonitor monitor)
          Actually disconnect from the remote host.
protected  String[] internalGetProperties(IProgressMonitor monitor, Object subject, String[] keys)
          Actually get multiple remote properties.
protected  String internalGetProperty(IProgressMonitor monitor, Object subject, String key)
          Actually get a remote property.
protected  Object[] internalResolveFilterString(IProgressMonitor monitor, Object parent, String filterString)
          Resolve a relative filter string.
protected  Object[] internalResolveFilterString(IProgressMonitor monitor, String filterString)
          Resolve an absolute filter string.
 Object[] internalResolveFilterStrings(IProgressMonitor monitor, String[] filterStrings)
          Resolve multiple absolute filter strings.
protected  Object internalSetProperties(IProgressMonitor monitor, Object subject, String[] keys, String[] values)
          Actually set multiple remote properties.
protected  Object internalSetProperty(IProgressMonitor monitor, Object subject, String key, String value)
          Actually set a remote property.
 boolean isConflicting(ISchedulingRule rule)
           
 boolean isConnected()
          Return true if this subsystem is currently connected to its remote system.
 boolean isConnectionError()
          Return true if the last attempt to connect this subsystem to its remote system failed.
 boolean isHidden()
          Private.
 boolean isOffline()
          Returns the offline property for this subsystem's System Connection.
 boolean isPrimarySubSystem()
           
 boolean promptForPassword()
          A convenience method, fully equivalent to promptForPassword(false).
 boolean promptForPassword(boolean force)
          Prompt the user for a password to the remote system.
 void renamingConnection(String newName)
          The connection is being renamed, so we are called to do our thing with any information stored that is keyed by the connection name.
 void renamingProfile(String oldName, String newName)
          The profile is being renamed, so we are called to do our thing with any information stored that is keyed by the profile name.
 Object[] resolveFilterString(IProgressMonitor monitor, Object parent, String filterString)
          Modal thread version of resolve filter strings Resolve an absolute filter string.
 Object[] resolveFilterString(IProgressMonitor monitor, String filterString)
          Modal thread version of resolve filter strings Resolve an absolute filter string.
 Object[] resolveFilterString(Object parent, String filterString)
          Resolve a relative filter string.
 Object[] resolveFilterString(String filterString)
          Resolve an absolute filter string.
 Object[] resolveFilterStrings(IProgressMonitor monitor, String[] filterStrings)
          Modal thread version of resolve filter strings Resolve an absolute filter string.
 Object[] resolveFilterStrings(String[] filterStrings)
          Resolve multiple absolute filter strings.
protected  IStatus scheduleJob(SubSystem.SubSystemOperationJob job, ISchedulingRule rule, boolean synch)
           
protected  ISubSystem selectCommandSubSystem(ISubSystem[] allCmdSubSystems)
          Internal method to select the appropriate command subsystem when there are multiple defined for this connection.
 void setConfigurationId(String newConfigurationId)
          Private.
 void setConnectionError(boolean error)
          Sets whether the last attempt to connect this subsystem to its remote system failed.
 void setConnectorService(IConnectorService connectorService)
          Set the connector service for this subsystem
 void setFilterPoolReferenceManager(ISystemFilterPoolReferenceManager newFilterPoolReferenceManager)
          Generated persistent property method
Set the object that manages the list of filter pools referenced by this subsystem.
 void setHidden(boolean newHidden)
          Private.
 void setHost(IHost conn)
          Set the parent connection that owns this subsystem.
 void setName(String newName)
          Private.
 Object setProperties(Object subject, String[] keys, String[] values)
          Set multiple remote properties.
 Object setProperty(Object subject, String key, String value)
          Set a remote property.
 void setRemoteAttribute(String attributeName, String attributeValue)
          Deprecated.  
 void setSubSystemConfiguration(ISubSystemConfiguration ssf)
          Return the parent subsystem factory that owns this subsystem.
 void setVendorAttribute(String vendor, String attributeName, String attributeValue)
          For business partners defining their own subsystems.
protected  void showConnectCancelledMessage(Shell shell, String hostName, int port)
          Show an error message when the user cancels the connection.
protected  void showConnectErrorMessage(Shell shell, String hostName, int port, Throwable exc)
          Show an error message when the connection fails.
protected  void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
          Show an error message when the user cancels the disconnection.
protected  void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc)
          Show an error message when the disconnection fails.
protected  void showOperationCancelledMessage(Shell shell)
          Show an error message when the user cancels the operation.
protected  void showOperationErrorMessage(Shell shell, Throwable exc)
          Show an error message when the operation fails.
protected  void showOperationMessage(Exception exc, Shell shell)
           
protected  Object[] sortResolvedFilterStringObjects(Object[] input)
          Sort the concatenated list of all objects returned by resolving one or more filter strings.
 boolean supportsCaching()
          Check if the SubSystem supports caching.
 
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject
compareStrings, getDescription, isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.subsystems.ISubSystem
uninitializeSubSystem
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEModelObject
getDescription
 
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.persistance.IRSEPersistableContainer
isDirty, setDirty, setWasRestored, wasRestored
 

Field Detail

SUBSYSTEM_FILE_NAME

protected static final String SUBSYSTEM_FILE_NAME
See Also:
Constant Field Values

OPERATION_RESOLVE_ABSOLUTE

protected static final int OPERATION_RESOLVE_ABSOLUTE
See Also:
Constant Field Values

OPERATION_RESOLVE_ABSOLUTES

protected static final int OPERATION_RESOLVE_ABSOLUTES
See Also:
Constant Field Values

OPERATION_RESOLVE_RELATIVE

protected static final int OPERATION_RESOLVE_RELATIVE
See Also:
Constant Field Values

OPERATION_RUN_COMMAND

protected static final int OPERATION_RUN_COMMAND
See Also:
Constant Field Values

OPERATION_GET_PROPERTY

protected static final int OPERATION_GET_PROPERTY
See Also:
Constant Field Values

OPERATION_SET_PROPERTY

protected static final int OPERATION_SET_PROPERTY
See Also:
Constant Field Values

OPERATION_GET_PROPERTIES

protected static final int OPERATION_GET_PROPERTIES
See Also:
Constant Field Values

OPERATION_SET_PROPERTIES

protected static final int OPERATION_SET_PROPERTIES
See Also:
Constant Field Values

OPERATION_CONNECT

protected static final int OPERATION_CONNECT
See Also:
Constant Field Values

OPERATION_DISCONNECT

protected static final int OPERATION_DISCONNECT
See Also:
Constant Field Values

OPERATION_RUN_SHELL

protected static final int OPERATION_RUN_SHELL
See Also:
Constant Field Values

OPERATION_SEND_COMMAND_TO_SHELL

protected static final int OPERATION_SEND_COMMAND_TO_SHELL
See Also:
Constant Field Values

OPERATION_CANCEL_SHELL

protected static final int OPERATION_CANCEL_SHELL
See Also:
Constant Field Values

OPERATION_REMOVE_SHELL

protected static final int OPERATION_REMOVE_SHELL
See Also:
Constant Field Values

parentSubSystemConfiguration

protected ISubSystemConfiguration parentSubSystemConfiguration

previousUserIdKey

protected String previousUserIdKey

shell

protected Shell shell

supportsConnecting

protected boolean supportsConnecting

sortResults

protected boolean sortResults

runInThread

protected boolean runInThread

cancelable

protected boolean cancelable

doConnection

protected boolean doConnection

pmDialog

protected ProgressMonitorDialog pmDialog

saveFileName

protected String saveFileName

_connectorService

protected IConnectorService _connectorService

_connectionError

protected boolean _connectionError

_disconnecting

protected boolean _disconnecting

_host

protected IHost _host

_name

protected String _name

_subsystemConfigurationId

protected String _subsystemConfigurationId

_hidden

protected boolean _hidden

filterPoolReferenceManager

protected ISystemFilterPoolReferenceManager filterPoolReferenceManager
Constructor Detail

SubSystem

protected SubSystem(IHost host,
                    IConnectorService connectorService)
Method Detail

selectCommandSubSystem

protected ISubSystem selectCommandSubSystem(ISubSystem[] allCmdSubSystems)
Internal method to select the appropriate command subsystem when there are multiple defined for this connection. The default implementation is to return the first, but child classes can refine this. Input is always an array of length greater than one.


getSubSystemConfiguration

public ISubSystemConfiguration getSubSystemConfiguration()
Return the parent subsystem factory that owns this subsystem.

Specified by:
getSubSystemConfiguration in interface ISubSystem

setSubSystemConfiguration

public void setSubSystemConfiguration(ISubSystemConfiguration ssf)
Return the parent subsystem factory that owns this subsystem.

Specified by:
setSubSystemConfiguration in interface ISubSystem

setHost

public void setHost(IHost conn)
Set the parent connection that owns this subsystem.

Specified by:
setHost in interface ISubSystem

forceUserIdToUpperCase

public boolean forceUserIdToUpperCase()
Return true if userId and password should be forced to uppercase. INTERACTIVEcut to calling same method in parent connection.

Specified by:
forceUserIdToUpperCase in interface ISubSystem

renamingProfile

public void renamingProfile(String oldName,
                            String newName)
The profile is being renamed, so we are called to do our thing with any information stored that is keyed by the profile name.

This is called AFTER the profile is renamed!

Specified by:
renamingProfile in interface ISubSystem

renamingConnection

public void renamingConnection(String newName)
The connection is being renamed, so we are called to do our thing with any information stored that is keyed by the connection name.

Specified by:
renamingConnection in interface ISubSystem

deletingConnection

public void deletingConnection()
Private method called when the parent connection is being deleted, so the subsystem can do any pre-death cleanup it needs to.

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

Specified by:
deletingConnection in interface ISubSystem

getUserId

public String getUserId()
Returns the value of this subsystem's local user id if it is not null. If it is null, it returns the parent connection object's default user Id. It in turn queries the preferences if its local value is null.

In fact, we now don't store the user Id in the subsystem object itself, but rather store it in the user preferences, so that such things are not shared among the team on a synchronize operation. This is transparent to callers of this method however, as this method resolves from the preferences.

Specified by:
getUserId in interface ISubSystem
Returns:
The value of the UserId attribute
See Also:
IHost.getDefaultUserId(), #setUserId(String), getLocalUserId(), clearLocalUserId()

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,
                                   String connectionName)
Helper method to compute a unique name for a given subsystem instance, given a profile and connection name


getLocalUserId

protected String getLocalUserId(String key)
Internal-use method for getting the local user ID, without resolution.


getLocalUserId

public String getLocalUserId()
Alternative to getUserId when we don't want to resolve it from parent connection. This is used when showing the properties.

Unlike getUserId() this one does not defer to the connection's default user Id if the subsystem's userId attribute is null.

To set the local user Id, simply call setUserId(String id). To clear it, call clearLocalUserId().

Specified by:
getLocalUserId in interface ISubSystem
See Also:
IHost.getDefaultUserId(), clearLocalUserId(), getUserId(), #setUserId(String)

clearLocalUserId

public void clearLocalUserId()
Called to clear the local user Id such that subsequent requests to getUserId() will return the parent connection's default user Id. Sets the user Id attribute for this subsystem to null.

Specified by:
clearLocalUserId in interface ISubSystem
See Also:
IHost.getDefaultUserId(), getUserId(), getLocalUserId(), #setUserId(String)

checkIsConnected

public void checkIsConnected()
                      throws SystemMessageException
This is a helper method you can call when performing actions that must be certain there is a connection. If there is no connection it will attempt to connect, and if that fails will throw a SystemMessageException you can easily display to the user by using a method in it.

Specified by:
checkIsConnected in interface ISubSystem
Throws:
SystemMessageException

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.

By default this returns Platform.getAdapterManager().getAdapter(this, adapterType); This in turn results in the default subsystem adapter SystemViewSubSystemAdapter, in package org.eclipse.rse.ui.view.

Specified by:
getAdapter in interface IAdaptable

getSystemProfile

public ISystemProfile getSystemProfile()
Return the system profile object this subsystem is associated with.

Specified by:
getSystemProfile in interface ISubSystem
See Also:
ISubSystem.getName()

getSystemProfileName

public String getSystemProfileName()
Return the name of system profile object this subsystem is associated with.

Specified by:
getSystemProfileName in interface ISubSystem
Returns:
The value of the profile that owns the connection that owns this subsystem. Fastpath.

getHost

public IHost getHost()
Return the connection object this subsystem is associated with.

Specified by:
getHost in interface ISubSystem

getHostAliasName

public String getHostAliasName()
Return the name of system connection object this subsystem is associated with.

Specified by:
getHostAliasName in interface ISubSystem
Returns:
The name of the connection that owns this. Same as getSystemConnection().getAliasName()

getUniqueOwningSystemFilterPool

public ISystemFilterPool getUniqueOwningSystemFilterPool(boolean createIfNotFound)
Return the owning filter pool that is unique to this provider. From SystemFilterPoolReferenceManagerProvider interface. We map to a call to getConnectionPrivateFilterPool(boolean).

Specified by:
getUniqueOwningSystemFilterPool in interface ISystemFilterPoolReferenceManagerProvider

getConnectionPrivateFilterPool

public ISystemFilterPool getConnectionPrivateFilterPool(boolean createIfNotFound)
Find or create a new filter pool, unique to this subsystem's connection. This will be in the same profile as the connection and it will follow a naming convention that ties it to the connection.

Parameters:
createIfNotFound - - true to create the pool if it doesn't exist
Returns:
the filter pool that was found or created

getConnectionOwnedFilterPoolName

public String getConnectionOwnedFilterPoolName(String profileName,
                                               String connectionName)
Constructs the name of a connection specific filter pool from its parts.

Parameters:
profileName - the name of the profile that contains this filter pool.
connectionName - the name of the connection the "owns" this filter pool.
Returns:
the name for the connection-owned filter pool.

doesFilterTypeMatch

protected boolean doesFilterTypeMatch(ISystemFilter filter,
                                      String remoteObjectAbsoluteName)
Override this method if you support typed filters. Given an absolute remote object name, you can test if this filter's type matches that of the remote object. This is called as a pre-test in the following methods.


doesFilterListContentsOf

public boolean doesFilterListContentsOf(ISystemFilter filter,
                                        String remoteObjectAbsoluteName)
Return true if the given filter lists the contents of the given remote object. For example, if given a folder, return true if any of the filter strings in this filter lists the contents of that folder. Used in impact analysis when a remote object is created, deleted, renamed, copied or moved, so as to establish which filters need to be refreshed or collapsed (if the folder is deleted, say).

Subclasses do not need to override this method. Rather, this method walks each filter string and calls doesFilterStringListContentsOf(...), and that is the method that child classes must override.

Specified by:
doesFilterListContentsOf in interface ISubSystem

doesFilterStringListContentsOf

public boolean doesFilterStringListContentsOf(ISystemFilterString filterString,
                                              String remoteObjectAbsoluteName)
Return true if the given filter string lists the contents of the given remote object. For example, if given a folder, return true if the given filter string lists the contents of that folder. Used in impact analysis when a remote object is created, deleted, renamed, copied or moved, so as to establish which filters need to be refreshed or collapsed (if the folder is deleted, say).

This should only return true if the filter string directly lists the contents of the given object, versus indirectly.

Subclasses should override this.

Specified by:
doesFilterStringListContentsOf in interface ISubSystem

doesFilterMatch

public boolean doesFilterMatch(ISystemFilter filter,
                               String remoteObjectAbsoluteName)
Return true if the given remote object name will pass the filtering criteria for any of the filter strings in this filter.

Subclasses do not need to override this method. Rather, this method walks each filter string and calls doesFilterStringMatch(...), and that is the method that child classes must override.

Specified by:
doesFilterMatch in interface ISubSystem

doesFilterStringMatch

public boolean doesFilterStringMatch(String filterString,
                                     String remoteObjectAbsoluteName,
                                     boolean caseSensitive)
Return true if the given remote object name will pass the filtering criteria for the given filter string.

Subclasses need to override this. If in doubt, return true.

Specified by:
doesFilterStringMatch in interface ISubSystem

getPropertyPage

public PropertyPage getPropertyPage(Composite parent)
Return the single property page to show in the tabbed notebook for the for SubSystem property of the parent Connection. Return null if no page is to be contributed for this. You are limited to a single page, so you may have to compress. It is recommended you prompt for the port if applicable since the common base subsystem property page is not shown To help with this you can use the SystemPortPrompt widget.


getObjectWithAbsoluteName

public Object getObjectWithAbsoluteName(String key)
                                 throws Exception
For drag and drop, and clipboard, support of remote objects.

Return the object within the subsystem that corresponds to the specified unique ID. Because each subsystem maintains it's own objects, it's the responsability of the subsystem to determine how an ID (or key) for a given object maps to the real object. By default this returns null.

This is the functional opposite of ISystemRemoteElementAdapter.getAbsoluteName(Object).

Specified by:
getObjectWithAbsoluteName in interface IRemoteObjectResolver
Throws:
Exception

getFilterReferenceWithAbsoluteName

protected Object getFilterReferenceWithAbsoluteName(String key)
Return the filter reference that corresponds to the specified key. If there is no such filter reference, return null;

Parameters:
key - the absolute name for an object.
Returns:
a filter reference if there is one matching the key

setVendorAttribute

public void setVendorAttribute(String vendor,
                               String attributeName,
                               String attributeValue)
Deprecated. use property sets directly now

Description copied from interface: ISubSystem
For business partners defining their own subsystems. This method allows an attribute to be persisted in this subsystem, given the following information: Warning do not use any of the following characters in any of given parameters, or it will cause problems with parsing:

Specified by:
setVendorAttribute in interface ISubSystem

getVendorAttribute

public String getVendorAttribute(String vendor,
                                 String attributeName)
Deprecated. use property sets directly now

Description copied from interface: ISubSystem
For business partners defining their own subsystems. This method allows retrieval of a persisted attribute in this subsystem, given the following information:

Specified by:
getVendorAttribute in interface ISubSystem
Returns:
value of the attribute being queried, or null if not found

setRemoteAttribute

public void setRemoteAttribute(String attributeName,
                               String attributeValue)
Deprecated.  


getRemoteAttribute

public String getRemoteAttribute(String attributeName)
Deprecated.  


getSystemType

public String getSystemType()
Return the system type for this connection.


getHostName

public String getHostName()
Return the host name for the connection this system's subsystem is associated with


displayAsyncMsg

protected void displayAsyncMsg(SystemMessageException msg)
Display message on message thread


getSystemFilterPoolReferenceManager

public ISystemFilterPoolReferenceManager getSystemFilterPoolReferenceManager()
Return the system filter pool reference manager, as per the interface SystemFilterPoolReferenceManagerProvider

Specified by:
getSystemFilterPoolReferenceManager in interface ISystemFilterPoolReferenceManagerProvider

fireEvent

protected void fireEvent(SystemResourceChangeEvent event)

fireEvent

protected void fireEvent(SystemResourceChangeEvent event,
                         Object grandParent)

fireEvent

protected void fireEvent(Object src,
                         int eventId,
                         Object parent)

fireEvent

protected void fireEvent(Object[] multiSrc,
                         int eventId,
                         Object parent)

fireEvent

protected void fireEvent(Object[] src,
                         int eventId,
                         Object parent,
                         int position)

fireEvent

protected void fireEvent(Object src,
                         int eventId,
                         Object parent,
                         Object grandParent)

filterEventFilterPoolReferenceCreated

public void filterEventFilterPoolReferenceCreated(ISystemFilterPoolReference newPoolRef)
A new filter pool reference has been created. Fire the appropriate events for this.

Specified by:
filterEventFilterPoolReferenceCreated in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterPoolReferenceDeleted

public void filterEventFilterPoolReferenceDeleted(ISystemFilterPoolReference filterPoolRef)
A filter pool reference has been deleted

Specified by:
filterEventFilterPoolReferenceDeleted in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterPoolReferenceReset

public void filterEventFilterPoolReferenceReset(ISystemFilterPoolReference filterPoolRef)
A single filter pool reference has been reset to reference a new pool

Specified by:
filterEventFilterPoolReferenceReset in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterPoolReferencesReset

public void filterEventFilterPoolReferencesReset()
All filter pool references has been reset. Happens after SelectFilterPools dialog

Specified by:
filterEventFilterPoolReferencesReset in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterPoolReferenceRenamed

public void filterEventFilterPoolReferenceRenamed(ISystemFilterPoolReference poolRef,
                                                  String oldName)
A filter pool reference has been renamed (ie, its reference filter pool renamed)

Specified by:
filterEventFilterPoolReferenceRenamed in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterPoolReferencesRePositioned

public void filterEventFilterPoolReferencesRePositioned(ISystemFilterPoolReference[] poolRefs,
                                                        int delta)
One or more filter pool references have been re-ordered within their manager

Specified by:
filterEventFilterPoolReferencesRePositioned in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterCreated

public void filterEventFilterCreated(Object selectedObject,
                                     ISystemFilter newFilter)
A new filter has been created. This is called when a filter pool reference is selected and a new filter is created, so that the provider can expand the selected filter pool reference and reveal the new filter within the selected pool reference.

Only the selected node should be expanded if not already. All other references to this pool will already have been informed of the new addition, and will have refreshed their children but not expanded them.

Specified by:
filterEventFilterCreated in interface ISystemFilterPoolReferenceManagerProvider

filterEventFilterStringCreated

public void filterEventFilterStringCreated(Object selectedObject,
                                           ISystemFilterString newFilterString)
A new filter string has been created. This is called when a filter reference is selected and a new filter string is created, so that the provider can expand the selected filter reference and reveal the new filter string within the selected filter reference.

Only the selected node should be expanded if not already. All other references to this filter will already have been informed of the new addition, and will have refreshed their children but not expanded them.

Specified by:
filterEventFilterStringCreated in interface ISystemFilterPoolReferenceManagerProvider

implicitConnect

protected boolean implicitConnect(boolean isConnectOperation,
                                  IProgressMonitor mon,
                                  String msg,
                                  int totalWorkUnits)
                           throws SystemMessageException,
                                  InvocationTargetException,
                                  InterruptedException
Throws:
SystemMessageException
InvocationTargetException
InterruptedException

showOperationMessage

protected void showOperationMessage(Exception exc,
                                    Shell shell)

showConnectErrorMessage

protected void showConnectErrorMessage(Shell shell,
                                       String hostName,
                                       int port,
                                       Throwable exc)
Show an error message when the connection fails. Shows a common message by default. Overridable.


showConnectCancelledMessage

protected void showConnectCancelledMessage(Shell shell,
                                           String hostName,
                                           int port)
Show an error message when the user cancels the connection. Shows a common message by default. Overridable.


showDisconnectErrorMessage

protected void showDisconnectErrorMessage(Shell shell,
                                          String hostName,
                                          int port,
                                          Exception exc)
Show an error message when the disconnection fails. Shows a common message by default. Overridable.


showDisconnectCancelledMessage

protected void showDisconnectCancelledMessage(Shell shell,
                                              String hostName,
                                              int port)
Show an error message when the user cancels the disconnection. Shows a common message by default. Overridable.


getResolvingMessage

protected static String getResolvingMessage(String filterString)
Helper method to return the message "Resolving to &1..."


getRunningMessage

protected static String getRunningMessage(String cmd)
Helper method to return the message "Running command &1..."


getQueryingMessage

protected static String getQueryingMessage(String key)
Helper method to return the message "Querying &1..."


getSettingMessage

protected static String getSettingMessage(String key)
Helper method to return the message "Setting &1..."


getQueryingMessage

protected static String getQueryingMessage()
Helper method to return the message "Querying properties..."


getSettingMessage

protected static String getSettingMessage()
Helper method to return the message "Setting properties..."


showOperationErrorMessage

protected void showOperationErrorMessage(Shell shell,
                                         Throwable exc)
Show an error message when the operation fails. Shows a common message by default, unless the exception is of type SystemMessageException, in which case the message is retrieved via getSystemMessage() and it is shown. Overridable.


showOperationCancelledMessage

protected void showOperationCancelledMessage(Shell shell)
Show an error message when the user cancels the operation. Shows a common message by default. Overridable.


isConnected

public boolean isConnected()
Return true if this subsystem is currently connected to its remote system. If the subsystem configuration indicates its subsystems support connecting, then this method will call getSystem().isConnect().

Specified by:
isConnected in interface ISubSystem

isOffline

public boolean isOffline()
Returns the offline property for this subsystem's System Connection.

Specified by:
isOffline in interface ISubSystem

hasChildren

public boolean hasChildren()
CHILD CLASSES MAY OVERRIDE THIS. By default it returns true iff we support filters and there are filter pool references.

Specified by:
hasChildren in interface ISubSystem

getChildren

public Object[] getChildren()
Return the children of this subsystem, to populate the GUI subtree of this subsystem. By default, this method: So, be sure to override this method IF you do not support filters.

Specified by:
getChildren in interface ISubSystem

resolveFilterString

public Object[] resolveFilterString(String filterString)
                             throws Exception
Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for SubSystemConfiguration.supportsFilters(), which is the default. Otherwise, getChildren() is called when the subsystem itself is expanded.

When a user expands a filter this method is invoked for each filter string and the results are concatenated and displayed to the user. You can affect the post-concatenated result by overriding sortResolvedFilterStringObjects(Object[]) if you desire to sort the result, say, or pick our redundancies.

The resulting objects are displayed in the tree in the Remote System view. There are two requirements on the returned objects:

  1. They must implement IAdaptable.
  2. Their must be an RSE remote-adapter registered for the object's class or interface type. Further, if this subsystem is visible in the RSE, which is the default, then there must also be an RSE GUI-adapter registered with the platform. The base class implementation of this interface is AbstractSystemViewAdapter.

A good place to start with your remote-resource classes to subclasss AbstractResource, as it already implements IAdaptable, and maintains a reference to this owning subsystem, which helps when implementing the remote-adapter.

Be sure to register your adapter factory in your plugin's startup method.

You do not need to override this, as it does the progress monitor and error message displaying for you. Just override internalResolveFilterString.

Specified by:
resolveFilterString in interface ISubSystem
Parameters:
filterString - filter pattern for objects to return.
Returns:
Array of objects that are the result of this filter string
Throws:
Exception

resolveFilterStrings

public Object[] resolveFilterStrings(String[] filterStrings)
                              throws Exception
Resolve multiple absolute filter strings. This is only applicable if the subsystem factory reports true for supportsFilters().

This is the same as #resolveFilterString(String,Shell) but takes an array of filter strings versus a single filter string.

The default implementation of this simply calls #resolveFilterString(String,Shell) once for each filter string, and concatenates the result. The method sortResolvedFilterStringObject is called on the concatenated result, given subclasses an opportunity to sort the result.

After successful resolve, the sort method is called to sort the concatenated results before returning them.

Specified by:
resolveFilterStrings in interface ISubSystem
Parameters:
filterStrings - array of filter patterns for objects to return.
Returns:
Array of objects that are the result of resolving all the filter strings
Throws:
Exception

scheduleJob

protected IStatus scheduleJob(SubSystem.SubSystemOperationJob job,
                              ISchedulingRule rule,
                              boolean synch)
                       throws InterruptedException
Throws:
InterruptedException

sortResolvedFilterStringObjects

protected Object[] sortResolvedFilterStringObjects(Object[] input)
Sort the concatenated list of all objects returned by resolving one or more filter strings. The default implementation does nothing. Child classes can override if they wish to show their resulting objects sorted.


resolveFilterString

public Object[] resolveFilterString(IProgressMonitor monitor,
                                    String filterString)
                             throws Exception
Modal thread version of resolve filter strings Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for supportsFilters().

When a user expands a filter containing filter strings, this method is invoked for each filter string.

The resulting objects are displayed in the remote system view tree. They can be anything, but at a minimum must support IAdaptable in order to drive the property sheet. You can just defer the getAdapter request to the platform's Adapter manager if desired.

You should supply an adapter class for the returned object's class, to render objects in the Remote System Explorer view. It will uses a label and content provider that defers all requests to the adapter, which it gets by querying the platform's adapter manager for the object type. Be sure to register your adapter factory.

Specified by:
resolveFilterString in interface ISubSystem
Parameters:
monitor - the process monitor associated with this operation
filterString - filter pattern for objects to return.
Returns:
Array of objects that are the result of this filter string
Throws:
Exception

resolveFilterStrings

public Object[] resolveFilterStrings(IProgressMonitor monitor,
                                     String[] filterStrings)
                              throws Exception
Modal thread version of resolve filter strings Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for supportsFilters().

When a user expands a filter containing filter strings, this method is invoked for each filter string.

The resulting objects are displayed in the remote system view tree. They can be anything, but at a minimum must support IAdaptable in order to drive the property sheet. You can just defer the getAdapter request to the platform's Adapter manager if desired.

You should supply an adapter class for the returned object's class, to render objects in the Remote System Explorer view. It will uses a label and content provider that defers all requests to the adapter, which it gets by querying the platform's adapter manager for the object type. Be sure to register your adapter factory.

Specified by:
resolveFilterStrings in interface ISubSystem
Parameters:
monitor - the process monitor associated with this operation
filterStrings - filter patterns for objects to return.
Returns:
Array of objects that are the result of this filter string
Throws:
Exception

resolveFilterString

public Object[] resolveFilterString(IProgressMonitor monitor,
                                    Object parent,
                                    String filterString)
                             throws Exception
Modal thread version of resolve filter strings Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for supportsFilters().

When a user expands a filter containing filter strings, this method is invoked for each filter string.

The resulting objects are displayed in the remote system view tree. They can be anything, but at a minimum must support IAdaptable in order to drive the property sheet. You can just defer the getAdapter request to the platform's Adapter manager if desired.

You should supply an adapter class for the returned object's class, to render objects in the Remote System Explorer view. It will uses a label and content provider that defers all requests to the adapter, which it gets by querying the platform's adapter manager for the object type. Be sure to register your adapter factory.

Specified by:
resolveFilterString in interface ISubSystem
Parameters:
monitor - the process monitor associated with this operation
parent - the object to query
filterString - filter pattern for objects to return.
Returns:
Array of objects that are the result of this filter string
Throws:
Exception

resolveFilterString

public Object[] resolveFilterString(Object parent,
                                    String filterString)
                             throws Exception
Resolve a relative filter string.

When a user expands a remote resource this method is invoked and the results are potentially sorted and displayed to the user. You can affect the sorting behaviour by overriding sortResolvedFilterStringObjects(Object[]) if you desire to sort the result, say, or pick our redundancies.

The resulting objects are displayed in the tree in the Remote System view. There are two requirements on the returned objects:

  1. They must implement IAdaptable.
  2. Their must be an RSE remote-adapter registered for the object's class or interface type. Further, if this subsystem is visible in the RSE, which is the default, then there must also be an RSE GUI-adapter registered with the platform. The base class implementation of this interface is AbstractSystemViewAdapter.

A good place to start with your remote-resource classes to subclasss AbstractResource, as it already implements IAdaptable, and maintains a reference to this owning subsystem, which helps when implementing the remote-adapter.

Be sure to register your adapter factory in your plugin's startup method.

You do not need to override this, as it does the progress monitor and error message displaying for you. Override internalResolveFilterString instead.

Specified by:
resolveFilterString in interface ISubSystem
Parameters:
parent - Object that is being expanded.
filterString - filter pattern for children of parent. Typically just "*".
Returns:
Array of objects that are the result of this filter string
Throws:
Exception

getExecutedCommands

public String[] getExecutedCommands()
Provide list of executed commands on subsystem.This is only applicable if the subsystem factory reports true for supportsCommands().


setProperty

public Object setProperty(Object subject,
                          String key,
                          String value)
                   throws Exception
Set a remote property. Subsystems interpret as they wish. Eg, this might be to set a remote environment variable. This is only applicable if the subsystem factory reports true for supportsProperties().

Specified by:
setProperty in interface ISubSystem
Parameters:
subject - Identifies which object to get the properties of
key - Identifies property to set
value - Value to set property to
Returns:
Object interpretable by subsystem. Might be a Boolean, or the might be new value for confirmation.
Throws:
Exception

getProperty

public String getProperty(Object subject,
                          String key)
                   throws Exception
Get a remote property. Subsystems interpret as they wish. Eg, this might be to get a remote environment variable. This is only applicable if the subsystem factory reports true for supportsProperties().

Specified by:
getProperty in interface ISubSystem
Parameters:
subject - Identifies which object to get the properties of
key - Identifies property to get value of
Returns:
String The value of the requested key.
Throws:
Exception

setProperties

public Object setProperties(Object subject,
                            String[] keys,
                            String[] values)
                     throws Exception
Set multiple remote properties. Subsystems interpret as they wish. Eg, this might be to set a number of remote environment variables. This is only applicable if the subsystem factory reports true for supportsProperties().

Specified by:
setProperties in interface ISubSystem
Parameters:
subject - Identifies which object to get the properties of
Returns:
Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation.
Throws:
Exception

initializeSubSystem

public abstract void initializeSubSystem(IProgressMonitor monitor)
This gets called after the corresponding IConnectorService connect method finishes. This method should be overridden if any initialization for the subsystem needs to occur at this time

Specified by:
initializeSubSystem in interface ISubSystem

connect

public void connect()
             throws Exception
Attempt to connect to the remote system when a Shell is not available. You do not need to override this, as it does the progress monitor and error message displaying for you.

Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor).

Specified by:
connect in interface ISubSystem
Throws:
Exception

connect

public void connect(boolean forcePrompt)
             throws Exception
Connect to the remote system, optionally forcing a signon prompt even if the password is cached in memory or on disk. You do not need to override this, as it does the progress monitor and error message displaying for you.

Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor).

Specified by:
connect in interface ISubSystem
Parameters:
forcePrompt - Forces the signon prompt to be displayed even if a valid password in cached in memory or saved on disk.
Throws:
Exception

promptForPassword

public boolean promptForPassword()
                          throws Exception
A convenience method, fully equivalent to promptForPassword(false).

Throws:
Exception

promptForPassword

public boolean promptForPassword(boolean force)
                          throws Exception
Prompt the user for a password to the remote system. The primary request was something else, but we have detected the user is not connected so we prompt for password outside of the progress monitor, then set a flag to do the connection within the progress monitor.

Parameters:
force - true if the prompting should be forced, false if prompting can be skipped if credentials have been stored.
Returns:
true if the credentials are obtained
Throws:
Exception

disconnect

public void disconnect()
                throws Exception
Disconnect from the remote system You do not need to override this, as it does the progress monitor and error message displaying for you.

Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).

Specified by:
disconnect in interface ISubSystem
Throws:
Exception

disconnect

public void disconnect(boolean collapseTree)
                throws Exception
Disconnect from the remote system You do not need to override this, as it does the progress monitor and error message displaying for you.

Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).

Specified by:
disconnect in interface ISubSystem
Parameters:
collapseTree - collapse the tree in the system view
Throws:
Exception

getProperties

public String[] getProperties(Object subject,
                              String[] keys)
                       throws Exception
Get a remote property. Subsystems interpret as they wish. Eg, this might be to get a remote environment variable. This is only applicable if the subsystem factory reports true for supportsProperties().

Specified by:
getProperties in interface ISubSystem
Parameters:
subject - Identifies which object to get the properties of
Returns:
Object The values of the requested keys.
Throws:
Exception

getConnectorService

public IConnectorService getConnectorService()
Return the IConnectorService object that represents the live connection for this system. This must return an object that implements IConnectorService. A good starting point for that is the base class AbstractConnectorService.

If you only have a single subsystem class, you may override this method to return the IConnectorService object that manages the connect/disconnect actions. If, on the other hand, you have multiple subsystem classes that desire to share a single IConnectorService connection, (ie, share the same communications pipe) then do not override this. By default, this calls getSystemManager() which returns an AbstractConnectorServiceManager object that manages maintaining a singleton IConnectorService object per system connection. You should subclass AbstractSystemManager, and override getSystemManager() to return a singleton instance of that subclass.

Default implementation:


   return getSystemManager().getSystemObject(this);
 

We recommending using a subclass of AbstractConnectorServiceManager even for single subsystems, because it doesn't hurt and allows easy growth if new subsystems are added in the future.

Specified by:
getConnectorService in interface ISubSystem

setConnectorService

public void setConnectorService(IConnectorService connectorService)
Description copied from interface: ISubSystem
Set the connector service for this subsystem

Specified by:
setConnectorService in interface ISubSystem
Parameters:
connectorService -

supportsCaching

public boolean supportsCaching()
Check if the SubSystem supports caching. This is the default implementation which returns false. Subclasses must override to support caching.

Specified by:
supportsCaching in interface ISubSystem

getCacheManager

public ICacheManager getCacheManager()
Return the CacheManager for this subsystem. This is the default implementation which just returns null.

Specified by:
getCacheManager in interface ISubSystem
See Also:
supportsCaching()

internalConnect

protected void internalConnect(IProgressMonitor monitor)
                        throws InvocationTargetException,
                               InterruptedException
Connect to the remote host. This is called by the run(IProgressMonitor monitor) method.

DO NOT OVERRIDE THIS. Rather, this calls connect(IProgressMonitor) in the IConnectorService class that is returned from getConnectorService().

Your connect method in your IConnectorService class must follow these IRunnableWithProgress rules:

Throws:
InvocationTargetException
InterruptedException

internalDisconnect

protected void internalDisconnect(IProgressMonitor monitor)
                           throws InvocationTargetException,
                                  InterruptedException
Actually disconnect from the remote host. This is called by the run(IProgressMonitor monitor) method.

You DO NOT OVERRIDE THIS. Rather, this calls connect(IProgressMonitor) in your IConnectorService class that is returned from getConnectorService(). That is where your code to disconnect should go!

Your disconnect method in your IConnectorService class must follow these IRunnableWithProgress rules:

Throws:
InvocationTargetException
InterruptedException

internalResolveFilterString

protected Object[] internalResolveFilterString(IProgressMonitor monitor,
                                               String filterString)
                                        throws InvocationTargetException,
                                               InterruptedException
Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for SubSystemConfiguration.supportsFilters(), which is the default. Otherwise, getChildren() is called when the subsystem itself is expanded.

When a user expands a filter this method is invoked for each filter string and the results are concatenated and displayed to the user. You can affect the post-concatenated result by overriding sortResolvedFilterStringObjects(Object[]) if you desire to sort the result, say, or pick our redundancies.

The resulting objects are displayed in the tree in the Remote System view. There are two requirements on the returned objects:

  1. They must implement IAdaptable.
  2. Their must be an RSE remote-adapter registered for the object's class or interface type. Further, if this subsystem is visible in the RSE, which is the default, then there must also be an RSE GUI-adapter registered with the platform. The base class implementation of this interface is AbstractSystemViewAdapter.

A good place to start with your remote-resource classes to subclasss AbstractResource, as it already implements IAdaptable, and maintains a reference to this owning subsystem, which helps when implementing the remote-adapter.

Be sure to register your adapter factory in your plugin's startup method.

Actually resolve an absolute filter string. This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT FILTERS!

Throws:
InvocationTargetException
InterruptedException

internalResolveFilterStrings

public Object[] internalResolveFilterStrings(IProgressMonitor monitor,
                                             String[] filterStrings)
                                      throws InvocationTargetException,
                                             InterruptedException
Resolve multiple absolute filter strings. This is only applicable if the subsystem factory reports true for supportsFilters().

This is the same as #resolveFilterString(String,Shell) but takes an array of filter strings versus a single filter string.

The default implementation of this simply calls #resolveFilterString(String,Shell) once for each filter string, and concatenates the result. The method sortResolvedFilterStringObject is called on the concatenated result, given subclasses an opportunity to sort the result.

After successful resolve, the sort method is called to sort the concatenated results before returning them.

Parameters:
monitor - the progress monitor we are running under
filterStrings - array of filter patterns for objects to return.
Returns:
Array of objects that are the result of resolving all the filter strings
Throws:
InvocationTargetException
InterruptedException

addResolvedFilterStringObjects

protected void addResolvedFilterStringObjects(Vector allChildrenSoFar,
                                              Object[] childrenForThisFilterString,
                                              String[] allFilterStrings,
                                              int currFilterStringIndex)
Overridable extension point for adding the results of a filter string to the overall list of results.

Can be used to filter out redundant entries in the concatenated list, if this is desired.


internalResolveFilterString

protected Object[] internalResolveFilterString(IProgressMonitor monitor,
                                               Object parent,
                                               String filterString)
                                        throws InvocationTargetException,
                                               InterruptedException
Resolve a relative filter string.

When a user expands a remote resource this method is invoked and the results are potentially sorted and displayed to the user. You can affect the sorting behaviour by overriding sortResolvedFilterStringObjects(Object[]) if you desire to sort the result, say, or pick our redundancies.

The resulting objects are displayed in the tree in the Remote System view. There are two requirements on the returned objects:

  1. They must implement IAdaptable.
  2. Their must be an RSE remote-adapter registered for the object's class or interface type. Further, if this subsystem is visible in the RSE, which is the default, then there must also be an RSE GUI-adapter registered with the platform. The base class implementation of this interface is AbstractSystemViewAdapter.

A good place to start with your remote-resource classes to subclasss AbstractResource, as it already implements IAdaptable, and maintains a reference to this owning subsystem, which helps when implementing the remote-adapter.

Be sure to register your adapter factory in your plugin's startup method.

This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT FILTERS!

Throws:
InvocationTargetException
InterruptedException

getFirstParentFilterString

protected String getFirstParentFilterString(Object parent)
Called by resolveFilterString when given null for the filter string, meaning we defer getting a filter string until later, where we query it from the parent. In this case we need the first filter string for the progress monitor msg.
Override if needed. By default we return "*";


internalGetProperty

protected String internalGetProperty(IProgressMonitor monitor,
                                     Object subject,
                                     String key)
                              throws InvocationTargetException,
                                     InterruptedException
Actually get a remote property. This is called by the run(IProgressMonitor monitor) method, which in turn is called by getProperty(...).

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT PROPERTIES!

Throws:
InvocationTargetException
InterruptedException

internalSetProperty

protected Object internalSetProperty(IProgressMonitor monitor,
                                     Object subject,
                                     String key,
                                     String value)
                              throws InvocationTargetException,
                                     InterruptedException
Actually set a remote property. This is called by the run(IProgressMonitor monitor) method, which in turn is called by setProperty(...).

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT PROPERTIES!

Throws:
InvocationTargetException
InterruptedException

internalGetProperties

protected String[] internalGetProperties(IProgressMonitor monitor,
                                         Object subject,
                                         String[] keys)
                                  throws InvocationTargetException,
                                         InterruptedException
Actually get multiple remote properties. This is called by the run(IProgressMonitor monitor) method, which in turn is called by getProperties(...).

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT PROPERTIES!

Throws:
InvocationTargetException
InterruptedException

internalSetProperties

protected Object internalSetProperties(IProgressMonitor monitor,
                                       Object subject,
                                       String[] keys,
                                       String[] values)
                                throws InvocationTargetException,
                                       InterruptedException
Actually set multiple remote properties. This is called by the run(IProgressMonitor monitor) method, which in turn is called by setProperties(...).

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT PROPERTIES!

Throws:
InvocationTargetException
InterruptedException

getRunnableContext

protected IRunnableContext getRunnableContext()
Get the progress monitor dialog for this operation. We try to use one for all phases of a single operation, such as connecting and resolving.


getShell

protected Shell getShell()
Return the shell for the current operation


getActiveWorkbenchShell

public static Shell getActiveWorkbenchShell()
Helper/convenience method. Return shell of active window.


getActiveWorkbenchWindow

public static IWorkbenchWindow getActiveWorkbenchWindow()
Helper/convenience method. Return active window


getName

public String getName()
Private. Do not override.

Specified by:
getName in interface ISubSystem
Returns:
The value of the Name attribute

setName

public void setName(String newName)
Private. Do not override.

Specified by:
setName in interface ISubSystem
Parameters:
newName - The new value of the Name attribute

getConfigurationId

public String getConfigurationId()
Private. Do not override.

Specified by:
getConfigurationId in interface ISubSystem
Returns:
The value of the ConfigurationId attribute Ties this subsystem to its owning subsystem configuration, via the id key string of the configuration.

setConfigurationId

public void setConfigurationId(String newConfigurationId)
Private. Do not override.

Specified by:
setConfigurationId in interface ISubSystem
Parameters:
newConfigurationId - The new value of the ConfigurationId attribute

isHidden

public boolean isHidden()
Private. Do not override.

Specified by:
isHidden in interface ISubSystem
Returns:
The value of the Hidden attribute

setHidden

public void setHidden(boolean newHidden)
Private. Do not override.

Specified by:
setHidden in interface ISubSystem
Parameters:
newHidden - The new value of the Hidden attribute

getFilterPoolReferenceManager

public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
Private. Do not override.

Specified by:
getFilterPoolReferenceManager in interface ISubSystem
Returns:
The FilterPoolReferenceManager reference

setFilterPoolReferenceManager

public void setFilterPoolReferenceManager(ISystemFilterPoolReferenceManager newFilterPoolReferenceManager)
Description copied from interface: ISubSystem
Generated persistent property method
Set the object that manages the list of filter pools referenced by this subsystem. This is called by the subsystem factory when creating or restoring subsystems.

Specified by:
setFilterPoolReferenceManager in interface ISubSystem

isPrimarySubSystem

public boolean isPrimarySubSystem()
Specified by:
isPrimarySubSystem in interface ISubSystem
Returns:
true if this subsystem's properties should take precedence over other subsystems that share the same IConnectorService

getPrimarySubSystem

public ISubSystem getPrimarySubSystem()
Description copied from interface: ISubSystem
Return the primary subsystem associated with this subsystem's IConnectorService

Specified by:
getPrimarySubSystem in interface ISubSystem

getTargetForFilter

public Object getTargetForFilter(ISystemFilterReference filterRef)
Description copied from interface: ISubSystem
Returns the parent object associated with a filter reference. It's up to the subsystem implementation to decide what "parent object" means for a filter reference.

Specified by:
getTargetForFilter in interface ISubSystem
Parameters:
filterRef - the filter reference to determine a target object from.
Returns:

isConnectionError

public boolean isConnectionError()
Description copied from interface: ISubSystem
Return true if the last attempt to connect this subsystem to its remote system failed.

Specified by:
isConnectionError in interface ISubSystem

setConnectionError

public void setConnectionError(boolean error)
Description copied from interface: ISubSystem
Sets whether the last attempt to connect this subsystem to its remote system failed.

Specified by:
setConnectionError in interface ISubSystem

getTargetsForFilter

public Object[] getTargetsForFilter(ISystemFilterReference filterRef)

contains

public boolean contains(ISchedulingRule rule)
Specified by:
contains in interface ISchedulingRule
See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule)

isConflicting

public boolean isConflicting(ISchedulingRule rule)
Specified by:
isConflicting in interface ISchedulingRule
See Also:
ISchedulingRule.isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)

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.

RSE
Release 1.0

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