Remote Systems
v6.4.1

com.ibm.etools.systems.model
Interface SystemRegistry

All Superinterfaces:
IAdaptable, ISystemViewInputProvider
All Known Implementing Classes:
SystemRegistryImpl

public interface SystemRegistry
extends 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 getTheSystemRegistry method in the SystemPlugin object.

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.


Field Summary
static String copyright
           
 
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(SystemConnection conn)
          Return true if all of the subsystems for the given connection are currently connected
 void clearRunnableContext()
          Clear the current active runnable context to be used for a progress monitor.
 void connectedStatusChange(SubSystem subsystem, boolean connected, boolean wasConnected)
          Inform the world when the connection status changes for a subsystem within a connection
 void connectedStatusChange(SubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree)
          Inform the world when the connection status changes for a subsystem within a connection
 SystemConnection copyConnection(IProgressMonitor monitor, SystemConnection conn, SystemProfile targetProfile, String newName)
          Copy a SystemConnection.
 SystemProfile copySystemProfile(IProgressMonitor monitor, SystemProfile profile, String newName, boolean makeActive)
          Copy a SystemProfile.
 SystemConnection createConnection(String systemType, String connectionName, String hostName, String description)
          Create a connection object.
 SystemConnection createConnection(String profileName, String systemType, String connectionName, String hostName, String description)
          Create a connection object.
 SystemConnection createConnection(String profileName, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation, ISystemNewConnectionWizardPage[] newConnectionWizardPages)
          Create a connection object, given the connection pool and given all the possible attributes.
 SystemConnection createLocalConnection(SystemProfile 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.
 SystemProfile createSystemProfile(String profileName, boolean makeActive)
          Create a SystemProfile given its name and whether or not to make it active
 void deleteConnection(SystemConnection conn)
          Delete an existing connection.
 boolean deleteSubSystem(SubSystem subsystem)
          Delete a subsystem object.
 void deleteSystemProfile(SystemProfile profile)
          Delete a SystemProfile.
 void disconnectAllSubSystems(SystemConnection conn)
          Disconnect all subsystems for the given connection, if they are currently connected.
 void expandConnection(SystemConnection conn)
          Expand the given connection in the RSE, if the RSE is the active perspective.
 void expandSubSystem(SubSystem subsystem)
          Expand the given subsystem in the RSE, if the RSE is the active perspective.
 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, SubSystem subsystem, String oldName, Viewer originatingViewer)
          Notify all listeners of a change to a remote resource such as a file.
 String getAbsoluteNameForConnection(SystemConnection connection)
          Return the absolute name for the specified connection
 String getAbsoluteNameForSubSystem(SubSystem subsystem)
          Return the absolute name for the specified subsystem
 String[] getActiveSystemProfileNames()
          Return the profile names currently selected by the user as his "active" profiles
 SystemProfile[] getActiveSystemProfiles()
          Return the profiles currently selected by the user as his "active" profiles
 String[] getAllSystemProfileNames()
          Return all defined profile names
 Vector getAllSystemProfileNamesVector()
          Return all defined profile names as a vector
 SystemProfile[] getAllSystemProfiles()
          Return all defined profiles
 RemoteCmdSubSystem getCmdSubSystem(SystemConnection connection)
          Return the first command subsystem for the given connection.
 RemoteCmdSubSystemFactory getCmdSubSystemFactory(String systemType)
          Return the RemoteCmdSubSystemFactory for the given system type.
 RemoteCmdSubSystem[] getCmdSubSystems(SystemConnection connection)
          Return the command subsystems for the given connection.
 SystemConnection getConnection(SystemProfile profile, String connectionName)
          Return a SystemConnection object given a system profile containing it, and a connection name uniquely identifying it.
 int getConnectionCount()
          Return the number of SystemConnection objects within all active profiles
 int getConnectionCount(String profileName)
          Return the number of SystemConnection objects within the given profile
 int getConnectionCountWithinProfile(SystemConnection conn)
          Return the number of SystemConnection objects within the given connection's owning profile
 Vector getConnectionNames(String profileName)
          Return a vector of previously-used connection names in the given named profile.
 Vector getConnectionNames(SystemProfile profile)
          Return a vector of previously-used connection names in the given profile.
 Vector getConnectionNamesForAllActiveProfiles()
          Return a vector of previously-used connection names in all active profiles.
 int getConnectionPosition(SystemConnection conn)
          Return the zero-based position of a SystemConnection object within its profile.
 SystemConnection[] getConnections()
          Return all connections in all active profiles.
 SystemConnection[] getConnectionsByProfile(String profileName)
          Return all connections in a given profile.
 SystemConnection[] getConnectionsByProfile(SystemProfile profile)
          Return all connections in a given profile name.
 SystemConnection[] getConnectionsBySubSystemFactory(SubSystemFactory factory)
          Return all connections for which there exists one or more subsystems owned by a given subsystem factory.
 SystemConnection[] getConnectionsBySubSystemFactoryCategory(String factoryCategory)
          Return all connections for which there exists one or more subsystems owned by any a given subsystem factory that is of the given category.
 SystemConnection[] getConnectionsBySubSystemFactoryId(String factoryId)
          Return all connections for which there exists one or more subsystems owned by a given subsystem factory, identified by factory Id
 SystemConnection[] getConnectionsBySystemType(String systemType)
          Return all connections for all active profiles, for the given system type.
 SystemConnection[] getConnectionsBySystemTypes(String[] systemTypes)
          Return all connections for all active profiles, for the given system types.
 RemoteFileSubSystem getFileSubSystem(SystemConnection connection)
          Return the first file subsystem for the given connection.
 RemoteFileSubSystemFactory getFileSubSystemFactory(String systemType)
          Return the RemoteFileSubSystemFactory for the given system type.
 String getFileSubSystemFactoryId(String systemType)
          Return the Id of the RemoteFileSubSystemFactory for the given system type.
 RemoteFileSubSystem[] getFileSubSystems(SystemConnection connection)
          Return the file subsystems for the given connection.
 String[] getHostNames()
          Return array of all previously specified hostnames.
 String[] getHostNames(String systemType)
          Return array of previously specified hostnames for a given system type.
 Exception getLastException()
          Return last exception object caught in any method, or null if no exception.
 SystemConnection getLocalConnection()
          Return the first connection to localhost we can find.
 boolean getQualifyConnectionNames()
          Are connection names to be qualified by profile name?
 IRunnableContext getRunnableContext()
          Return the current registered runnable context, or null if none registered.
 SubSystem getSubSystem(String absoluteSubSystemName)
          Resolve a subsystem from it's absolute name
 SubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemFactoryId)
          Resolve a subsystem from it's profile, connection and subsystem name.
 SubSystemFactory[] getSubSystemFactories()
          Return all subsystem factories.
 SubSystemFactory[] getSubSystemFactoriesByCategory(String factoryCategory)
          Return all subsystem factories which have declared themselves part of the given category.
 SubSystemFactory[] getSubSystemFactoriesBySystemType(String systemType)
          Return all subsystem factories which support the given system type.
 SubSystemFactory getSubSystemFactory(String id)
          Return the subsystemfactory, given its plugin.xml-declared id.
 SubSystemFactory getSubSystemFactory(SubSystem subsystem)
          Return the parent subsystemfactory given a subsystem object.
 ISubSystemFactoryProxy[] getSubSystemFactoryProxies()
          Public method to retrieve list of subsystem factory proxies registered by extension points.
 ISubSystemFactoryProxy[] getSubSystemFactoryProxiesByCategory(String factoryCategory)
          Return all subsystem factory proxies matching a subsystem factory category.
 SubSystem[] getSubSystems(String factoryId)
          Get a list of subsystem objects owned by the subsystem factory identified by its given plugin.xml-described id.
 SubSystem[] getSubSystems(String factoryId, SystemConnection connection)
          Get a list of subsystem objects for given connection, owned by the subsystem factory identified by its given plugin.xml-described id.
 SubSystem[] getSubSystems(SystemConnection conn)
          Return list of subsystem objects for a given connection.
 SubSystem[] getSubSystems(SystemConnection conn, boolean force)
          Return list of subsystem objects for a given connection.
 SubSystem[] getSubSystemsBySubSystemFactoryCategory(String factoryCategory, SystemConnection connection)
          Get a list of subsystem objects for given connection, owned by a subsystem factory that is of the given category.
 Clipboard getSystemClipboard()
          Returns the clipboard used for copy actions
 List getSystemClipboardObjects(int srcType)
          Returns the list of objects on the system clipboard
 SystemProfile getSystemProfile(String profileName)
          Get a SystemProfile given its name
 SystemProfileManager getSystemProfileManager()
          Return singleton profile manager
 SystemScratchpad getSystemScratchPad()
           
 boolean isAnySubSystemConnected(SystemConnection conn)
          Return true if any of the subsystems for the given connection are currently connected
 boolean isRegisteredSystemResourceChangeListener(ISystemResourceChangeListener l)
          Query if the ISystemResourceChangeListener is already listening for SystemResourceChange events
 SystemConnection moveConnection(IProgressMonitor monitor, SystemConnection conn, SystemProfile targetProfile, String newName)
          Move a SystemConnection to another profile.
 void moveConnections(String profileName, SystemConnection[] conns, int delta)
          Move existing connections a given number of positions in the same profile.
 void postEvent(ISystemResourceChangeEvent event)
          Notify all listeners of a change to a system resource such as a connection.
 void postEvent(ISystemResourceChangeListener l, ISystemResourceChangeEvent event)
          Notify a specific listener of a change to a system resource such as a connection.
 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 renameConnection(SystemConnection conn, String newName)
          Renames an existing connection.
 void renameSystemProfile(SystemProfile profile, String newName)
          Rename a SystemProfile.
 boolean restore()
          Restore all connections within active profiles
 boolean save()
          Save everything!
 boolean saveConnection(SystemConnection conn)
          Save specific connection
 boolean saveConnectionPool(SystemConnectionPool pool)
          Save specific connection pool
 void setConnectionOffline(SystemConnection conn, boolean offline)
          Update the workoffline mode for a connection.
 void setQualifyConnectionNames(boolean set)
          Set if connection names are to be qualified by profile name
 void setRunnableContext(Shell shell, IRunnableContext context)
          Set the current active runnable context to be used for a progress monitor by the subsystem methods that go to the host.
 void setShowFilterPools(boolean show)
          Reflect the user changing the preference for showing filter pools.
 void setShowNewConnectionPrompt(boolean show)
          Reflect the user changing the preference for showing new connection prompt
 void setSubSystemFactoryProxies(ISubSystemFactoryProxy[] proxies)
          Private method used by SystemPlugin to tell registry all registered subsystem factories.
 void setSystemProfileActive(SystemProfile profile, boolean makeActive)
          Make or unmake the given profile active
 void showRSEPerspective()
          Show the RSE perspective if it is not already showing
 void updateConnection(Shell shell, SystemConnection conn, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)
          Update an existing connection given the new information.
 
Methods inherited from interface com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider
getAdapter, getConnectionChildren, getShell, getSystemViewRoots, getViewer, hasConnectionChildren, hasSystemViewRoots, setShell, setViewer, showActionBar, showActions, showButtonBar, showingConnections
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Method Detail

showRSEPerspective

public void showRSEPerspective()
Show the RSE perspective if it is not already showing


expandConnection

public void expandConnection(SystemConnection conn)
Expand the given connection in the RSE, if the RSE is the active perspective.


expandSubSystem

public void expandSubSystem(SubSystem subsystem)
Expand the given subsystem in the RSE, if the RSE is the active perspective.


setRunnableContext

public void setRunnableContext(Shell shell,
                               IRunnableContext context)
Set the current active runnable context to be used for a progress monitor by the subsystem methods that go to the host. Called by wizards and dialogs that have a built-in progress monitor and hence removes the need to popup an intrusive pm dialog.

You must call clearRunnableContext when your dialog/wizard is disposed!

Parameters:
shell - The shell of the wizard/dialog. This is recorded so it can be tested if it is disposed before attempting to use the context
context - The dialog/wizard/view that implements IRunnableContext

clearRunnableContext

public void clearRunnableContext()
Clear the current active runnable context to be used for a progress monitor. Be sure to call this from you dispose method.


getRunnableContext

public IRunnableContext getRunnableContext()
Return the current registered runnable context, or null if none registered. Use this for long running operations instead of an intrusive progress monitor dialog as it is more user friendly. Many dialogs/wizards have these built in so it behooves us to use it.


setSubSystemFactoryProxies

public void setSubSystemFactoryProxies(ISubSystemFactoryProxy[] proxies)
Private method used by SystemPlugin to tell registry all registered subsystem factories. This way, all code can use this registry to access them versus the SystemPlugin.


getSubSystemFactoryProxies

public ISubSystemFactoryProxy[] getSubSystemFactoryProxies()
Public method to retrieve list of subsystem factory proxies registered by extension points.


getSubSystemFactoryProxiesByCategory

public ISubSystemFactoryProxy[] getSubSystemFactoryProxiesByCategory(String factoryCategory)
Return all subsystem factory proxies matching a subsystem factory category.

See Also:
ISubSystemFactoryCategories

getSubSystemFactories

public SubSystemFactory[] getSubSystemFactories()
Return all subsystem factories. Be careful when you call this, as it activates all subsystem factories.


getSubSystemFactory

public SubSystemFactory getSubSystemFactory(SubSystem subsystem)
Return the parent subsystemfactory given a subsystem object.


getSubSystemFactory

public SubSystemFactory getSubSystemFactory(String id)
Return the subsystemfactory, given its plugin.xml-declared id.


getFileSubSystemFactoryId

public String getFileSubSystemFactoryId(String systemType)
Return the Id of the RemoteFileSubSystemFactory for the given system type. Returns null if there is no RemoteFileSubSystemFactory for the given system type. Returns the first one if there are multiple RemoteFileSubSystemFactories for the given system type.


getFileSubSystemFactory

public RemoteFileSubSystemFactory getFileSubSystemFactory(String systemType)
Return the RemoteFileSubSystemFactory for the given system type. Returns null if there is no RemoteFileSubSystemFactory for the given system type. Returns the first one if there are multiple RemoteFileSubSystemFactories for the given system type.


getCmdSubSystemFactory

public RemoteCmdSubSystemFactory getCmdSubSystemFactory(String systemType)
Return the RemoteCmdSubSystemFactory for the given system type. Returns null if there is no RemoteCmdSubSystemFactory for the given system type. Returns the first one if there are multiple RemoteCmdSubSystemFactories for the given system type.


getSubSystemFactoriesByCategory

public SubSystemFactory[] getSubSystemFactoriesByCategory(String factoryCategory)
Return all subsystem factories which have declared themselves part of the given category.

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

See Also:
ISubSystemFactoryCategories

getSubSystemFactoriesBySystemType

public SubSystemFactory[] getSubSystemFactoriesBySystemType(String systemType)
Return all subsystem factories which support the given system type. If the type is null, returns all.


getQualifyConnectionNames

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


setQualifyConnectionNames

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


setShowFilterPools

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


setShowNewConnectionPrompt

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


getSystemProfileManager

public SystemProfileManager getSystemProfileManager()
Return singleton profile manager


getActiveSystemProfiles

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


getActiveSystemProfileNames

public String[] getActiveSystemProfileNames()
Return the profile names currently selected by the user as his "active" profiles


getAllSystemProfiles

public SystemProfile[] getAllSystemProfiles()
Return all defined profiles


getAllSystemProfileNames

public String[] getAllSystemProfileNames()
Return all defined profile names


getAllSystemProfileNamesVector

public Vector getAllSystemProfileNamesVector()
Return all defined profile names as a vector


getSystemProfile

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


createSystemProfile

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

Throws:
Exception

copySystemProfile

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

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

renameSystemProfile

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

Throws:
Exception

deleteSystemProfile

public void deleteSystemProfile(SystemProfile 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

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


getSubSystems

public SubSystem[] getSubSystems(SystemConnection 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

public SubSystem[] getSubSystems(SystemConnection 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


getSubSystem

public SubSystem getSubSystem(String srcProfileName,
                              String srcConnectionName,
                              String subsystemFactoryId)
Resolve a subsystem from it's profile, connection and subsystem name.

Parameters:
srcProfileName - the name of the profile
srcConnectionName - the name of the connection
subsystemFactoryId - the id of the subsystem
Returns:
the subsystem

getSubSystem

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

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

getAbsoluteNameForSubSystem

public String getAbsoluteNameForSubSystem(SubSystem subsystem)
Return the absolute name for the specified subsystem

Returns:
the absolute name of the subsystem

getAbsoluteNameForConnection

public String getAbsoluteNameForConnection(SystemConnection connection)
Return the absolute name for the specified connection

Returns:
the absolute name of the connection

getSubSystems

public SubSystem[] getSubSystems(String factoryId)
Get a list of subsystem objects owned by the subsystem factory identified by its given plugin.xml-described id. Array is never null, but may be of length 0.

This is a list that of all subsystems for all connections owned by the factory.


getSubSystems

public SubSystem[] getSubSystems(String factoryId,
                                 SystemConnection connection)
Get a list of subsystem objects for given connection, owned by the subsystem factory identified by its given plugin.xml-described id. Array will never be null but may be length zero.


getSubSystemsBySubSystemFactoryCategory

public SubSystem[] getSubSystemsBySubSystemFactoryCategory(String factoryCategory,
                                                           SystemConnection connection)
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:
ISubSystemFactoryCategories

getFileSubSystems

public RemoteFileSubSystem[] getFileSubSystems(SystemConnection connection)
Return the file subsystems for the given connection. These are all subsystems owned by the connection, which implement RemoteFileSubSystem.

See Also:
RemoteFileSubSystem

getFileSubSystem

public RemoteFileSubSystem getFileSubSystem(SystemConnection connection)
Return the first file subsystem for the given connection. File subsystems are those which implement RemoteFileSubSystem.

See Also:
RemoteFileSubSystem

getCmdSubSystems

public RemoteCmdSubSystem[] getCmdSubSystems(SystemConnection connection)
Return the command subsystems for the given connection. These are all subsystems owned by the connection, which implement RemoteCmdSubSystem.

See Also:
RemoteCmdSubSystem

getCmdSubSystem

public RemoteCmdSubSystem getCmdSubSystem(SystemConnection connection)
Return the first command subsystem for the given connection. Command subsystems are those which implement RemoteCmdSubSystem.

See Also:
RemoteCmdSubSystem

deleteSubSystem

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


getLocalConnection

public SystemConnection getLocalConnection()
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 createLocalConnection(SystemProfile, String, String).


getConnections

public SystemConnection[] getConnections()
Return all connections in all active profiles.


getConnectionsByProfile

public SystemConnection[] getConnectionsByProfile(SystemProfile profile)
Return all connections in a given profile name.


getConnectionsByProfile

public SystemConnection[] getConnectionsByProfile(String profileName)
Return all connections in a given profile.


getConnectionsBySubSystemFactory

public SystemConnection[] getConnectionsBySubSystemFactory(SubSystemFactory factory)
Return all connections for which there exists one or more subsystems owned by a given subsystem factory.

See Also:
getSubSystemFactory(String)

getConnectionsBySubSystemFactoryId

public SystemConnection[] getConnectionsBySubSystemFactoryId(String factoryId)
Return all connections for which there exists one or more subsystems owned by a given subsystem factory, identified by factory Id


getConnectionsBySubSystemFactoryCategory

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

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

See Also:
ISubSystemFactoryCategories

getConnectionsBySystemType

public SystemConnection[] getConnectionsBySystemType(String systemType)
Return all connections for all active profiles, for the given system type.


getConnectionsBySystemTypes

public SystemConnection[] getConnectionsBySystemTypes(String[] systemTypes)
Return all connections for all active profiles, for the given system types.


getConnection

public SystemConnection getConnection(SystemProfile profile,
                                      String connectionName)
Return a SystemConnection object given a system profile containing it, and a connection name uniquely identifying it.


getConnectionPosition

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


getConnectionCount

public int getConnectionCount(String profileName)
Return the number of SystemConnection objects within the given profile


getConnectionCountWithinProfile

public int getConnectionCountWithinProfile(SystemConnection conn)
Return the number of SystemConnection objects within the given connection's owning profile


getConnectionCount

public int getConnectionCount()
Return the number of SystemConnection objects within all active profiles


getConnectionNames

public Vector getConnectionNames(String profileName)
Return a vector of previously-used connection names in the given named profile.

Returns:
Vector of String objects.

getConnectionNames

public Vector getConnectionNames(SystemProfile profile)
Return a vector of previously-used connection names in the given profile.

Returns:
Vector of String objects.

getConnectionNamesForAllActiveProfiles

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


getHostNames

public String[] getHostNames()
Return array of all previously specified hostnames.


getHostNames

public String[] getHostNames(String systemType)
Return array of previously specified hostnames for a given system type.


getSystemClipboard

public Clipboard getSystemClipboard()
Returns the clipboard used for copy actions


getSystemClipboardObjects

public List getSystemClipboardObjects(int srcType)
Returns the list of objects on the system clipboard

Parameters:
srcType - the transfer type
Returns:
the list of clipboard objects

getSystemScratchPad

public SystemScratchpad getSystemScratchPad()

createLocalConnection

public SystemConnection createLocalConnection(SystemProfile 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.

createConnection

public SystemConnection createConnection(String profileName,
                                         String systemType,
                                         String connectionName,
                                         String hostName,
                                         String description,
                                         String defaultUserId,
                                         int defaultUserIdLocation,
                                         ISystemNewConnectionWizardPage[] newConnectionWizardPages)
                                  throws Exception
Create a connection object, given the connection pool and given all the possible attributes.

THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN THE POOL YOU SPECIFY. THE POOL 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 type names defined via the systemtype 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 ISystemUserIdConstants that tells us where to set 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

createConnection

public SystemConnection createConnection(String profileName,
                                         String 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 type names defined via the systemtype 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

createConnection

public SystemConnection createConnection(String systemType,
                                         String connectionName,
                                         String hostName,
                                         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 type names defined via the systemtype 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

updateConnection

public void updateConnection(Shell shell,
                             SystemConnection conn,
                             String systemType,
                             String connectionName,
                             String hostName,
                             String description,
                             String defaultUserId,
                             int defaultUserIdLocation)
Update an existing connection given the new information. This method:

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

setConnectionOffline

public void setConnectionOffline(SystemConnection 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

deleteConnection

public void deleteConnection(SystemConnection conn)
Delete an existing connection.

Lots to do here:

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


renameConnection

public void renameConnection(SystemConnection 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

moveConnections

public void moveConnections(String profileName,
                            SystemConnection[] 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.

TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION?

Parameters:
conns - Array of SystemConnections to move.

copyConnection

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

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

moveConnection

public SystemConnection moveConnection(IProgressMonitor monitor,
                                       SystemConnection conn,
                                       SystemProfile targetProfile,
                                       String newName)
                                throws Exception
Move a SystemConnection to another profile. All subsystems are copied, and all connection data is copied.

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

isAnySubSystemConnected

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


areAllSubSystemsConnected

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


disconnectAllSubSystems

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


connectedStatusChange

public void connectedStatusChange(SubSystem subsystem,
                                  boolean connected,
                                  boolean wasConnected)
Inform the world when the connection status changes for a subsystem within a connection


connectedStatusChange

public void connectedStatusChange(SubSystem subsystem,
                                  boolean connected,
                                  boolean wasConnected,
                                  boolean collapseTree)
Inform the world when the connection status changes for a subsystem within a connection


addSystemResourceChangeListener

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


removeSystemResourceChangeListener

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


isRegisteredSystemResourceChangeListener

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


fireEvent

public 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

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


postEvent

public void postEvent(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.

This version calls fireEvent at the next reasonable opportunity, leveraging SWT's Display.asyncExec() method.


postEvent

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

This version calls fireEvent at the next reasonable opportunity, leveraging SWT's Display.asyncExec() method.


addSystemPreferenceChangeListener

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


removeSystemPreferenceChangeListener

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


fireEvent

public 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

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


addSystemModelChangeListener

public 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

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


fireEvent

public 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

public 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

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


addSystemRemoteChangeListener

public 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

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


fireEvent

public 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

public void fireRemoteResourceChangeEvent(int eventType,
                                          Object resource,
                                          Object resourceParent,
                                          SubSystem subsystem,
                                          String oldName,
                                          Viewer 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

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


getLastException

public 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

public boolean save()
Save everything!


saveConnectionPool

public boolean saveConnectionPool(SystemConnectionPool pool)
Save specific connection pool

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

saveConnection

public boolean saveConnection(SystemConnection conn)
Save specific connection

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

restore

public boolean restore()
Restore all connections within active profiles

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

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.