Remote Systems
v6.4.1

com.ibm.etools.systems.model.impl
Class SystemRegistryImpl

java.lang.Object
  extended bycom.ibm.etools.systems.model.impl.SystemRegistryImpl
All Implemented Interfaces:
IAdaptable, ISystemModelChangeEvents, ISystemViewInputProvider, SystemRegistry

public class SystemRegistryImpl
extends Object
implements SystemRegistry, ISystemModelChangeEvents

Registry for all connections.


Field Summary
static String copyright
           
 
Fields inherited from interface com.ibm.etools.systems.model.ISystemModelChangeEvents
SYSTEM_RESOURCE_ADDED, SYSTEM_RESOURCE_ALL_RELOADED, SYSTEM_RESOURCE_CHANGED, SYSTEM_RESOURCE_REMOVED, SYSTEM_RESOURCE_RENAMED, SYSTEM_RESOURCE_REORDERED, SYSTEM_RESOURCETYPE_ALL, SYSTEM_RESOURCETYPE_COMPILECMD, SYSTEM_RESOURCETYPE_CONNECTION, SYSTEM_RESOURCETYPE_FILTER, SYSTEM_RESOURCETYPE_FILTERPOOL, SYSTEM_RESOURCETYPE_FILTERPOOLREF, SYSTEM_RESOURCETYPE_NAMEDTYPE, SYSTEM_RESOURCETYPE_PROFILE, SYSTEM_RESOURCETYPE_SUBSYSTEM, SYSTEM_RESOURCETYPE_USERACTION
 
Constructor Summary
protected SystemRegistryImpl(String logfilePath)
          Constructor.
 
Method Summary
static String addPathTerminator(String path)
          Ensure given path ends with path separator.
 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
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 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 an connection name uniquely identifying it.
 Object[] getConnectionChildren(SystemConnection selectedConnection)
          This method is called by the connection adapter when the user expands a connection.
 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.
 int getConnectionPositionInView(SystemConnection conn)
          Return the zero-based position of a SystemConnection object within all active profiles.
 SystemConnection[] getConnections()
          Return all connections in all active profiles.
 SystemConnection[] getConnectionsByProfile(String profileName)
          Return all connections in a given profile name.
 SystemConnection[] getConnectionsByProfile(SystemProfile profile)
          Return all connections in a given profile.
 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 child classes of a given subsystem factory 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.
protected  SystemConnection getPreviousConnection(SystemConnection conn)
          Return the previous connection as would be shown in the view
 boolean getQualifyConnectionNames()
          Are connection names to be qualified by profile name?
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
 IRunnableContext getRunnableContext()
          Return the current registered runnable context, or null if none registered.
 Shell getShell()
          Return the shell of the current viewer
 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.
protected  Vector getSubSystemFactories(SystemConnection conn)
          Return Vector of subsystem factories that apply to a given system connection
protected  Vector getSubSystemFactories(SystemConnection[] conns)
          Return Vector of subsystem factories that apply to a given system connection array
protected  Vector getSubSystemFactories(SystemConnection conn, Vector factories)
          Return Vector of subsystem factories that apply to a given system connection, updating given vector
 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.
 SubSystem[] getSubSystemsLazily(SystemConnection conn)
          Return list of subsystem objects for a given connection, but does not force as-yet-non-restored subsystems to come to life.
 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
static SystemRegistry getSystemRegistry()
          Return singleton instance assuming it already exists.
static SystemRegistry getSystemRegistry(String logfilePath)
          Return singleton instance.
 SystemScratchpad getSystemScratchPad()
           
 Object[] getSystemViewRoots()
          Return the children objects to consistute the root elements in the system view tree.
 Viewer getViewer()
          Return the viewer we are currently associated with
 boolean hasConnectionChildren(SystemConnection selectedConnection)
          This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection.
 boolean hasSystemViewRoots()
          Return true if getSystemViewRoots() will return a non-empty list We return true if there are any connections for any active profile.
static ModelFactory initMOF()
          Initialize the MOF package.
 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
 void loadAll()
          Load everything into memory.
 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 listener, 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.
 void reset()
          Reset for a full refresh from disk, such as after a team synch
 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 attribute 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 setShell(Shell shell)
          Set the shell in case it is needed for anything.
 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 setViewer(Viewer viewer)
          Set the viewer in case it is needed for anything.
 boolean showActionBar()
          Return true to show the action bar (ie, toolbar) above the viewer.
 boolean showActions()
          Return true to show right-click popup actions on objects in the tree.
 boolean showButtonBar()
          Return true to show the button bar above the viewer.
 boolean showingConnections()
          Return true if we are listing connections or not, so we know whether we are interested in connection-add events
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

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

SystemRegistryImpl

protected SystemRegistryImpl(String logfilePath)
Constructor. This is protected as the singleton instance should be retrieved by calling getSystemRegistry().

Parameters:
logfilePath - Root folder. Where to place the log file.
Method Detail

reset

public void reset()
Reset for a full refresh from disk, such as after a team synch


getSystemRegistry

public static SystemRegistry getSystemRegistry(String logfilePath)
Return singleton instance. Must be used on first instantiate.

Parameters:
logfilePath - Root folder. Where to place the log file.

getSystemRegistry

public static SystemRegistry getSystemRegistry()
Return singleton instance assuming it already exists.


addPathTerminator

public static String addPathTerminator(String path)
Ensure given path ends with path separator.


showRSEPerspective

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

Specified by:
showRSEPerspective in interface SystemRegistry

expandConnection

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

Specified by:
expandConnection in interface SystemRegistry

expandSubSystem

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

Specified by:
expandSubSystem in interface SystemRegistry

getSystemViewRoots

public Object[] getSystemViewRoots()
Return the children objects to consistute the root elements in the system view tree. We return all connections for all active profiles.

Specified by:
getSystemViewRoots in interface ISystemViewInputProvider

hasSystemViewRoots

public boolean hasSystemViewRoots()
Return true if getSystemViewRoots() will return a non-empty list We return true if there are any connections for any active profile.

Specified by:
hasSystemViewRoots in interface ISystemViewInputProvider

getConnectionChildren

public Object[] getConnectionChildren(SystemConnection 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

hasConnectionChildren

public boolean hasConnectionChildren(SystemConnection selectedConnection)
This method is called by the connection adapter when deciding to show a plus-sign or not beside a connection. Return true if this connection has children to be shown.

Specified by:
hasConnectionChildren in interface ISystemViewInputProvider

getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface ISystemViewInputProvider

setShell

public void setShell(Shell shell)
Set the shell in case it is needed for anything. The label and content provider will call this.

Specified by:
setShell in interface ISystemViewInputProvider

getShell

public Shell getShell()
Return the shell of the current viewer

Specified by:
getShell in interface ISystemViewInputProvider

showActionBar

public boolean showActionBar()
Return true to show the action bar (ie, toolbar) above the viewer. The action bar contains connection actions, predominantly.

Specified by:
showActionBar in interface ISystemViewInputProvider

showButtonBar

public boolean showButtonBar()
Return true to show the button bar above the viewer. The tool bar contains "Get List" and "Refresh" buttons and is typicall shown in dialogs that list only remote system objects.

Specified by:
showButtonBar in interface ISystemViewInputProvider

showActions

public boolean showActions()
Return true to show right-click popup actions on objects in the tree.

Specified by:
showActions in interface ISystemViewInputProvider

setViewer

public void setViewer(Viewer viewer)
Set the viewer in case it is needed for anything. The label and content provider will call this.

Specified by:
setViewer in interface ISystemViewInputProvider

getViewer

public Viewer getViewer()
Return the viewer we are currently associated with

Specified by:
getViewer in interface ISystemViewInputProvider

showingConnections

public boolean showingConnections()
Return true if we are listing connections or not, so we know whether we are interested in connection-add events

Specified by:
showingConnections in interface ISystemViewInputProvider

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!

Specified by:
setRunnableContext in interface SystemRegistry
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.

Specified by:
clearRunnableContext in interface SystemRegistry

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.

Specified by:
getRunnableContext in interface SystemRegistry

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.

Specified by:
setSubSystemFactoryProxies in interface SystemRegistry

getSubSystemFactoryProxies

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

Specified by:
getSubSystemFactoryProxies in interface SystemRegistry

getSubSystemFactoryProxiesByCategory

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

Specified by:
getSubSystemFactoryProxiesByCategory in interface SystemRegistry
See Also:
ISubSystemFactoryCategories

getSubSystemFactory

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

Specified by:
getSubSystemFactory in interface SystemRegistry

getSubSystemFactory

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

Specified by:
getSubSystemFactory in interface SystemRegistry

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.

Specified by:
getFileSubSystemFactoryId in interface SystemRegistry

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.

Specified by:
getFileSubSystemFactory in interface SystemRegistry

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.

Specified by:
getCmdSubSystemFactory in interface SystemRegistry

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.

Specified by:
getSubSystemFactoriesByCategory in interface SystemRegistry
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.

Specified by:
getSubSystemFactoriesBySystemType in interface SystemRegistry

getQualifyConnectionNames

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

Specified by:
getQualifyConnectionNames in interface SystemRegistry

setQualifyConnectionNames

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

Specified by:
setQualifyConnectionNames in interface SystemRegistry

setShowFilterPools

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

Specified by:
setShowFilterPools in interface SystemRegistry

setShowNewConnectionPrompt

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

Specified by:
setShowNewConnectionPrompt in interface SystemRegistry

getSystemProfileManager

public SystemProfileManager getSystemProfileManager()
Return singleton profile manager

Specified by:
getSystemProfileManager in interface SystemRegistry

getActiveSystemProfiles

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

Specified by:
getActiveSystemProfiles in interface SystemRegistry

getActiveSystemProfileNames

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

Specified by:
getActiveSystemProfileNames in interface SystemRegistry

getAllSystemProfiles

public SystemProfile[] getAllSystemProfiles()
Return all defined profiles

Specified by:
getAllSystemProfiles in interface SystemRegistry

getAllSystemProfileNames

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

Specified by:
getAllSystemProfileNames in interface SystemRegistry

getAllSystemProfileNamesVector

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

Specified by:
getAllSystemProfileNamesVector in interface SystemRegistry

getSystemProfile

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

Specified by:
getSystemProfile in interface SystemRegistry

createSystemProfile

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

Specified by:
createSystemProfile in interface SystemRegistry
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.

Specified by:
renameSystemProfile in interface SystemRegistry
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.

Specified by:
copySystemProfile in interface SystemRegistry
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

deleteSystemProfile

public void deleteSystemProfile(SystemProfile profile)
                         throws Exception
Delete a SystemProfile. Prior to physically deleting the profile, we delete all the connections it has (first disconnecting if they are connected), and 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.

Specified by:
deleteSystemProfile in interface SystemRegistry
Throws:
Exception

setSystemProfileActive

public void setSystemProfileActive(SystemProfile profile,
                                   boolean makeActive)
Make or unmake the given profile active. If switching to inactive, we force a disconnect for all subsystems of all connections in this profile.

Specified by:
setSystemProfileActive in interface SystemRegistry

getSubSystems

public SubSystem[] getSubSystems(SystemConnection conn)
Return list of subsystem objects for a given connection. Demand pages the subsystem factories into memory if they aren't already.

To protect against crashes, if there are no subsystems, an array of length zero is returned.

Specified by:
getSubSystems in interface SystemRegistry

getSubSystems

public SubSystem[] getSubSystems(SystemConnection conn,
                                 boolean force)
Return list of subsystem objects for a given connection. Demand pages the subsystem factories into memory if they aren't already.

To protect against crashes, if there are no subsystems, an array of length zero is returned.

Specified by:
getSubSystems in interface SystemRegistry

getSubSystem

public SubSystem getSubSystem(String absoluteSubSystemName)
Resolve a subsystem from it's absolute name. The absolute name of a subsystem is denoted by profileName.connectionName:subsystemFactoryId

Specified by:
getSubSystem in interface SystemRegistry
Parameters:
absoluteSubSystemName - the name of the subsystem
Returns:
the subsystem

getSubSystem

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

Specified by:
getSubSystem in interface SystemRegistry
Parameters:
srcProfileName - the name of the profile
srcConnectionName - the name of the connection
subsystemFactoryId - the factory Id of the subsystem
Returns:
the subsystem

getAbsoluteNameForSubSystem

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

Specified by:
getAbsoluteNameForSubSystem in interface SystemRegistry
Returns:
the absolute name of the subsystem

getAbsoluteNameForConnection

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

Specified by:
getAbsoluteNameForConnection in interface SystemRegistry
Returns:
the absolute name of the connection

getSubSystemsLazily

public SubSystem[] getSubSystemsLazily(SystemConnection conn)
Return list of subsystem objects for a given connection, but does not force as-yet-non-restored subsystems to come to life.

To protect against crashes, if there are no subsystems, an array of length zero is returned.


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.

Specified by:
getSubSystems in interface SystemRegistry

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.

Specified by:
getSubSystems in interface SystemRegistry

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.

Specified by:
getSubSystemsBySubSystemFactoryCategory in interface SystemRegistry
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.

Specified by:
getFileSubSystems in interface SystemRegistry
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.

Specified by:
getFileSubSystem in interface SystemRegistry
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.

Specified by:
getCmdSubSystems in interface SystemRegistry
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.

Specified by:
getCmdSubSystem in interface SystemRegistry
See Also:
RemoteCmdSubSystem

getSubSystemFactories

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

Specified by:
getSubSystemFactories in interface SystemRegistry

getSubSystemFactories

protected Vector getSubSystemFactories(SystemConnection conn)
Return Vector of subsystem factories that apply to a given system connection


getSubSystemFactories

protected Vector getSubSystemFactories(SystemConnection conn,
                                       Vector factories)
Return Vector of subsystem factories that apply to a given system connection, updating given vector


getSubSystemFactories

protected Vector getSubSystemFactories(SystemConnection[] conns)
Return Vector of subsystem factories that apply to a given system connection array


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.

Specified by:
deleteSubSystem in interface SystemRegistry

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).

Specified by:
getLocalConnection in interface SystemRegistry

getConnections

public SystemConnection[] getConnections()
Return all connections in all active profiles. Never returns null, but may return a zero-length array.

Specified by:
getConnections in interface SystemRegistry

getConnectionsByProfile

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

Specified by:
getConnectionsByProfile in interface SystemRegistry

getConnectionsByProfile

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

Specified by:
getConnectionsByProfile in interface SystemRegistry

getConnectionsBySubSystemFactory

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

Specified by:
getConnectionsBySubSystemFactory in interface SystemRegistry
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

Specified by:
getConnectionsBySubSystemFactoryId in interface SystemRegistry

getConnectionsBySubSystemFactoryCategory

public SystemConnection[] getConnectionsBySubSystemFactoryCategory(String factoryCategory)
Return all connections for which there exists one or more subsystems owned by any child classes of a given subsystem factory 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 live a subsystem factory just to test its parent class type.

Specified by:
getConnectionsBySubSystemFactoryCategory in interface SystemRegistry
See Also:
ISubSystemFactoryCategories

getConnectionsBySystemType

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

Specified by:
getConnectionsBySystemType in interface SystemRegistry

getConnectionsBySystemTypes

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

Specified by:
getConnectionsBySystemTypes in interface SystemRegistry

getConnection

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

Specified by:
getConnection in interface SystemRegistry

getConnectionPosition

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

Specified by:
getConnectionPosition in interface SystemRegistry

getConnectionPositionInView

public int getConnectionPositionInView(SystemConnection conn)
Return the zero-based position of a SystemConnection object within all active profiles.


getConnectionCount

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

Specified by:
getConnectionCount in interface SystemRegistry

getConnectionCountWithinProfile

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

Specified by:
getConnectionCountWithinProfile in interface SystemRegistry

getConnectionCount

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

Specified by:
getConnectionCount in interface SystemRegistry

getConnectionNames

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

Specified by:
getConnectionNames in interface SystemRegistry
Returns:
Vector of String objects.

getConnectionNames

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

Specified by:
getConnectionNames in interface SystemRegistry
Returns:
Vector of String objects.

getConnectionNamesForAllActiveProfiles

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

Specified by:
getConnectionNamesForAllActiveProfiles in interface SystemRegistry

getHostNames

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

Specified by:
getHostNames in interface SystemRegistry

getHostNames

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

Specified by:
getHostNames in interface SystemRegistry

getSystemClipboard

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

Specified by:
getSystemClipboard in interface SystemRegistry

getSystemClipboardObjects

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

Specified by:
getSystemClipboardObjects in interface SystemRegistry
Parameters:
srcType - the transfer type
Returns:
the list of clipboard objects

getSystemScratchPad

public SystemScratchpad getSystemScratchPad()
Specified by:
getSystemScratchPad in interface SystemRegistry

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.

Specified by:
createLocalConnection in interface SystemRegistry
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 PROFILE YOU SPECIFY. THE PROFILE IS ALSO SAVED TO DISK.

This method:

Specified by:
createConnection in interface SystemRegistry
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:

Specified by:
createConnection in interface SystemRegistry
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:

Specified by:
createConnection in interface SystemRegistry
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

getPreviousConnection

protected SystemConnection getPreviousConnection(SystemConnection conn)
Return the previous connection as would be shown in the view


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:

Specified by:
updateConnection in interface SystemRegistry
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.
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

setConnectionOffline

public void setConnectionOffline(SystemConnection conn,
                                 boolean offline)
Update the workoffline attribute for a connection.

Specified by:
setConnectionOffline in interface SystemRegistry
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.

Specified by:
deleteConnection in interface SystemRegistry

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.

Specified by:
renameConnection in interface SystemRegistry
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?

Specified by:
moveConnections in interface SystemRegistry
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.

Specified by:
copyConnection in interface SystemRegistry
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 moved, and all connection data is moved. This is actually accomplished by doing a copy operation first, and if successful deleting the original.

Specified by:
moveConnection in interface SystemRegistry
Parameters:
monitor - Progress monitor to reflect each step of the operation
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
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

Specified by:
isAnySubSystemConnected in interface SystemRegistry

areAllSubSystemsConnected

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

Specified by:
areAllSubSystemsConnected in interface SystemRegistry

disconnectAllSubSystems

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

Specified by:
disconnectAllSubSystems in interface SystemRegistry

connectedStatusChange

public void connectedStatusChange(SubSystem 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

Specified by:
connectedStatusChange in interface SystemRegistry

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. Update properties for the subsystem and its connection

Specified by:
connectedStatusChange in interface SystemRegistry

addSystemResourceChangeListener

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

Specified by:
addSystemResourceChangeListener in interface SystemRegistry

removeSystemResourceChangeListener

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

Specified by:
removeSystemResourceChangeListener in interface SystemRegistry

isRegisteredSystemResourceChangeListener

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

Specified by:
isRegisteredSystemResourceChangeListener in interface SystemRegistry

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.

Specified by:
fireEvent in interface SystemRegistry

fireEvent

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

Specified by:
fireEvent in interface SystemRegistry

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.

Specified by:
postEvent in interface SystemRegistry

postEvent

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

Specified by:
postEvent in interface SystemRegistry

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.

Specified by:
addSystemModelChangeListener in interface SystemRegistry

removeSystemModelChangeListener

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

Specified by:
removeSystemModelChangeListener in interface SystemRegistry

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.

Specified by:
fireEvent in interface SystemRegistry

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.

Specified by:
fireModelChangeEvent in interface SystemRegistry

fireEvent

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

Specified by:
fireEvent in interface SystemRegistry

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.

Specified by:
addSystemRemoteChangeListener in interface SystemRegistry

removeSystemRemoteChangeListener

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

Specified by:
removeSystemRemoteChangeListener in interface SystemRegistry

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.

Specified by:
fireEvent in interface SystemRegistry

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.

Specified by:
fireRemoteResourceChangeEvent in interface SystemRegistry
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.

getRemoteAdapter

protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. Returns null if this object does not adaptable to this.


fireEvent

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

Specified by:
fireEvent in interface SystemRegistry

addSystemPreferenceChangeListener

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

Specified by:
addSystemPreferenceChangeListener in interface SystemRegistry

removeSystemPreferenceChangeListener

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

Specified by:
removeSystemPreferenceChangeListener in interface SystemRegistry

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.

Specified by:
fireEvent in interface SystemRegistry

fireEvent

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

Specified by:
fireEvent in interface SystemRegistry

loadAll

public void loadAll()
Load everything into memory. Needed for pervasive operations like rename and copy


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.

Specified by:
getLastException in interface SystemRegistry

save

public boolean save()
Save everything!

Specified by:
save in interface SystemRegistry

saveConnectionPool

public boolean saveConnectionPool(SystemConnectionPool pool)
Save specific connection pool

Specified by:
saveConnectionPool in interface SystemRegistry
Returns:
true if saved ok, false if error encountered. If false, call getLastException().

saveConnection

public boolean saveConnection(SystemConnection conn)
Save specific connection

Specified by:
saveConnection in interface SystemRegistry
Returns:
true if saved ok, false if error encountered. If false, call getLastException().

restore

public boolean restore()
Restore all connections within active profiles

Specified by:
restore in interface SystemRegistry
Returns:
true if restored ok, false if error encountered. If false, call getLastException().

initMOF

public static ModelFactory initMOF()
Initialize the MOF package. Need only be done once.


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.