|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.SubSystem
public abstract class SubSystem
This class is designed to be subclassed. Its role is three-fold:
internalResolveFilterString
methods to
populate the remote resources shown when the subsystem's filters are expanded.
This is the base class that subsystem suppliers subclass. Each instance of this class represents a subsystem instance for a particular connection.
When a IHost
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 handful 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:getObjectWithAbsoluteName(String)
internalResolveFilterString(String filterString, IProgressMonitor monitor)
internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor)
internalGetProperty(Object subject, String key, IProgressMonitor monitor)
internalSetProperty(Object subject, String key, String value, IProgressMonitor monitor)
internalGetProperties(Object subject, String[] keys, IProgressMonitor monitor)
internalSetProperties(Object subject, String[] keys, String[] values, IProgressMonitor monitor)
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. |
class |
SubSystem.SystemMessageDialogRunnable
|
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer |
---|
NO_CHILDREN |
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. |
boolean |
canSwitchTo(ISubSystemConfiguration configuration)
Determine if a service subsystem is capable of switching to this new configuration. |
void |
checkIsConnected(IProgressMonitor monitor)
Check if the subsystem is connected, and connect if it's not. |
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(boolean forcePrompt,
IRSECallback callback)
Asynchronously connect to the remote system, optionally forcing a signon prompt even if the password is cached in memory or on disk. |
void |
connect(IProgressMonitor monitor,
boolean forcePrompt)
Synchronously connect to the remote system. |
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. |
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 |
IRSEInteractionProvider |
getInteractionProvider()
Get the current Interaction Provider. |
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)
Deprecated. use getObjectWithAbsoluteName(String key, IProgressMonitor monitor) |
Object |
getObjectWithAbsoluteName(String key,
IProgressMonitor monitor)
Return the remote object that corresponds to the specified unique ID. |
IRSEPersistableContainer[] |
getPersistableChildren()
Retrieves the children of this object in the persistence containment hierarchy. |
IRSEPersistableContainer |
getPersistableParent()
Retrieve the parent of this object in the persistence containment hierarchy. |
protected String |
getPreferencesKey()
Helper method to compute a unique name for a given subsystem instance |
protected String |
getPreferencesKey(String profileName,
String connectionName)
Helper method to compute a unique name for a given subsystem instance, given a profile and connection name |
ISubSystem |
getPrimarySubSystem()
Return the primary subsystem associated with this subsystem's IConnectorService |
String[] |
getProperties(Object subject,
String[] keys)
Deprecated. this shouldn't be used |
String |
getProperty(Object subject,
String key)
Deprecated. this shouldn't be used |
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()
Deprecated. this is scheduled to be removed since we want to avoid UI components in SubSystem. |
protected static String |
getRunningMessage(String cmd)
Helper method to return the message "Running command &1..." |
Class |
getServiceType()
Return the service type for this subsystem. |
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. |
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)
Deprecated. use property sets directly now |
boolean |
hasChildren()
CHILD CLASSES MAY OVERRIDE THIS. |
protected boolean |
implicitConnect(boolean isConnectOperation,
IProgressMonitor mon,
String msg,
int totalWorkUnits)
|
void |
initializeSubSystem(IProgressMonitor monitor)
Initialize this subsystem instance after the corresponding IConnectorService connect method finishes. |
protected void |
internalDisconnect(IProgressMonitor monitor)
Actually disconnect from the remote host. |
protected String[] |
internalGetProperties(Object subject,
String[] keys,
IProgressMonitor monitor)
Actually get multiple remote properties. |
protected String |
internalGetProperty(Object subject,
String key,
IProgressMonitor monitor)
Actually get a remote property. |
protected Object[] |
internalResolveFilterString(Object parent,
String filterString,
IProgressMonitor monitor)
Resolve a relative filter string. |
protected Object[] |
internalResolveFilterString(String filterString,
IProgressMonitor monitor)
Resolve an absolute filter string. |
Object[] |
internalResolveFilterStrings(String[] filterStrings,
IProgressMonitor monitor)
Resolve multiple absolute filter strings. |
protected Object |
internalSetProperties(Object subject,
String[] keys,
String[] values,
IProgressMonitor monitor)
Actually set multiple remote properties. |
protected Object |
internalSetProperty(Object subject,
String key,
String value,
IProgressMonitor monitor)
Actually set a remote property. |
protected void |
internalSwitchSubSystemConfiguration(ISubSystemConfiguration newConfiguration)
Perform the subsystem specific processing required to complete a subsystem configuration switch for a service subsystem. |
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(Object parent,
String filterString,
IProgressMonitor monitor)
Resolve a relative filter string. |
Object[] |
resolveFilterString(String filterString,
IProgressMonitor monitor)
Resolve an absolute filter string. |
Object[] |
resolveFilterStrings(String[] filterStrings,
IProgressMonitor monitor)
Resolve multiple absolute filter strings. |
protected void |
scheduleJob(SubSystem.SubSystemOperationJob job,
ISchedulingRule rule)
|
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)
Sets the IConnectorService object that represents the live connection for this system. |
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 |
setInteractionProvider(IRSEInteractionProvider p)
Set an Interaction Provider specific for this subsystem. |
void |
setName(String newName)
Private. |
Object |
setProperties(Object subject,
String[] keys,
String[] values)
Deprecated. this shouldn't be used |
Object |
setProperty(Object subject,
String key,
String value)
Deprecated. this shouldn't be used |
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)
Deprecated. use property sets directly now |
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. |
void |
switchServiceFactory(ISubSystemConfiguration config)
Switch to use another subsystem configuration. |
void |
uninitializeSubSystem(IProgressMonitor monitor)
Uninitialize this subsystem just after disconnect. |
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject |
---|
getDescription |
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer |
---|
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet |
Methods inherited from class org.eclipse.rse.core.model.RSEPersistableObject |
---|
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.model.IRSEPersistableContainer |
---|
isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Field Detail |
---|
protected static final String SUBSYSTEM_FILE_NAME
protected static final int OPERATION_RESOLVE_ABSOLUTE
protected static final int OPERATION_RESOLVE_ABSOLUTES
protected static final int OPERATION_RESOLVE_RELATIVE
protected static final int OPERATION_RUN_COMMAND
protected static final int OPERATION_GET_PROPERTY
protected static final int OPERATION_SET_PROPERTY
protected static final int OPERATION_GET_PROPERTIES
protected static final int OPERATION_SET_PROPERTIES
protected static final int OPERATION_CONNECT
protected static final int OPERATION_DISCONNECT
protected static final int OPERATION_RUN_SHELL
protected static final int OPERATION_SEND_COMMAND_TO_SHELL
protected static final int OPERATION_CANCEL_SHELL
protected static final int OPERATION_REMOVE_SHELL
protected ISubSystemConfiguration parentSubSystemConfiguration
protected String previousUserIdKey
protected Shell shell
protected boolean supportsConnecting
protected boolean sortResults
protected boolean runInThread
protected boolean cancelable
protected boolean doConnection
protected ProgressMonitorDialog pmDialog
protected String saveFileName
protected IConnectorService _connectorService
protected boolean _connectionError
protected boolean _disconnecting
protected IHost _host
protected String _name
protected String _subsystemConfigurationId
protected boolean _hidden
protected ISystemFilterPoolReferenceManager filterPoolReferenceManager
Constructor Detail |
---|
protected SubSystem(IHost host, IConnectorService connectorService)
Method Detail |
---|
public void setInteractionProvider(IRSEInteractionProvider p)
EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the Target Management team.
p
- the new interaction provider to use, or null
to
fall back to the default interaction provider (from
RSECorePlugin).public IRSEInteractionProvider getInteractionProvider()
EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the Target Management team.
protected ISubSystem selectCommandSubSystem(ISubSystem[] allCmdSubSystems)
public ISubSystemConfiguration getSubSystemConfiguration()
getSubSystemConfiguration
in interface ISubSystem
public void setSubSystemConfiguration(ISubSystemConfiguration ssf)
setSubSystemConfiguration
in interface ISubSystem
public void setHost(IHost conn)
setHost
in interface ISubSystem
public boolean forceUserIdToUpperCase()
forceUserIdToUpperCase
in interface ISubSystem
public void renamingProfile(String oldName, String newName)
This is called AFTER the profile is renamed!
renamingProfile
in interface ISubSystem
public void renamingConnection(String newName)
renamingConnection
in interface ISubSystem
public void deletingConnection()
What we need to do is delete our entry in the preference store for our userId.
deletingConnection
in interface ISubSystem
public String getUserId()
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.
getUserId
in interface ISubSystem
IHost.getDefaultUserId()
,
getLocalUserId()
,
clearLocalUserId()
protected String getPreferencesKey()
protected String getPreferencesKey(String profileName, String connectionName)
protected String getLocalUserId(String key)
public String getLocalUserId()
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()
.
getLocalUserId
in interface ISubSystem
IHost.getDefaultUserId()
,
clearLocalUserId()
,
getUserId()
public void clearLocalUserId()
clearLocalUserId
in interface ISubSystem
IHost.getDefaultUserId()
,
getUserId()
,
getLocalUserId()
public void checkIsConnected(IProgressMonitor monitor) throws SystemMessageException
ISubSystem
connect()
method
as appropriate. It also performs some exception parsing, converting
Exceptions from connect() into SystemMessageException that can be
displayed to the user by using a method in it.
If the subsystem is marked offline, or supports caching and is currently
restoring from its memento, no connect will be performed.
checkIsConnected
in interface ISubSystem
SystemMessageException
- in case of an error connectingpublic Object getAdapter(Class adapterType)
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.
getAdapter
in interface IAdaptable
public ISystemProfile getSystemProfile()
getSystemProfile
in interface ISubSystem
ISubSystem.getName()
public String getSystemProfileName()
getSystemProfileName
in interface ISubSystem
public IHost getHost()
getHost
in interface ISubSystem
public String getHostAliasName()
getHostAliasName
in interface ISubSystem
public ISystemFilterPool getUniqueOwningSystemFilterPool(boolean createIfNotFound)
getConnectionPrivateFilterPool(boolean)
.
getUniqueOwningSystemFilterPool
in interface ISystemFilterPoolReferenceManagerProvider
public ISystemFilterPool getConnectionPrivateFilterPool(boolean createIfNotFound)
createIfNotFound
- - true to create the pool if it doesn't exist
public String getConnectionOwnedFilterPoolName(String profileName, String connectionName)
profileName
- the name of the profile that contains this filter pool.connectionName
- the name of the connection the "owns" this filter pool.
protected boolean doesFilterTypeMatch(ISystemFilter filter, String remoteObjectAbsoluteName)
public boolean doesFilterListContentsOf(ISystemFilter filter, String remoteObjectAbsoluteName)
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.
doesFilterListContentsOf
in interface ISubSystem
public boolean doesFilterStringListContentsOf(ISystemFilterString filterString, String remoteObjectAbsoluteName)
This should only return true if the filter string directly lists the contents of the given object, versus indirectly.
Subclasses should override this.
doesFilterStringListContentsOf
in interface ISubSystem
public boolean doesFilterMatch(ISystemFilter filter, String remoteObjectAbsoluteName)
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.
doesFilterMatch
in interface ISubSystem
public boolean doesFilterStringMatch(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive)
Subclasses need to override this. If in doubt, return true.
doesFilterStringMatch
in interface ISubSystem
public PropertyPage getPropertyPage(Composite parent)
public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception
Since the abstract subsystem implementation does not know anything about the specific kinds of resources managed by concrete implementations, this method can only resolve filter references.
subsystem implementations must override this method in order to
resolve IDs for the remote objects they manage, to support drag and drop,
clipboard copy and other remote object resolving schemes.
Extenders that want to support filters should call
super.getObjectWithAbsoluteName(key)
when they do not find a
reference for the key themselves.
getObjectWithAbsoluteName
in interface IRemoteObjectResolver
key
- the unique id of the remote object. Must not be
null
.monitor
- the progress monitor
null
if no object is
found with the given id.
Exception
- in case an error occurs contacting the remote system
while retrieving the requested remote object. Extenders are
encouraged to throw SystemMessageException
in order to
support good user feedback in case of errors. Since exceptions
should only occur while retrieving new remote objects during
startup, clients are typically allowed to ignore these exceptions
and treat them as if the remote object were simply not there.getObjectWithAbsoluteName(String, IProgressMonitor)
public Object getObjectWithAbsoluteName(String key) throws Exception
IRemoteObjectResolver
getObjectWithAbsoluteName
in interface IRemoteObjectResolver
key
- the unique id of the remote object. Must not be
null
.
null
if no object
is found with the given id.
Exception
- in case an error occurs contacting the remote system
while retrieving the requested remote object.protected Object getFilterReferenceWithAbsoluteName(String key)
key
- the absolute name for an object.
null
if no such filter is found.public void setVendorAttribute(String vendor, String attributeName, String attributeValue)
ISubSystem
setVendorAttribute
in interface ISubSystem
public String getVendorAttribute(String vendor, String attributeName)
ISubSystem
getVendorAttribute
in interface ISubSystem
public void setRemoteAttribute(String attributeName, String attributeValue)
public String getRemoteAttribute(String attributeName)
public String getHostName()
protected void displayAsyncMsg(SystemMessageException msg)
public ISystemFilterPoolReferenceManager getSystemFilterPoolReferenceManager()
getSystemFilterPoolReferenceManager
in interface ISystemFilterPoolReferenceManagerProvider
getSystemFilterPoolReferenceManager
in interface ISubSystem
protected void fireEvent(SystemResourceChangeEvent event)
protected void fireEvent(SystemResourceChangeEvent event, Object grandParent)
protected void fireEvent(Object src, int eventId, Object parent)
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, Object grandParent)
public void filterEventFilterPoolReferenceCreated(ISystemFilterPoolReference newPoolRef)
filterEventFilterPoolReferenceCreated
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterPoolReferenceDeleted(ISystemFilterPoolReference filterPoolRef)
filterEventFilterPoolReferenceDeleted
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterPoolReferenceReset(ISystemFilterPoolReference filterPoolRef)
filterEventFilterPoolReferenceReset
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterPoolReferencesReset()
filterEventFilterPoolReferencesReset
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterPoolReferenceRenamed(ISystemFilterPoolReference poolRef, String oldName)
filterEventFilterPoolReferenceRenamed
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterPoolReferencesRePositioned(ISystemFilterPoolReference[] poolRefs, int delta)
filterEventFilterPoolReferencesRePositioned
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterCreated(Object selectedObject, ISystemFilter newFilter)
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.
filterEventFilterCreated
in interface ISystemFilterPoolReferenceManagerProvider
public void filterEventFilterStringCreated(Object selectedObject, ISystemFilterString newFilterString)
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.
filterEventFilterStringCreated
in interface ISystemFilterPoolReferenceManagerProvider
protected boolean implicitConnect(boolean isConnectOperation, IProgressMonitor mon, String msg, int totalWorkUnits) throws SystemMessageException, InvocationTargetException, OperationCanceledException
SystemMessageException
InvocationTargetException
OperationCanceledException
protected void showOperationMessage(Exception exc, Shell shell)
protected void showConnectErrorMessage(Shell shell, String hostName, int port, Throwable exc)
protected void showConnectCancelledMessage(Shell shell, String hostName, int port)
protected void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc)
protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
protected static String getResolvingMessage(String filterString)
protected static String getRunningMessage(String cmd)
protected static String getQueryingMessage(String key)
protected static String getSettingMessage(String key)
protected static String getQueryingMessage()
protected static String getSettingMessage()
protected void showOperationErrorMessage(Shell shell, Throwable exc)
protected void showOperationCancelledMessage(Shell shell)
public boolean isConnected()
isConnected
in interface ISubSystem
public boolean isOffline()
isOffline
in interface ISubSystem
public boolean hasChildren()
hasChildren
in interface ISubSystem
public Object[] getChildren()
initializeSubSystem(IProgressMonitor)
is not called in that
case. Similarly, if your subsystem declares custom images for filters or
filter pools, overriding the getChildren() call here to first load your
filter adapters and THEN super.getChildren() is a good idea.
getChildren
in interface ISubSystem
protected void scheduleJob(SubSystem.SubSystemOperationJob job, ISchedulingRule rule) throws InterruptedException
InterruptedException
protected Object[] sortResolvedFilterStringObjects(Object[] input)
public Object[] resolveFilterString(String filterString, IProgressMonitor monitor) throws Exception
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:
IAdaptable
.
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.
resolveFilterString
in interface ISubSystem
filterString
- filter pattern for objects to return.monitor
- the process monitor associated with this operation
Exception
public Object[] resolveFilterStrings(String[] filterStrings, IProgressMonitor monitor) throws Exception
This is the same as resolveFilterString(String, IProgressMonitor)
but takes an array of
filter strings versus a single filter string.
The default implementation of this simply calls internalResolveFilterStrings(String[], IProgressMonitor)
.
After successful resolve, the sort method is called to sort the concatenated results before returning them.
resolveFilterStrings
in interface ISubSystem
filterStrings
- array of filter patterns for objects to return.monitor
- the process monitor associated with this operation
Exception
public Object[] resolveFilterString(Object parent, String filterString, IProgressMonitor monitor) throws Exception
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:
IAdaptable
.
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.
resolveFilterString
in interface ISubSystem
parent
- Object that is being expanded.filterString
- filter pattern for children of parent. Typically just "*".monitor
- the process monitor associated with this operation
Exception
public String[] getExecutedCommands()
public Object setProperty(Object subject, String key, String value) throws Exception
setProperty
in interface ISubSystem
subject
- Identifies which object to get the properties ofkey
- Identifies property to setvalue
- Value to set property to
Exception
public String getProperty(Object subject, String key) throws Exception
getProperty
in interface ISubSystem
subject
- Identifies which object to get the properties ofkey
- Identifies property to get value of
Exception
public Object setProperties(Object subject, String[] keys, String[] values) throws Exception
setProperties
in interface ISubSystem
subject
- identifies which object to get the properties of.keys
- the array of propertie keys to set.values
- the array of values to set. The value at a certain index corresponds to the property key at the same index.
Exception
public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException
IConnectorService
connect method finishes. This method should be
overridden if any initialization for the subsystem needs to occur at this
time.
The default implementation currently does nothing, but overriding methods should call super before doing any other work.
initializeSubSystem
in interface ISubSystem
monitor
- a progress monitor that can be used to show progress
during long-running operation. Cancellation is typically not
supported since it might leave the system in an inconsistent
state.
SystemMessageException
- if an error occurs during initialization.public void uninitializeSubSystem(IProgressMonitor monitor)
uninitializeSubSystem
in interface ISubSystem
monitor
- a progress monitor that can be used to show progress
during long-running operation. Cancellation is typically not
supported since it might leave the system in an inconsistent
state.public void connect(IProgressMonitor monitor, boolean forcePrompt) throws Exception
ISubSystem
connect
in interface ISubSystem
monitor
- the progress monitor. Must not be null
.forcePrompt
- forces the prompt dialog to be displayed
even if the password is currently in memory.
Exception
- an exception if there is a failure to connect.
Typically, this will be a SystemMessageException
.
An OperationCanceledException
will be thrown if the user cancels the connect.public void connect(boolean forcePrompt, IRSECallback callback) throws Exception
ISubSystem
getConnectorService().connect(IProgressMonitor)
.
connect
in interface ISubSystem
forcePrompt
- forces the prompt dialog even if the password is in memcallback
- to call after connect is complete.
May be null
.
Exception
- an exception if there is a failure to connect.
Typically, this will be a SystemMessageException
.
An OperationCanceledException
will be thrown if the user cancels the connect.public boolean promptForPassword() throws Exception
Exception
public boolean promptForPassword(boolean force) throws Exception
force
- true if the prompting should be forced, false if prompting can be skipped if credentials have been stored.
Exception
public void disconnect() throws Exception
Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).
disconnect
in interface ISubSystem
Exception
public void disconnect(boolean collapseTree) throws Exception
Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).
disconnect
in interface ISubSystem
collapseTree
- collapse the tree in the system view
Exception
public String[] getProperties(Object subject, String[] keys) throws Exception
getProperties
in interface ISubSystem
subject
- Identifies which object to get the properties ofkeys
- the array of property keys.
Exception
public IConnectorService getConnectorService()
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
.
The connector service gets passed in to the constructor for the subsystem so there's normally no reason
to override this method.
getConnectorService
in interface ISubSystem
public void setConnectorService(IConnectorService connectorService)
IConnectorService
object that represents the live connection for this system.
setConnectorService
in interface ISubSystem
connectorService
- the connector servicepublic boolean supportsCaching()
supportsCaching
in interface ISubSystem
public ICacheManager getCacheManager()
getCacheManager
in interface ISubSystem
supportsCaching()
protected void internalDisconnect(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
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:
InvocationTargetException
InterruptedException
protected Object[] internalResolveFilterString(String filterString, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
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:
IAdaptable
.
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:
InvocationTargetException
InterruptedException
public Object[] internalResolveFilterStrings(String[] filterStrings, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
This is the same as internalResolveFilterString(Object, String, IProgressMonitor)
but takes an array of
filter strings versus a single filter string.
The default implementation of this simply calls internalResolveFilterString(String, IProgressMonitor)
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.
filterStrings
- array of filter patterns for objects to return.monitor
- the progress monitor we are running under
InvocationTargetException
InterruptedException
protected void addResolvedFilterStringObjects(Vector allChildrenSoFar, Object[] childrenForThisFilterString, String[] allFilterStrings, int currFilterStringIndex)
Can be used to filter out redundant entries in the concatenated list, if this is desired.
protected Object[] internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
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:
IAdaptable
.
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:
InvocationTargetException
InterruptedException
protected String getFirstParentFilterString(Object parent)
protected String internalGetProperty(Object subject, String key, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
As per IRunnableWithProgress rules:
InvocationTargetException
InterruptedException
protected Object internalSetProperty(Object subject, String key, String value, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
As per IRunnableWithProgress rules:
InvocationTargetException
InterruptedException
protected String[] internalGetProperties(Object subject, String[] keys, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
As per IRunnableWithProgress rules:
InvocationTargetException
InterruptedException
protected Object internalSetProperties(Object subject, String[] keys, String[] values, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
As per IRunnableWithProgress rules:
InvocationTargetException
InterruptedException
protected IRunnableContext getRunnableContext()
protected Shell getShell()
public String getName()
getName
in interface IRSEModelObject
getName
in interface ISubSystem
public void setName(String newName)
setName
in interface ISubSystem
newName
- The new value of the Name attributepublic String getConfigurationId()
getConfigurationId
in interface ISubSystem
public void setConfigurationId(String newConfigurationId)
setConfigurationId
in interface ISubSystem
newConfigurationId
- The new value of the ConfigurationId attributepublic boolean isHidden()
isHidden
in interface ISubSystem
public void setHidden(boolean newHidden)
setHidden
in interface ISubSystem
newHidden
- The new value of the Hidden attributepublic ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
getFilterPoolReferenceManager
in interface ISubSystem
public void setFilterPoolReferenceManager(ISystemFilterPoolReferenceManager newFilterPoolReferenceManager)
ISubSystem
setFilterPoolReferenceManager
in interface ISubSystem
public boolean isPrimarySubSystem()
isPrimarySubSystem
in interface ISubSystem
IConnectorService
public ISubSystem getPrimarySubSystem()
ISubSystem
getPrimarySubSystem
in interface ISubSystem
public Object getTargetForFilter(ISystemFilterReference filterRef)
ISubSystem
getTargetForFilter
in interface ISubSystem
filterRef
- the filter reference to determine a target object from.
public boolean isConnectionError()
ISubSystem
isConnectionError
in interface ISubSystem
public void setConnectionError(boolean error)
ISubSystem
setConnectionError
in interface ISubSystem
public Object[] getTargetsForFilter(ISystemFilterReference filterRef)
public boolean contains(ISchedulingRule rule)
contains
in interface ISchedulingRule
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
public boolean isConflicting(ISchedulingRule rule)
isConflicting
in interface ISchedulingRule
ISchedulingRule.isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
public boolean commit()
IRSEPersistableContainer
commit
in interface IRSEPersistableContainer
public IRSEPersistableContainer getPersistableParent()
IRSEPersistableContainer
getPersistableParent
in interface IRSEPersistableContainer
public IRSEPersistableContainer[] getPersistableChildren()
IRSEPersistableContainer
getPersistableChildren
in interface IRSEPersistableContainer
IRSEPersistableContainer.NO_CHILDREN
.protected void internalSwitchSubSystemConfiguration(ISubSystemConfiguration newConfiguration)
newConfiguration
- the configuration this subsystem should use from
this point.public boolean canSwitchTo(ISubSystemConfiguration configuration)
canSwitchTo
in interface ISubSystem
configuration
- the configuration to which this subsystem may switch
ISubSystem.canSwitchTo(ISubSystemConfiguration)
public void switchServiceFactory(ISubSystemConfiguration config)
switchServiceFactory
in interface ISubSystem
config
- the configuration to which to switch.ISubSystem.switchServiceFactory(ISubSystemConfiguration)
,
internalSwitchSubSystemConfiguration(ISubSystemConfiguration)
public Class getServiceType()
getServiceType
in interface ISubSystem
ISubSystem.getServiceType()
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |