RSE
Release 2.0

org.eclipse.rse.core.model
Interface ISystemRegistry

All Superinterfaces:
IAdaptable, ISchedulingRule, ISystemViewInputProvider

public interface ISystemRegistry
extends ISchedulingRule, IAdaptable, ISystemViewInputProvider

Registry or front door for all remote system connections. There is a singleton of the class implementation of this interface. To get it, call the RSECorePlugin.getTheSystemRegistry().

The idea here is that connections are grouped by system profile. At any time, there is a user-specified number of profiles "active" and connections from each active profile are worked with.

This interface is not intended to be implemented by clients.


Method Summary
 void addSystemModelChangeListener(ISystemModelChangeListener l)
          Register your interest in being told when an RSE model resource is changed.
 void addSystemPreferenceChangeListener(ISystemPreferenceChangeListener l)
          Register your interest in being told when a system preference changes
 void addSystemRemoteChangeListener(ISystemRemoteChangeListener l)
          Register your interest in being told when a remote resource is changed.
 void addSystemResourceChangeListener(ISystemResourceChangeListener l)
          Register your interest in being told when a system resource such as a connection is changed.
 boolean areAllSubSystemsConnected(IHost conn)
          Return true if all of the subsystems for the given connection are currently connected.
 void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected)
          Inform the world when the connection status changes for a subsystem within a connection.
 void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree)
          Inform the world when the connection status changes for a subsystem within a connection.
 IHost copyHost(IHost conn, ISystemProfile targetProfile, String newName, IProgressMonitor monitor)
          Copy a SystemConnection.
 ISystemProfile copySystemProfile(ISystemProfile profile, String newName, boolean makeActive, IProgressMonitor monitor)
          Copy a SystemProfile.
 IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description)
          Create a connection object.
 IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description)
          Create a connection object.
 IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation, ISystemNewConnectionWizardPage[] newConnectionWizardPages)
          Create a host object, sometimes called a "connection", given the containing profile and given all the possible attributes.
 IHost createLocalHost(ISystemProfile profile, String name, String userId)
          Convenience method to create a local connection, as it often that one is needed for access to the local file system.
 ISubSystem[] createSubSystems(IHost host, ISubSystemConfiguration[] configurations)
          Creates subsystems for a given host and subsystem configurations.
 ISystemProfile createSystemProfile(String profileName, boolean makeActive)
          Create a SystemProfile given its name and whether or not to make it active
 void deleteHost(IHost conn)
          Delete an existing connection.
 boolean deleteSubSystem(ISubSystem subsystem)
          Delete a subsystem object.
 void deleteSystemProfile(ISystemProfile profile)
          Delete a SystemProfile.
 void disconnectAllSubSystems(IHost conn)
          Disconnect all subsystems for the given connection, if they are currently connected.
 List findFilterReferencesFor(Object resource, ISubSystem subsystem)
          Returns filter references associated with this resource under the subsystem
 List findFilterReferencesFor(Object resource, ISubSystem subsystem, boolean onlyCached)
          Returns filter references associated with this resource under the subsystem
 void fireEvent(ISystemModelChangeEvent event)
          Notify all listeners of a change to a system model resource such as a connection.
 void fireEvent(ISystemModelChangeListener l, ISystemModelChangeEvent event)
          Notify a specific listener of a change to a system model resource such as a connection.
 void fireEvent(ISystemPreferenceChangeEvent event)
          Notify all listeners of a change to a system preference You would not normally call this as the methods in this class call it when appropriate.
 void fireEvent(ISystemPreferenceChangeListener l, ISystemPreferenceChangeEvent event)
          Notify a specific listener of a change to a system preference
 void fireEvent(ISystemRemoteChangeEvent event)
          Notify all listeners of a change to a remote resource such as a file.
 void fireEvent(ISystemRemoteChangeListener l, ISystemRemoteChangeEvent event)
          Notify a specific listener of a change to a remote resource such as a file.
 void fireEvent(ISystemResourceChangeEvent event)
          Notify all listeners of a change to a system resource such as a connection.
 void fireEvent(ISystemResourceChangeListener l, ISystemResourceChangeEvent event)
          Notify a specific listener of a change to a system resource such as a connection.
 void fireModelChangeEvent(int eventType, int resourceType, Object resource, String oldName)
          Notify all listeners of a change to a system model resource such as a connection.
 void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName)
          Notify all listeners of a change to a remote resource such as a file.
 void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Object originatingViewer)
          Notify all listeners of a change to a remote resource such as a file.
 String getAbsoluteNameForConnection(IHost connection)
          Return the absolute name for the specified host (connection)
 String getAbsoluteNameForSubSystem(ISubSystem subsystem)
          Return the absolute name for the specified subsystem
 ISystemProfile[] getActiveSystemProfiles()
          Return the profiles currently selected by the user as his "active" profiles
 Object[] getConnectionChildren(IHost selectedConnection)
          This method is called by the connection adapter when the user expands a connection.
 IConnectorService[] getConnectorServices(IHost conn)
          Return the list of connector services provided for the given host
 IHost getHost(ISystemProfile profile, String connectionName)
          Return a SystemConnection object given a system profile containing it, and a connection name uniquely identifying it.
 Vector getHostAliasNames(ISystemProfile profile)
          Return a vector of previously-used connection names in the given profile.
 Vector getHostAliasNamesForAllActiveProfiles()
          Return a vector of previously-used connection names in all active profiles.
 int getHostCount()
          Return the number of SystemConnection objects within all active profiles.
 int getHostCount(ISystemProfile profile)
          Return the number of SystemConnection objects within the given profile.
 int getHostCountWithinProfile(IHost conn)
          Return the number of SystemConnection objects within the given connection's owning profile.
 String[] getHostNames(IRSESystemType systemType)
          Return array of previously specified host names for a given system type.
 int getHostPosition(IHost conn)
          Return the zero-based position of a SystemConnection object within its profile.
 IHost[] getHosts()
          Return all connections in all active profiles.
 IHost[] getHostsByProfile(ISystemProfile profile)
          Return all connections in a given profile.
 IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration config)
          Return all connections for which there exists one or more subsystems owned by a given subsystem configuration.
 IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory)
          Return all connections for which there exists one or more subsystems owned by any a given subsystem configuration that is of the given category.
 IHost[] getHostsBySystemType(IRSESystemType systemType)
          Returns all connections for all active profiles, for the given system type.
 IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes)
          Return all connections for all active profiles, for the given system types.
 Exception getLastException()
          Return last exception object caught in any method, or null if no exception.
 IHost getLocalHost()
          Return the first connection to localhost we can find.
 boolean getQualifiedHostNames()
          Are connection names to be qualified by profile name?
 ISubSystem[] getServiceSubSystems(IHost connection, Class serviceType)
          Get those subsystems that are registered against a given connection, which are an instance of ServiceSubSystem for the given serviceType.
 ISubSystem getSubSystem(String absoluteSubSystemName)
          Resolve a subsystem from it's absolute name
 ISubSystemConfiguration getSubSystemConfiguration(String id)
          Return the subsystem configuration, given its plugin.xml-declared id.
 ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies()
          Public method to retrieve list of subsystem factory proxies registered by extension points.
 ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory)
          Return all subsystem factory proxies matching a subsystem factory category.
 ISubSystemConfiguration[] getSubSystemConfigurations()
          Deprecated. use getSubSystemConfigurationProxies() and filter the list of needed subsystem configurations in order to activate only those that are really needed.
 ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicateServiceSubSystemConfigurations)
          Return all subsystem configurations which support the given system type.
 ISubSystem[] getSubSystems(IHost conn)
          Return list of subsystem objects for a given connection.
 ISubSystem[] getSubSystems(IHost conn, boolean force)
          Return list of subsystem objects for a given connection.
 ISubSystem[] getSubsystems(IHost connection, Class subsystemInterface)
          Get those subsystems that are registered against a given connection, which are an instance of the given interface class.
 ISubSystem[] getSubSystemsBySubSystemConfigurationCategory(String factoryCategory, IHost connection)
          Deprecated. use getSubSystemConfigurationProxiesByCategory(String) and instantiate only those subsystem configurations from the proxy that are really needed. Then, use ISubSystemConfiguration.getSubSystems(boolean) with a parameter true.
 ISystemFilterStartHere getSystemFilterStartHere()
          Get the SystemFilterStartHere singleton instance.
 ISystemProfile getSystemProfile(String profileName)
          Get a SystemProfile given its name
 ISystemProfileManager getSystemProfileManager()
          Return singleton profile manager
 boolean hasConnectionChildren(IHost selectedConnection)
          This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection.
 void invalidateFiltersFor(ISubSystem subsystem)
          Marks all filters for this subsystem as stale to prevent caching
 void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem)
          Marks all filters for this subsystem the contain resourceParent as stale to prevent caching
 boolean isAnySubSystemConnected(IHost conn)
          Return true if any of the subsystems for the given connection are currently connected.
 boolean isAnySubSystemSupportsConnect(IHost conn)
          Return true if any subsystem supports connecting.
 boolean isRegisteredSystemResourceChangeListener(ISystemResourceChangeListener l)
          Query if the ISystemResourceChangeListener is already listening for SystemResourceChange events
 IHost moveHost(IHost conn, ISystemProfile targetProfile, String newName, IProgressMonitor monitor)
          Move a SystemConnection to another profile.
 void moveHosts(String profileName, IHost[] conns, int delta)
          Move existing connections a given number of positions in the same profile.
 void removeSystemModelChangeListener(ISystemModelChangeListener l)
          De-Register your interest in being told when an RSE model resource is changed.
 void removeSystemPreferenceChangeListener(ISystemPreferenceChangeListener l)
          De-Register your interest in being told when a system preference changes
 void removeSystemRemoteChangeListener(ISystemRemoteChangeListener l)
          De-Register your interest in being told when a remote resource is changed.
 void removeSystemResourceChangeListener(ISystemResourceChangeListener l)
          De-Register your interest in being told when a system resource such as a connection is changed.
 void renameHost(IHost conn, String newName)
          Renames an existing connection.
 void renameSystemProfile(ISystemProfile profile, String newName)
          Rename a SystemProfile.
 boolean restore()
          Restore all connections within active profiles
 boolean save()
          Save everything!
 boolean saveHost(IHost conn)
          Save specific connection
 boolean saveHostPool(ISystemHostPool pool)
          Save specific connection pool
 void setHostOffline(IHost conn, boolean offline)
          Update the workoffline mode for a connection.
 void setQualifiedHostNames(boolean set)
          Set if connection names are to be qualified by profile name
 void setShowFilterPools(boolean show)
          Reflect the user changing the preference for showing filter pools.
 void setShowNewHostPrompt(boolean show)
          Reflect the user changing the preference for showing new connection prompt
 void setSystemProfileActive(ISystemProfile profile, boolean makeActive)
          Make or unmake the given profile active
 void updateHost(IHost host, IRSESystemType systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)
          Update an existing host given the new information.
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model.ISystemViewInputProvider
getAdapter, getShell, getSystemViewRoots, getViewer, hasSystemViewRoots, setShell, setViewer, showingConnections
 

Method Detail

getSystemFilterStartHere

ISystemFilterStartHere getSystemFilterStartHere()
Get the SystemFilterStartHere singleton instance.

Returns:
the SystemFilterStartHere singleton instance.

getSubSystemConfigurationProxies

ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies()
Public method to retrieve list of subsystem factory proxies registered by extension points.


getSubSystemConfigurationProxiesByCategory

ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory)
Return all subsystem factory proxies matching a subsystem factory category.

See Also:
ISubSystemConfigurationCategories

getSubSystemConfigurations

ISubSystemConfiguration[] getSubSystemConfigurations()
Deprecated. use getSubSystemConfigurationProxies() and filter the list of needed subsystem configurations in order to activate only those that are really needed.

Return all subsystem factories. Be careful when you call this, as it activates all subsystem configurations.


getSubSystemConfiguration

ISubSystemConfiguration getSubSystemConfiguration(String id)
Return the subsystem configuration, given its plugin.xml-declared id.


getSubSystemConfigurationsBySystemType

ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType,
                                                                 boolean filterDuplicateServiceSubSystemConfigurations)
Return all subsystem configurations which support the given system type. If the type is null, returns all.

Parameters:
systemType - system type to filter
filterDuplicateServiceSubSystemConfigurations - set false by default

getConnectionChildren

Object[] getConnectionChildren(IHost selectedConnection)
This method is called by the connection adapter when the user expands a connection. This method must return the child objects to show for that connection.

Specified by:
getConnectionChildren in interface ISystemViewInputProvider
Parameters:
selectedConnection - the connection undergoing expansion
Returns:
the list of objects under the connection

hasConnectionChildren

boolean hasConnectionChildren(IHost selectedConnection)
This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection.

Specified by:
hasConnectionChildren in interface ISystemViewInputProvider
Parameters:
selectedConnection - the connection being shown in the viewer
Returns:
true if this connection has children to be shown.

getQualifiedHostNames

boolean getQualifiedHostNames()
Are connection names to be qualified by profile name?


setQualifiedHostNames

void setQualifiedHostNames(boolean set)
Set if connection names are to be qualified by profile name


setShowFilterPools

void setShowFilterPools(boolean show)
Reflect the user changing the preference for showing filter pools.


setShowNewHostPrompt

void setShowNewHostPrompt(boolean show)
Reflect the user changing the preference for showing new connection prompt


getSystemProfileManager

ISystemProfileManager getSystemProfileManager()
Return singleton profile manager


getActiveSystemProfiles

ISystemProfile[] getActiveSystemProfiles()
Return the profiles currently selected by the user as his "active" profiles

See Also:
ISystemProfileManager.getActiveSystemProfiles()

getSystemProfile

ISystemProfile getSystemProfile(String profileName)
Get a SystemProfile given its name


createSystemProfile

ISystemProfile createSystemProfile(String profileName,
                                   boolean makeActive)
                                   throws Exception
Create a SystemProfile given its name and whether or not to make it active

Throws:
Exception

copySystemProfile

ISystemProfile copySystemProfile(ISystemProfile profile,
                                 String newName,
                                 boolean makeActive,
                                 IProgressMonitor monitor)
                                 throws Exception
Copy a SystemProfile. All connections connection data is copied.

Parameters:
profile - Source profile to copy
newName - Unique name to give copied profile
makeActive - whether to make the copied profile active or not
monitor - Progress monitor to reflect each step of the operation
Returns:
new SystemProfile object
Throws:
Exception

renameSystemProfile

void renameSystemProfile(ISystemProfile profile,
                         String newName)
                         throws Exception
Rename a SystemProfile. Rename is propagated to all subsystem factories so they can rename their filter pool managers and whatever else is required.

Throws:
Exception

deleteSystemProfile

void deleteSystemProfile(ISystemProfile profile)
                         throws Exception
Delete a SystemProfile. Prior to physically deleting the profile, we delete all the connections it has, all the subsystems they have.

As well, all the filter pools for this profile are deleted, and subsequently any cross references from subsystems in connections in other profiles are removed.

A delete event is fired for every connection deleted.

Throws:
Exception

setSystemProfileActive

void setSystemProfileActive(ISystemProfile profile,
                            boolean makeActive)
Make or unmake the given profile active


getConnectorServices

IConnectorService[] getConnectorServices(IHost conn)
Return the list of connector services provided for the given host

Parameters:
conn - the host
Returns:
the list of connector services

getSubSystems

ISubSystem[] getSubSystems(IHost conn)
Return list of subsystem objects for a given connection. If the subsystems have not all been read into memory, this loads them up


getSubSystems

ISubSystem[] getSubSystems(IHost conn,
                           boolean force)
Return list of subsystem objects for a given connection. Use the force flag to indicate whether or not to restore from disk


getSubsystems

ISubSystem[] getSubsystems(IHost connection,
                           Class subsystemInterface)
Get those subsystems that are registered against a given connection, which are an instance of the given interface class.

This method activates all subsystem configurations of the given host in order to support checking against the given interface. If lazy loading is desired, use getSubSystems(IHost, boolean) with a boolean parameter false instead, and check against the class instance in client code.

Parameters:
connection - the connection to check
subsystemInterface - the interface class to filter against
Returns:
list of matching subsystems

getServiceSubSystems

ISubSystem[] getServiceSubSystems(IHost connection,
                                  Class serviceType)
Get those subsystems that are registered against a given connection, which are an instance of ServiceSubSystem for the given serviceType.

This method activates all subsystem configurations of the given host in order to support checking against the given interface. If lazy loading is desired, use getSubSystems(IHost, boolean) with a boolean parameter false instead, and check against the class instance in client code.

Parameters:
connection - the connection to check
serviceType - the class of service to ask for
Returns:
list of matching subsystems

getSubSystem

ISubSystem getSubSystem(String absoluteSubSystemName)
Resolve a subsystem from it's absolute name

Parameters:
absoluteSubSystemName - the name of the subsystem
Returns:
the subsystem

getAbsoluteNameForSubSystem

String getAbsoluteNameForSubSystem(ISubSystem subsystem)
Return the absolute name for the specified subsystem

Parameters:
subsystem - the subsystem to query
Returns:
the absolute name of the subsystem

getAbsoluteNameForConnection

String getAbsoluteNameForConnection(IHost connection)
Return the absolute name for the specified host (connection)

Parameters:
connection - the host (aka connection) object to query
Returns:
the absolute name of the host

getSubSystemsBySubSystemConfigurationCategory

ISubSystem[] getSubSystemsBySubSystemConfigurationCategory(String factoryCategory,
                                                           IHost connection)
Deprecated. use getSubSystemConfigurationProxiesByCategory(String) and instantiate only those subsystem configurations from the proxy that are really needed. Then, use ISubSystemConfiguration.getSubSystems(boolean) with a parameter true.

Get a list of subsystem objects for given connection, owned by a subsystem factory that is of the given category. Array will never be null but may be length zero.

This looks for a match on the "category" of the subsystem factory's xml declaration in its plugin.xml file.

See Also:
ISubSystemConfigurationCategories

deleteSubSystem

boolean deleteSubSystem(ISubSystem subsystem)
Delete a subsystem object. This code finds the factory that owns it and delegates the request to that factory.


getLocalHost

IHost getLocalHost()
Return the first connection to localhost we can find. While we always create a default one in the user's profile, it is possible that this profile is not active or the connection was deleted. However, since any connection to localHost will usually do, we just search all active profiles until we find one, and return it.
If no localhost connection is found, this will return null. If one is needed, it can be created easily by calling createLocalHost(ISystemProfile, String, String).


getHosts

IHost[] getHosts()
Return all connections in all active profiles.


getHostsByProfile

IHost[] getHostsByProfile(ISystemProfile profile)
Return all connections in a given profile.


getHostsBySubSystemConfiguration

IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration config)
Return all connections for which there exists one or more subsystems owned by a given subsystem configuration.

See Also:
getSubSystemConfiguration(String)

getHostsBySubSystemConfigurationCategory

IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory)
Return all connections for which there exists one or more subsystems owned by any a given subsystem configuration that is of the given category.

This looks for a match on the "category" of the subsystem configuration's xml declaration in its plugin.xml file. Thus, it is efficient as it need not bring to life a subsystem configuration just to test its parent class type.

See Also:
ISubSystemConfigurationCategories

getHostsBySystemType

IHost[] getHostsBySystemType(IRSESystemType systemType)
Returns all connections for all active profiles, for the given system type. If the specified system type is null, an empty array is returned. In order to get an IRSESystemType, use RSECorePlugin.getTheCoreRegistry().getSystemTypeById(String)

Parameters:
systemType - The system type instance.
Returns:
The list of connections or an empty array.

getHostsBySystemTypes

IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes)
Return all connections for all active profiles, for the given system types. In order to get an IRSESystemType, use RSECorePlugin.getTheCoreRegistry().getSystemTypeById(String)


getHost

IHost getHost(ISystemProfile profile,
              String connectionName)
Return a SystemConnection object given a system profile containing it, and a connection name uniquely identifying it.


getHostPosition

int getHostPosition(IHost conn)
Return the zero-based position of a SystemConnection object within its profile.


getHostCount

int getHostCount(ISystemProfile profile)
Return the number of SystemConnection objects within the given profile.


getHostCountWithinProfile

int getHostCountWithinProfile(IHost conn)
Return the number of SystemConnection objects within the given connection's owning profile.


getHostCount

int getHostCount()
Return the number of SystemConnection objects within all active profiles.


getHostAliasNames

Vector getHostAliasNames(ISystemProfile profile)
Return a vector of previously-used connection names in the given profile.

Returns:
Vector of String objects.

getHostAliasNamesForAllActiveProfiles

Vector getHostAliasNamesForAllActiveProfiles()
Return a vector of previously-used connection names in all active profiles.


getHostNames

String[] getHostNames(IRSESystemType systemType)
Return array of previously specified host names for a given system type. After careful consideration, it is decided that if the system type is null, then no host names should be returned. Previously all for all types were returned.


createLocalHost

IHost createLocalHost(ISystemProfile profile,
                      String name,
                      String userId)
Convenience method to create a local connection, as it often that one is needed for access to the local file system.

Parameters:
profile - - the profile to create this connection in. If null is passed, we first try to find the default private profile and use it, else we take the first active profile.
name - - the name to give this profile. Must be unique and non-null.
userId - - the user ID to use as the default for the subsystems. Can be null.

createHost

IHost createHost(String profileName,
                 IRSESystemType systemType,
                 String connectionName,
                 String hostName,
                 String description,
                 String defaultUserId,
                 int defaultUserIdLocation,
                 ISystemNewConnectionWizardPage[] newConnectionWizardPages)
                 throws Exception
Create a host object, sometimes called a "connection", given the containing profile and given all the possible attributes. The profile is then scheduled to be persisted.

This method:

Parameters:
profileName - Name of the system profile the connection is to be added to.
systemType - system type matching one of the system types defined via the systemTypes extension point.
connectionName - unique connection name.
hostName - ip name of host.
description - optional description of the connection. Can be null.
defaultUserId - userId to use as the default for the subsystems.
defaultUserIdLocation - one of the constants in IRSEUserIdConstants that tells us where to store the user Id
newConnectionWizardPages - when called from the New Connection wizard this is union of the list of additional wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null.
Returns:
SystemConnection object, or null if it failed to create. This is typically because the connectionName is not unique. Call getLastException() if necessary.
Throws:
Exception

createHost

IHost createHost(String profileName,
                 IRSESystemType systemType,
                 String connectionName,
                 String hostName,
                 String description)
                 throws Exception
Create a connection object. This is a simplified version

THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN THE PROFILE YOU SPECIFY. THE PROFILE IS ALSO SAVED TO DISK.

This method:

Parameters:
profileName - Name of the system profile the connection is to be added to.
systemType - system type matching one of the system types defined via the systemTypes extension point.
connectionName - unique connection name.
hostName - ip name of host.
description - optional description of the connection. Can be null.
Returns:
SystemConnection object, or null if it failed to create. This is typically because the connectionName is not unique. Call getLastException() if necessary.
Throws:
Exception

createHost

IHost createHost(IRSESystemType systemType,
                 String connectionName,
                 String hostAddress,
                 String description)
                 throws Exception
Create a connection object. This is a very simplified version that defaults to the user's private profile, or the first active profile if there is no private profile.

THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN THE DEFAULT PRIVATE PROFILE, WHICH IS SAVED TO DISK.

This method:

Parameters:
systemType - system type matching one of the system types defined via the systemTypes extension point.
connectionName - unique connection name.
hostAddress - ip name of host.
description - optional description of the connection. Can be null.
Returns:
SystemConnection object, or null if it failed to create. This is typically because the connectionName is not unique. Call getLastException() if necessary.
Throws:
Exception

updateHost

void updateHost(IHost host,
                IRSESystemType systemType,
                String connectionName,
                String hostName,
                String description,
                String defaultUserId,
                int defaultUserIdLocation)
Update an existing host given the new information. This method:

Parameters:
host - the host to be updated
systemType - system type matching one of the system types defined via the systemTypes extension point.
connectionName - unique connection name.
hostName - ip name of host.
description - optional description of the host. Can be null.
defaultUserId - userId to use as the default for the subsystems under this host.
defaultUserIdLocation - one of the constants in IRSEUserIdConstants that tells us where to set the user Id

createSubSystems

ISubSystem[] createSubSystems(IHost host,
                              ISubSystemConfiguration[] configurations)
Creates subsystems for a given host and subsystem configurations.

Parameters:
host - the host.
configurations - the subsystem configurations.
Returns:
the array of subsystems corresponding to the array of given configurations.
Since:
2.0

setHostOffline

void setHostOffline(IHost conn,
                    boolean offline)
Update the workoffline mode for a connection.

Parameters:
conn - SystemConnection to change
offline - true if connection should be set offline, false if it should be set online

deleteHost

void deleteHost(IHost conn)
Delete an existing connection.

Lots to do here:

Assumption: firing the delete event is done elsewhere. Specifically, the doDelete method of SystemView.


renameHost

void renameHost(IHost conn,
                String newName)
                throws Exception
Renames an existing connection.

Lots to do here:

Assumption: firing the rename event is done elsewhere. Specifically, the doRename method of SystemView.

Throws:
Exception

moveHosts

void moveHosts(String profileName,
               IHost[] conns,
               int delta)
Move existing connections a given number of positions in the same profile. If the delta is negative, they are all moved up by the given amount. If positive, they are all moved down by the given amount.

Parameters:
conns - Array of SystemConnections to move.
delta - new zero-based position for the connection

copyHost

IHost copyHost(IHost conn,
               ISystemProfile targetProfile,
               String newName,
               IProgressMonitor monitor)
               throws Exception
Copy a SystemConnection. All subsystems are copied, and all connection data is copied.

Parameters:
conn - The connection to copy
targetProfile - What profile to copy into
newName - Unique name to give copied profile
monitor - Progress monitor to reflect each step of the operation
Returns:
new SystemConnection object
Throws:
Exception

moveHost

IHost moveHost(IHost conn,
               ISystemProfile targetProfile,
               String newName,
               IProgressMonitor monitor)
               throws Exception
Move a SystemConnection to another profile. All subsystems are moved, and all connection data is moved. This is actually accomplished by doing a copy operation first, and if successful deleting the original.

Parameters:
conn - The connection to move
targetProfile - What profile to move into
newName - Unique name to give copied profile. Typically this is the same as the original name, but will be different on name collisions
monitor - Progress monitor to reflect each step of the operation
Returns:
new SystemConnection object
Throws:
Exception

isAnySubSystemSupportsConnect

boolean isAnySubSystemSupportsConnect(IHost conn)
Return true if any subsystem supports connecting.

Parameters:
conn - the connection.
Returns:
true if any subsystem supports connecting, false otherwise.

isAnySubSystemConnected

boolean isAnySubSystemConnected(IHost conn)
Return true if any of the subsystems for the given connection are currently connected.


areAllSubSystemsConnected

boolean areAllSubSystemsConnected(IHost conn)
Return true if all of the subsystems for the given connection are currently connected.


disconnectAllSubSystems

void disconnectAllSubSystems(IHost conn)
Disconnect all subsystems for the given connection, if they are currently connected.


connectedStatusChange

void connectedStatusChange(ISubSystem subsystem,
                           boolean connected,
                           boolean wasConnected)
Inform the world when the connection status changes for a subsystem within a connection. Update properties for the subsystem and its connection.


connectedStatusChange

void connectedStatusChange(ISubSystem subsystem,
                           boolean connected,
                           boolean wasConnected,
                           boolean collapseTree)
Inform the world when the connection status changes for a subsystem within a connection. Update properties for the subsystem and its connection.


addSystemResourceChangeListener

void addSystemResourceChangeListener(ISystemResourceChangeListener l)
Register your interest in being told when a system resource such as a connection is changed.


removeSystemResourceChangeListener

void removeSystemResourceChangeListener(ISystemResourceChangeListener l)
De-Register your interest in being told when a system resource such as a connection is changed.


isRegisteredSystemResourceChangeListener

boolean isRegisteredSystemResourceChangeListener(ISystemResourceChangeListener l)
Query if the ISystemResourceChangeListener is already listening for SystemResourceChange events


fireEvent

void fireEvent(ISystemResourceChangeEvent event)
Notify all listeners of a change to a system resource such as a connection. You would not normally call this as the methods in this class call it when appropriate.


fireEvent

void fireEvent(ISystemResourceChangeListener l,
               ISystemResourceChangeEvent event)
Notify a specific listener of a change to a system resource such as a connection.


addSystemModelChangeListener

void addSystemModelChangeListener(ISystemModelChangeListener l)
Register your interest in being told when an RSE model resource is changed. These are model events, not GUI-optimized events.


removeSystemModelChangeListener

void removeSystemModelChangeListener(ISystemModelChangeListener l)
De-Register your interest in being told when an RSE model resource is changed.


fireEvent

void fireEvent(ISystemModelChangeEvent event)
Notify all listeners of a change to a system model resource such as a connection. You would not normally call this as the methods in this class call it when appropriate.


fireModelChangeEvent

void fireModelChangeEvent(int eventType,
                          int resourceType,
                          Object resource,
                          String oldName)
Notify all listeners of a change to a system model resource such as a connection. This one takes the information needed and creates the event for you.


fireEvent

void fireEvent(ISystemModelChangeListener l,
               ISystemModelChangeEvent event)
Notify a specific listener of a change to a system model resource such as a connection.


addSystemRemoteChangeListener

void addSystemRemoteChangeListener(ISystemRemoteChangeListener l)
Register your interest in being told when a remote resource is changed. These are model events, not GUI-optimized events.


removeSystemRemoteChangeListener

void removeSystemRemoteChangeListener(ISystemRemoteChangeListener l)
De-Register your interest in being told when a remote resource is changed.


fireEvent

void fireEvent(ISystemRemoteChangeEvent event)
Notify all listeners of a change to a remote resource such as a file. You would not normally call this as the methods in this class call it when appropriate.


fireRemoteResourceChangeEvent

void fireRemoteResourceChangeEvent(int eventType,
                                   Object resource,
                                   Object resourceParent,
                                   ISubSystem subsystem,
                                   String oldName)
Notify all listeners of a change to a remote resource such as a file. This one takes the information needed and creates the event for you.

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
resourceParent - - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
subsystem - - the subsystem which contains this remote resource. This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
oldName - - on a rename operation, this is the absolute name of the resource prior to the rename

fireRemoteResourceChangeEvent

void fireRemoteResourceChangeEvent(int eventType,
                                   Object resource,
                                   Object resourceParent,
                                   ISubSystem subsystem,
                                   String oldName,
                                   Object originatingViewer)
Notify all listeners of a change to a remote resource such as a file. This one takes the information needed and creates the event for you.

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
resourceParent - - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
subsystem - - the subsystem which contains this remote resource. This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
oldName - - on a rename operation, this is the absolute name of the resource prior to the rename
originatingViewer - - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent. This saves sending a separate event to reveal and select the new created resource on a create event, for example.

fireEvent

void fireEvent(ISystemRemoteChangeListener l,
               ISystemRemoteChangeEvent event)
Notify a specific listener of a change to a remote resource such as a file.


addSystemPreferenceChangeListener

void addSystemPreferenceChangeListener(ISystemPreferenceChangeListener l)
Register your interest in being told when a system preference changes


removeSystemPreferenceChangeListener

void removeSystemPreferenceChangeListener(ISystemPreferenceChangeListener l)
De-Register your interest in being told when a system preference changes


fireEvent

void fireEvent(ISystemPreferenceChangeEvent event)
Notify all listeners of a change to a system preference You would not normally call this as the methods in this class call it when appropriate.


fireEvent

void fireEvent(ISystemPreferenceChangeListener l,
               ISystemPreferenceChangeEvent event)
Notify a specific listener of a change to a system preference


findFilterReferencesFor

List findFilterReferencesFor(Object resource,
                             ISubSystem subsystem)
Returns filter references associated with this resource under the subsystem


findFilterReferencesFor

List findFilterReferencesFor(Object resource,
                             ISubSystem subsystem,
                             boolean onlyCached)
Returns filter references associated with this resource under the subsystem


invalidateFiltersFor

void invalidateFiltersFor(ISubSystem subsystem)
Marks all filters for this subsystem as stale to prevent caching

Parameters:
subsystem -

invalidateFiltersFor

void invalidateFiltersFor(Object resourceParent,
                          ISubSystem subsystem)
Marks all filters for this subsystem the contain resourceParent as stale to prevent caching

Parameters:
resourceParent -
subsystem -

getLastException

Exception getLastException()
Return last exception object caught in any method, or null if no exception. This has the side effect of clearing the last exception.


save

boolean save()
Save everything!


saveHostPool

boolean saveHostPool(ISystemHostPool pool)
Save specific connection pool

Returns:
true if saved ok, false if error encountered. If false, call getLastException().

saveHost

boolean saveHost(IHost conn)
Save specific connection

Returns:
true if saved ok, false if error encountered. If false, call getLastException().

restore

boolean restore()
Restore all connections within active profiles

Returns:
true if restored ok, false if error encountered. If false, call getLastException().

RSE
Release 2.0

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