From 35604e44a808ec9b16b1025f75e6f5374eae7791 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 31 Aug 2006 17:37:25 +0000 Subject: [PATCH] rse.ui to rse.core refactoring --- .../DaytimeConnectorService.java | 2 +- .../DaytimeConnectorServiceManager.java | 2 +- .../daytime/subsystems/DaytimeSubSystem.java | 7 +- .../DaytimeSubSystemConfiguration.java | 2 +- .../ui/DaytimeNewConnectionWizardPage.java | 7 +- .../DaytimeSubSystemConfigurationAdapter.java | 2 +- ...eSubSystemConfigurationAdapterFactory.java | 1 + .../subsystems/DeveloperConnectorService.java | 2 +- .../DeveloperConnectorServiceManager.java | 2 +- .../subsystems/DeveloperSubSystem.java | 2 +- .../DeveloperSubSystemConfiguration.java | 12 +- ...eveloperSubSystemConfigurationAdapter.java | 6 +- .../samples/ui/actions/ShowJarContents.java | 2 +- .../META-INF/MANIFEST.MF | 4 +- .../eclipse/rse/remotecdt/RemoteCMainTab.java | 2 +- .../remotecdt/RemoteRunLaunchDelegate.java | 2 +- .../dstore/DStoreConnectorService.java | 4 +- .../dstore/DStoreConnectorServiceManager.java | 2 +- .../dstore/RexecDstoreServer.java | 2 +- .../dstore/util/ConnectionStatusListener.java | 2 +- .../ssh/SshConnectorService.java | 6 +- .../ssh/SshConnectorServiceManager.java | 2 +- rse/plugins/org.eclipse.rse.core/.classpath | 1 + .../org.eclipse.rse.core/META-INF/MANIFEST.MF | 8 +- .../persistence/PropertyFileProvider.java | 706 ++++++ .../persistence/RSEPersistenceManager.java | 425 ++++ .../internal/persistence/SaveRSEDOMJob.java | 50 + .../persistence/SerializingProvider.java | 179 ++ .../persistence/dom/RSEDOMExporter.java | 447 ++++ .../persistence/dom/RSEDOMImporter.java | 554 +++++ .../persistence/IRSEPersistenceManager.java | 119 + .../persistence/IRSEPersistenceProvider.java | 55 + .../rse/persistence/dom/IRSEDOMConstants.java | 88 + .../rse/persistence/dom/IRSEDOMExporter.java | 130 ++ .../rse/persistence/dom/IRSEDOMImporter.java | 78 + .../eclipse/rse/persistence/dom/RSEDOM.java | 99 + .../rse/persistence/dom/RSEDOMNode.java | 265 +++ .../persistence/dom/RSEDOMNodeAttribute.java | 58 + rse/plugins/org.eclipse.rse.core/plugin.xml | 22 + .../schema/persistenceProviders.exsd | 134 ++ .../org/eclipse/rse/core/RSECorePlugin.java | 31 + .../rse/core}/filters/ISystemFilter.java | 52 +- .../core}/filters/ISystemFilterConstants.java | 2 +- .../core}/filters/ISystemFilterContainer.java | 2 +- .../ISystemFilterContainerReference.java | 3 +- .../rse/core}/filters/ISystemFilterPool.java | 18 +- .../filters/ISystemFilterPoolManager.java | 6 +- .../ISystemFilterPoolManagerProvider.java | 2 +- .../filters/ISystemFilterPoolReference.java | 2 +- .../ISystemFilterPoolReferenceManager.java | 2 +- ...temFilterPoolReferenceManagerProvider.java | 2 +- .../ISystemFilterPoolSelectionValidator.java | 3 +- .../filters/ISystemFilterPoolWrapper.java | 2 +- .../ISystemFilterPoolWrapperInformation.java | 2 +- .../core}/filters/ISystemFilterReference.java | 2 +- .../filters/ISystemFilterSavePolicies.java | 2 +- .../core/filters/ISystemFilterStartHere.java | 57 + .../core}/filters/ISystemFilterString.java | 2 +- .../filters/ISystemFilterStringReference.java | 2 +- .../filters/SystemFilterNamingPolicy.java | 148 ++ .../core/filters/SystemFilterPoolManager.java | 1962 +++++++++++++++++ .../core/model/AbstractSystemResourceSet.java | 4 +- .../src/org/eclipse/rse/core/model/IHost.java | 212 ++ .../ISubSystemConfigurationCategories.java | 6 +- .../rse/core/model/ISystemContainer.java | 2 +- .../rse/core/model/ISystemHostPool.java | 179 ++ .../core/model/ISystemModelChangeEvents.java | 7 +- .../model/ISystemModelChangeListener.java | 8 +- .../model/ISystemNewConnectionWizardPage.java | 48 + .../rse/core/model/ISystemProfile.java | 95 + .../rse/core/model/ISystemProfileManager.java | 130 ++ .../rse/core/model/ISystemRegistry.java | 687 ++++++ .../model/SystemChildrenContentsType.java | 3 +- .../core/model/SystemSignonInformation.java | 121 + .../IRSEBasePersistableReferenceManager.java | 1 - .../core/subsystems/CommunicationsEvent.java | 46 + .../rse/core/subsystems/ICacheManager.java | 0 .../subsystems/ICommunicationsListener.java | 49 + .../core/subsystems/IConnectorService.java | 339 +++ .../subsystems/IConnectorServiceManager.java | 3 +- .../rse/core/subsystems/IFileConstants.java | 0 .../rse/core/subsystems/IRemoteContainer.java | 62 + .../core/subsystems/IRemoteLineReference.java | 62 + .../subsystems/IRemoteObjectIdentifier.java | 30 + .../subsystems/IRemoteObjectResolver.java | 0 .../subsystems/IRemotePropertyHolder.java | 0 .../subsystems/IRemoteServerLauncher.java | 0 .../core/subsystems/IRemoteSystemEnvVar.java | 78 + .../rse/core/subsystems/IServerLauncher.java | 2 +- .../subsystems/IServerLauncherProperties.java | 51 + .../core/subsystems/IServiceSubSystem.java | 24 + .../IServiceSubSystemConfiguration.java | 38 + .../rse/core/subsystems/ISubSystem.java | 75 +- .../subsystems/ISubSystemConfiguration.java | 554 +++++ .../ISubSystemConfigurationProxy.java | 99 + .../RemoteChildrenContentsType.java | 3 +- .../rse/core/subsystems/ServerLaunchType.java | 0 .../SubSystemFilterNamingPolicy.java | 121 + .../ui/actions/SystemKillProcessAction.java | 10 +- .../actions/SystemNewProcessFilterAction.java | 2 +- .../ui/dialogs/RemoteProcessesDialog.java | 2 +- .../ui/dialogs/SystemKillTableProvider.java | 1 + .../ProcessServicesPropertyPage.java | 6 +- ...eProcessSubSystemConfigurationAdapter.java | 4 +- .../view/SystemViewProcessAdapterFactory.java | 1 + .../view/SystemViewRemoteProcessAdapter.java | 36 +- .../rse/shells/ui/RemoteCommandHelpers.java | 4 +- .../ui/SystemRemoteCommandEntryForm.java | 2 +- .../ui/actions/SystemCommandAction.java | 4 +- .../ShellServicesPropertyPage.java | 6 +- .../rse/shells/ui/view/CommandsViewPage.java | 2 +- .../ui/view/SystemBuildErrorViewPart.java | 7 +- .../ui/view/SystemCommandsViewPart.java | 9 +- .../files/core/SystemFileAPIProviderImpl.java | 6 +- .../SystemFileSubSystemAPIProviderImpl.java | 2 +- ...SubSystemConfigurationAPIProviderImpl.java | 2 +- .../core/model/ISystemFileAPIProvider.java | 2 +- .../files/core/model/RemoteFileUtility.java | 4 +- .../files/core/model/RemotePath.java | 6 +- .../servicesubsystem/AbstractRemoteFile.java | 2 +- .../FileServiceSubSystem.java | 4 +- .../FileServiceSubSystemConfiguration.java | 2 +- .../IFileServiceSubSystem.java | 2 +- .../IFileServiceSubSystemConfiguration.java | 4 +- .../core/servicesubsystem/OutputRefresh.java | 4 +- .../files/core/subsystems/IRemoteFile.java | 2 +- .../files/core/subsystems/RemoteFile.java | 2 +- .../core/subsystems/RemoteFileSubSystem.java | 7 +- .../RemoteFileSubSystemConfiguration.java | 10 +- .../old/SearchResultsChangeListener.java | 7 +- .../DStoreFileSubSystemConfiguration.java | 2 +- ...toreWindowsFileSubSystemConfiguration.java | 6 +- .../RemoteFilePropertyChangeListener.java | 5 +- .../ftp/FTPFileSubSystemConfiguration.java | 2 +- .../connectorservice/FTPConnectorService.java | 4 +- .../FTPConnectorServiceManager.java | 2 +- .../LocalFileSubSystemConfiguration.java | 6 +- .../ssh/SftpFileSubSystemConfiguration.java | 2 +- .../DStoreProcessSubSystemConfiguration.java | 2 +- .../LocalProcessSubSystemConfiguration.java | 2 +- .../servicesubsystem/OutputRefreshJob.java | 5 +- .../shells/subsystems/RemoteCmdSubSystem.java | 11 +- .../RemoteCmdSubSystemConfiguration.java | 6 +- .../shells/subsystems/RemoteCommandShell.java | 4 +- .../IShellServiceSubSystem.java | 2 +- .../IShellServiceSubSystemConfiguration.java | 4 +- .../ShellServiceSubSystem.java | 4 +- .../ShellServiceSubSystemConfiguration.java | 2 +- .../rse/internal/ui/view/SystemView.java | 223 +- ...ystemAbstractPopupMenuExtensionAction.java | 2 +- .../rse/ui/actions/SystemBaseAction.java | 2 +- .../rse/ui/actions/SystemBaseCopyAction.java | 7 +- ...SystemCascadingRemoteServerBaseAction.java | 2 +- .../SystemCascadingRemoteServersAction.java | 2 +- .../SystemClearAllPasswordsAction.java | 2 +- .../rse/ui/actions/SystemCollapseAction.java | 5 +- .../ui/actions/SystemCollapseAllAction.java | 5 +- .../SystemConnectAllSubSystemsAction.java | 4 +- .../actions/SystemCopyConnectionAction.java | 6 +- .../actions/SystemCopyToClipboardAction.java | 4 +- .../SystemDisconnectAllSubSystemsAction.java | 4 +- .../rse/ui/actions/SystemExpandAction.java | 5 +- .../actions/SystemMoveConnectionAction.java | 6 +- .../SystemMoveDownConnectionAction.java | 6 +- .../actions/SystemMoveUpConnectionAction.java | 6 +- .../ui/actions/SystemNewConnectionAction.java | 8 +- .../ui/actions/SystemNewProfileAction.java | 2 +- .../SystemOpenExplorerPerspectiveAction.java | 2 +- .../SystemPasteFromClipboardAction.java | 2 +- ...referenceQualifyConnectionNamesAction.java | 4 +- .../actions/SystemProfileNameCopyAction.java | 9 +- .../SystemProfileNameSelectAction.java | 6 +- .../rse/ui/actions/SystemRefreshAction.java | 7 +- .../ui/actions/SystemRefreshAllAction.java | 7 +- .../actions/SystemSelectConnectionAction.java | 2 +- .../actions/SystemUpdateConnectionAction.java | 2 +- .../ui/actions/SystemWorkOfflineAction.java | 4 +- .../rse/ui/dialogs/ISignonValidator.java | 2 +- .../ui/dialogs/SystemCopyProfileDialog.java | 9 +- .../rse/ui/dialogs/SystemDeleteTableRow.java | 2 +- .../SystemPasswordPersistencePrompt.java | 2 +- .../dialogs/SystemRemoteResourceDialog.java | 2 +- .../rse/ui/dialogs/SystemRenameDialog.java | 2 +- .../ui/dialogs/SystemRenameSingleDialog.java | 4 +- .../dialogs/SystemSelectConnectionDialog.java | 2 +- .../dialogs/SystemTestFilterStringDialog.java | 4 +- .../dialogs/SystemUpdateConnectionDialog.java | 4 +- .../ui/view/AbstractSystemViewAdapter.java | 9 +- ...emSelectRemoteObjectAPIProviderCaller.java | 2 +- .../ui/view/ISystemViewElementAdapter.java | 1 + .../rse/ui/view/ISystemViewInputProvider.java | 2 +- .../view/SubSystemConfigurationAdapter.java | 65 +- .../team/SystemResourceAdaptableProfile.java | 2 +- .../SystemTeamViewActiveProfileAction.java | 6 +- .../team/SystemTeamViewCategoryAdapter.java | 4 +- .../view/team/SystemTeamViewCategoryNode.java | 2 +- .../team/SystemTeamViewContentProvider.java | 2 +- .../team/SystemTeamViewInputProvider.java | 2 +- .../team/SystemTeamViewLabelProvider.java | 2 +- ...SystemTeamViewMakeActiveProfileAction.java | 6 +- ...stemTeamViewMakeInActiveProfileAction.java | 6 +- .../rse/ui/view/team/SystemTeamViewPart.java | 60 +- .../team/SystemTeamViewProfileAdapter.java | 2 +- .../SystemTeamViewResourceAdapterFactory.java | 2 +- ...TeamViewSubSystemConfigurationAdapter.java | 4 +- ...temTeamViewSubSystemConfigurationNode.java | 6 +- .../services/ConnectorServiceElement.java | 2 +- .../services/FactoryServiceElement.java | 4 +- .../services/PropertySetServiceElement.java | 2 +- .../services/RSEModelServiceElement.java | 2 +- ...erverLauncherPropertiesServiceElement.java | 2 +- .../ui/widgets/services/ServiceElement.java | 2 +- .../services/ServiceServiceElement.java | 2 +- .../eclipse/rse/filters/SystemFilterPool.java | 1343 +++++++++++ .../SystemFilterPoolReferenceManager.java | 1129 ++++++++++ .../rse/filters/SystemFilterPoolWrapper.java | 7 +- .../SystemFilterPoolWrapperInformation.java | 8 +- .../rse/filters/SystemFilterReference.java | 9 + .../rse/filters/SystemFilterSimple.java | 5 + .../rse/filters/SystemFilterStartHere.java | 35 +- .../subsystems/AbstractConnectorService.java | 17 +- .../AbstractConnectorServiceManager.java | 4 +- .../rse/core/subsystems/SubSystem.java | 84 +- .../subsystems/SubSystemConfiguration.java | 84 +- .../rse/core/subsystems/SubSystemHelpers.java | 14 +- 225 files changed, 11854 insertions(+), 636 deletions(-) create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/PropertyFileProvider.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SaveRSEDOMJob.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SerializingProvider.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceManager.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceProvider.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMExporter.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMImporter.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOM.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNode.java create mode 100644 rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNodeAttribute.java create mode 100644 rse/plugins/org.eclipse.rse.core/schema/persistenceProviders.exsd rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilter.java (87%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterConstants.java (97%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterContainer.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterContainerReference.java (98%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPool.java (91%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolManager.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolManagerProvider.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolReference.java (98%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolReferenceManager.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolReferenceManagerProvider.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolSelectionValidator.java (97%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolWrapper.java (97%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterPoolWrapperInformation.java (98%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterReference.java (98%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterSavePolicies.java (98%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStartHere.java rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterString.java (99%) rename rse/plugins/{org.eclipse.rse.ui/filters/org/eclipse/rse => org.eclipse.rse.core/src/org/eclipse/rse/core}/filters/ISystemFilterStringReference.java (98%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterNamingPolicy.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterPoolManager.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/IHost.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfile.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfileManager.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemSignonInformation.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/CommunicationsEvent.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/ICacheManager.java (100%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICommunicationsListener.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java (96%) rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IFileConstants.java (100%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteContainer.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteLineReference.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectIdentifier.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IRemoteObjectResolver.java (100%) rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IRemotePropertyHolder.java (100%) rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IRemoteServerLauncher.java (100%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteSystemEnvVar.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/IServerLauncher.java (98%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncherProperties.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystem.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystemConfiguration.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/ISubSystem.java (93%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java (98%) rename rse/plugins/{org.eclipse.rse.ui/subsystems => org.eclipse.rse.core/src}/org/eclipse/rse/core/subsystems/ServerLaunchType.java (100%) create mode 100644 rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/SubSystemFilterNamingPolicy.java create mode 100644 rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/SystemFilterPool.java create mode 100644 rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/SystemFilterPoolReferenceManager.java diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorService.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorService.java index b7de9b3c57d..8d8a39da841 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorService.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorService.java @@ -21,11 +21,11 @@ import java.net.ConnectException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osgi.util.NLS; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorService; import org.eclipse.rse.examples.daytime.DaytimeResources; import org.eclipse.rse.examples.daytime.service.DaytimeService; import org.eclipse.rse.examples.daytime.service.IDaytimeService; -import org.eclipse.rse.model.IHost; /** * The DaytimeConnectorService takes care of keeping a "session" for accessing diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorServiceManager.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorServiceManager.java index ab441c00d21..1d9edb8cfa5 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorServiceManager.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/connectorservice/DaytimeConnectorServiceManager.java @@ -16,11 +16,11 @@ package org.eclipse.rse.examples.daytime.connectorservice; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.examples.daytime.subsystems.IDaytimeSubSystem; -import org.eclipse.rse.model.IHost; /** * This class manages our DaytimeConnectorService objects, so that if we ever diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java index bd79397662d..9b6874021f4 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java @@ -14,15 +14,16 @@ package org.eclipse.rse.examples.daytime.subsystems; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.swt.widgets.Display; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemMessageObject; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.SystemMessageObject; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.examples.daytime.model.DaytimeResource; import org.eclipse.rse.examples.daytime.service.IDaytimeService; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.ISystemMessages; @@ -45,7 +46,7 @@ public class DaytimeSubSystem extends SubSystem { //This is called after connect - expand the daytime node. //May be called in worker thread. //TODO find a more elegant solution for expanding the item, e.g. use implicit connect like filters - final ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); + final SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); final SystemResourceChangeEvent event = new SystemResourceChangeEvent(this, ISystemResourceChangeEvents.EVENT_SELECT_EXPAND, null); //TODO bug 150919: postEvent() should not be necessary asynchronously //sr.postEvent(event); diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystemConfiguration.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystemConfiguration.java index ddb26f8cbc7..4bf5b4e915c 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystemConfiguration.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystemConfiguration.java @@ -19,13 +19,13 @@ package org.eclipse.rse.examples.daytime.subsystems; import java.util.HashMap; import java.util.Map; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.servicesubsystem.ServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.examples.daytime.connectorservice.DaytimeConnectorService; import org.eclipse.rse.examples.daytime.connectorservice.DaytimeConnectorServiceManager; import org.eclipse.rse.examples.daytime.service.IDaytimeService; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.IService; /** diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java index d628998ca1a..8d6855bb3af 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeNewConnectionWizardPage.java @@ -1,14 +1,15 @@ package org.eclipse.rse.examples.daytime.ui; import org.eclipse.jface.wizard.IWizard; -import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.examples.daytime.DaytimeResources; -import org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Text; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.examples.daytime.DaytimeResources; +import org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage; + public class DaytimeNewConnectionWizardPage extends AbstractSystemNewConnectionWizardPage { diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java index a9071c4eb2d..cd0ed325004 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapter.java @@ -20,9 +20,9 @@ import java.util.Vector; import org.eclipse.jface.wizard.IWizard; +import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; -import org.eclipse.rse.ui.wizards.ISystemNewConnectionWizardPage; public class DaytimeSubSystemConfigurationAdapter extends SubSystemConfigurationAdapter diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapterFactory.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapterFactory.java index 55aa80b3513..ee51763a3f4 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapterFactory.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/ui/DaytimeSubSystemConfigurationAdapterFactory.java @@ -2,6 +2,7 @@ package org.eclipse.rse.examples.daytime.ui; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IAdapterManager; + import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter; import org.eclipse.rse.examples.daytime.subsystems.DaytimeSubSystemConfiguration; diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorService.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorService.java index 37700858ff6..14b1b640a7d 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorService.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorService.java @@ -17,8 +17,8 @@ package samples.subsystems; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorService; -import org.eclipse.rse.model.IHost; import samples.RSESamplesPlugin; diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorServiceManager.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorServiceManager.java index 8f3b0188cc4..5bcaec775c1 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorServiceManager.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperConnectorServiceManager.java @@ -16,10 +16,10 @@ package samples.subsystems; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; /** * This class manages our DeveloperConnectorService objects, so that if we diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java index ba444198a62..bc08b71c33a 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystem.java @@ -19,9 +19,9 @@ package samples.subsystems; import java.util.Vector; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystem; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.NamePatternMatcher; import samples.model.DeveloperResource; diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java index 92cb56f4aba..9e1865d5ab7 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfiguration.java @@ -18,13 +18,13 @@ package samples.subsystems; import java.util.Vector; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; -import org.eclipse.rse.model.IHost; import samples.RSESamplesPlugin; @@ -43,7 +43,7 @@ public class DeveloperSubSystemConfiguration extends SubSystemConfiguration { /** * Create an instance of our subsystem. - * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#createSubSystemInternal(org.eclipse.rse.model.IHost) + * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#createSubSystemInternal(org.eclipse.rse.core.model.IHost) */ public ISubSystem createSubSystemInternal(IHost conn) { return new DeveloperSubSystem(conn, getConnectorService(conn)); @@ -85,7 +85,7 @@ public class DeveloperSubSystemConfiguration extends SubSystemConfiguration { * sheet for the "type" property when a filter is selected within our subsystem. * * Requires this line in rseSamplesResources.properties: property.type.teamfilter=Team filter - * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#getTranslatedFilterTypeProperty(org.eclipse.rse.filters.ISystemFilter) + * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#getTranslatedFilterTypeProperty(org.eclipse.rse.core.filters.ISystemFilter) */ public String getTranslatedFilterTypeProperty(ISystemFilter selectedFilter) { diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java index dfe984df5b0..f82290144a4 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/subsystems/DeveloperSubSystemConfigurationAdapter.java @@ -18,9 +18,9 @@ package samples.subsystems; import org.eclipse.jface.action.IAction; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; import org.eclipse.rse.ui.filters.actions.SystemChangeFilterAction; import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction; import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; @@ -92,7 +92,7 @@ public class DeveloperSubSystemConfigurationAdapter extends /** * Override of parent method for returning the image for filters in our subsystem. - * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getSystemFilterImage(org.eclipse.rse.filters.ISystemFilter) + * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getSystemFilterImage(org.eclipse.rse.core.filters.ISystemFilter) */ public ImageDescriptor getSystemFilterImage(ISystemFilter filter) { diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java index 58edd378226..ca361ae6f1b 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/actions/ShowJarContents.java @@ -17,8 +17,8 @@ package samples.ui.actions; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.files.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.shells.ui.RemoteCommandHelpers; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; diff --git a/rse/examples/org.eclipse.rse.remotecdt/META-INF/MANIFEST.MF b/rse/examples/org.eclipse.rse.remotecdt/META-INF/MANIFEST.MF index 05edaa08078..36f4e9a012b 100644 --- a/rse/examples/org.eclipse.rse.remotecdt/META-INF/MANIFEST.MF +++ b/rse/examples/org.eclipse.rse.remotecdt/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.rse.subsystems.shells.dstore, org.eclipse.rse.subsystems.shells.local, - org.eclipse.rse.core, org.eclipse.debug.core, org.eclipse.core.resources, org.eclipse.cdt.core, @@ -23,6 +22,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.rse.subsystems.shells.core, org.eclipse.rse.services, org.eclipse.cdt.debug.core, - org.eclipse.cdt.debug.mi.ui + org.eclipse.cdt.debug.mi.ui, + org.eclipse.rse.core Eclipse-LazyStart: true Bundle-Vendor: Eclipse.org diff --git a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteCMainTab.java b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteCMainTab.java index aef78814dc2..b3172c01d2a 100644 --- a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteCMainTab.java +++ b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteCMainTab.java @@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.actions.SystemNewConnectionAction; import org.eclipse.swt.SWT; diff --git a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteRunLaunchDelegate.java b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteRunLaunchDelegate.java index 05f3d730817..e77a1ac769c 100644 --- a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteRunLaunchDelegate.java +++ b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/remotecdt/RemoteRunLaunchDelegate.java @@ -39,7 +39,7 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.model.IProcess; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java index cdc82d5367f..3cca538a309 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java @@ -48,6 +48,8 @@ import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.comm.ISystemKeystoreProvider; import org.eclipse.rse.core.comm.SystemKeystoreProviderManager; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.AbstractConnectorService; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.IRemoteServerLauncher; @@ -56,8 +58,6 @@ import org.eclipse.rse.core.subsystems.IServerLauncherProperties; import org.eclipse.rse.core.subsystems.ServerLaunchType; import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.dstore.universal.miners.environment.EnvironmentMiner; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.SystemSignonInformation; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.ISystemMessages; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java index 14d42ea474c..8861f7cae0e 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java @@ -15,10 +15,10 @@ ********************************************************************************/ package org.eclipse.rse.connectorservice.dstore; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/RexecDstoreServer.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/RexecDstoreServer.java index 3550a439ca1..521336d74f0 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/RexecDstoreServer.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/RexecDstoreServer.java @@ -25,10 +25,10 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.dstore.core.client.ClientConnection; import org.eclipse.dstore.core.client.ConnectionStatus; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.IRemoteServerLauncher; import org.eclipse.rse.core.subsystems.IServerLauncher; import org.eclipse.rse.core.subsystems.IServerLauncherProperties; -import org.eclipse.rse.model.SystemSignonInformation; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java index 4c7f7a5b70f..3f2baee2e63 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java @@ -26,9 +26,9 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java index 851aaf8197a..72088914e3f 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java @@ -50,13 +50,13 @@ import com.jcraft.jsch.UIKeyboardInteractive; import com.jcraft.jsch.UserInfo; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.AbstractConnectorService; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; -import org.eclipse.rse.model.SystemSignonInformation; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.ssh.ISshSessionProvider; import org.eclipse.rse.ui.ISystemMessages; diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorServiceManager.java index 4efced53a11..140763f1478 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorServiceManager.java @@ -16,10 +16,10 @@ package org.eclipse.rse.connectorservice.ssh; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; /** * ConnectorService manager class. diff --git a/rse/plugins/org.eclipse.rse.core/.classpath b/rse/plugins/org.eclipse.rse.core/.classpath index 751c8f2e504..d4da92faf8a 100644 --- a/rse/plugins/org.eclipse.rse.core/.classpath +++ b/rse/plugins/org.eclipse.rse.core/.classpath @@ -3,5 +3,6 @@ + diff --git a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF index 2dfba9d83b1..4a82bd4f703 100644 --- a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF @@ -8,12 +8,16 @@ Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, org.eclipse.rse.logging, - org.eclipse.rse.services + org.eclipse.rse.services, + org.eclipse.swt Eclipse-LazyStart: true Export-Package: org.eclipse.rse.core, org.eclipse.rse.core.filters, org.eclipse.rse.core.model, org.eclipse.rse.core.persistance, org.eclipse.rse.core.references, - org.eclipse.rse.internal.references + org.eclipse.rse.core.subsystems, + org.eclipse.rse.internal.references, + org.eclipse.rse.persistence, + org.eclipse.rse.persistence.dom Bundle-Vendor: Eclipse.org diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/PropertyFileProvider.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/PropertyFileProvider.java new file mode 100644 index 00000000000..b31eee50a7f --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/PropertyFileProvider.java @@ -0,0 +1,706 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed the initial implementation: + * David McKnight, David Dykstal. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ +package org.eclipse.rse.internal.persistence; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.Vector; +import java.util.regex.Pattern; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.rse.persistence.IRSEPersistenceProvider; +import org.eclipse.rse.persistence.dom.IRSEDOMConstants; +import org.eclipse.rse.persistence.dom.RSEDOM; +import org.eclipse.rse.persistence.dom.RSEDOMNode; +import org.eclipse.rse.persistence.dom.RSEDOMNodeAttribute; + +/** + * This is class is used to restore an RSE DOM from disk and import it into RSE. + * It stores the DOM as a tree of folders and .properties files. + */ +public class PropertyFileProvider implements IRSEPersistenceProvider { + + private static final String NULL_VALUE_STRING = "null"; + private static final String PROPERTIES_FILE_NAME = "node.properties"; + + /* Metatype names */ + private static final String MT_ATTRIBUTE_TYPE = "attr-type"; + private static final String MT_ATTRIBUTE = "attr"; + private static final String MT_CHILD = "child"; + private static final String MT_NODE_TYPE = "n-type"; + private static final String MT_NODE_NAME = "n-name"; + private static final String MT_REFERENCE = "ref"; + + /* Type abbreviations */ + private static final String AB_SUBSYSTEM = "SS"; + private static final String AB_SERVICE_LAUNCHER = "SL"; + private static final String AB_PROPERTY_SET = "PS"; + private static final String AB_PROPERTY = "P"; + private static final String AB_HOST = "H"; + private static final String AB_FILTER_STRING = "FS"; + private static final String AB_FILTER_POOL_REFERENCE = "FPR"; + private static final String AB_FILTER_POOL = "FP"; + private static final String AB_FILTER = "F"; + private static final String AB_CONNECTOR_SERVICE = "CS"; + private static final String AB_PROFILE = "PRF"; + + private Pattern period = Pattern.compile("\\."); + private Map typeQualifiers = getTypeQualifiers(); + + /* (non-Javadoc) + * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#getSavedProfileNames() + */ + public String[] getSavedProfileNames() { + List names = new Vector(10); + IFolder providerFolder = getProviderFolder(); + try { + IResource[] profileCandidates = providerFolder.members(); + for (int i = 0; i < profileCandidates.length; i++) { + IResource profileCandidate = profileCandidates[i]; + if (profileCandidate.getType() == IResource.FOLDER) { + String candidateName = profileCandidate.getName(); + String[] parts = split(candidateName, 2); + if (parts[0].equals(AB_PROFILE)) { + String name = parts[1]; + names.add(name); + } + } + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + String[] result = new String[names.size()]; + names.toArray(result); + return result; + } + + /* (non-Javadoc) + * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#saveRSEDOM(org.eclipse.rse.persistence.dom.RSEDOM, org.eclipse.core.runtime.IProgressMonitor) + */ + public boolean saveRSEDOM(RSEDOM dom, IProgressMonitor monitor) { + IFolder providerFolder = getProviderFolder(); +// String profileName = dom.getName(); +// System.out.println("saving profile " + profileName + " to " + providerFolder.getFullPath().toString() + "..."); + try { + int n = countNodes(dom); + if (monitor != null) monitor.beginTask("Saving DOM", n); + saveNode(dom, providerFolder, monitor); + if (monitor != null) monitor.done(); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + return true; + } + + /** + * Saves a node from the DOM to the file system. + * @param node The node to save. + * @param parentFolder The folder in which to save this node. The node will be a + * subfolder of this folder. + * @param monitor The progress monitor. If the monitor has been cancel then + * this method will do nothing and return null. + * @return The name of the folder saving this node. Can be used for constructing + * references to children. May return null if the monitor has been canceled. + */ + private String saveNode(RSEDOMNode node, IFolder parentFolder, IProgressMonitor monitor) { + if (monitor != null && monitor.isCanceled()) return null; + String nodeFolderName = getSaveFolderName(node); + IFolder nodeFolder = getFolder(parentFolder, nodeFolderName); + Properties properties = getProperties(node, false, monitor); + RSEDOMNode[] children = node.getChildren(); + Set childFolderNames = new HashSet(); + for (int i = 0; i < children.length; i++) { + RSEDOMNode child = children[i]; + String index = getIndexString(i); + if (!isNodeEmbedded(child)) { + String key = combine(MT_REFERENCE, index); + String childFolderName = saveNode(child, nodeFolder, monitor); + if (childFolderName != null) properties.put(key, childFolderName); + childFolderNames.add(childFolderName); + } + } + removeFolders(nodeFolder, childFolderNames); + String propertiesFileName = PROPERTIES_FILE_NAME; + IFile propertiesFile = nodeFolder.getFile(propertiesFileName); + writeProperties(properties, "RSE DOM Node", propertiesFile); + return nodeFolderName; + } + + /** + * Removes childFolders from the parent folder that are not in the keep set. + * Typically used to clean renamed nodes from the tree on a save operation. + * @param parentFolder The folder whose subfolders are to be examined. + * @param keepSet The names of the folders that should be kept. Others are discarded. + */ + private void removeFolders(IFolder parentFolder, Set keepSet) { + try { + IResource[] children = parentFolder.members(); + for (int i = 0; i < children.length; i++) { + IResource child = children[i]; + if (child.getType() == IResource.FOLDER) { + String childFolderName = child.getName(); + if (!keepSet.contains(childFolderName)) { + child.delete(true, null); + } + } + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private static final String VALID = "abcdefghijklmnopqrstuvwxyz0123456789-._"; + private static final String UPPER = "ABCDEFGHIJKLMNOPQRTSUVWXYZ"; + /** + * Returns the name of a folder that can be used to store a node of a particular + * type. Since this is a folder, its name must conform to the rules of the file + * system. The names are derived from the name and type of the node. Note that the + * actual name of the node is also stored as a property so we need not attempt + * to recover the node name from the folder name. + * @param node The node that will eventually be stored in this folder. + * @return The name of the folder to store this node. + */ + private String getSaveFolderName(RSEDOMNode node) { + String type = node.getType(); + type = (String) typeQualifiers.get(type); + String name = node.getName(); + int p = name.indexOf(':'); + if (p >= 0) { + name = name.substring(p + 1); + } + StringBuffer buf = new StringBuffer(name.length()); + char[] chars = name.toCharArray(); + long suffix = 0; + for (int i = 0; i < chars.length; i++) { + char c = chars[i]; + suffix *= 2; + if (VALID.indexOf(c) >= 0) { + buf.append(c); + } else if (UPPER.indexOf(c) >= 0) { // if uppercase + buf.append(Character.toLowerCase(c)); + suffix += 1; + } else if (c == ' ') { // if space + buf.append('_'); + suffix += 1; + } else { // if out of range + buf.append('#'); + buf.append(Integer.toHexString(c)); + buf.append('#'); + } + } + name = buf.toString() + "_" + Long.toString(suffix); + String result = combine(type, name); + return result; + } + + private Map getTypeQualifiers() { + Map typeQualifiers = new HashMap(); + typeQualifiers.put(IRSEDOMConstants.TYPE_CONNECTOR_SERVICE, AB_CONNECTOR_SERVICE); + typeQualifiers.put(IRSEDOMConstants.TYPE_FILTER, AB_FILTER); + typeQualifiers.put(IRSEDOMConstants.TYPE_FILTER_POOL, AB_FILTER_POOL); + typeQualifiers.put(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE, AB_FILTER_POOL_REFERENCE); + typeQualifiers.put(IRSEDOMConstants.TYPE_FILTER_STRING, AB_FILTER_STRING); + typeQualifiers.put(IRSEDOMConstants.TYPE_HOST, AB_HOST); + typeQualifiers.put(IRSEDOMConstants.TYPE_PROFILE, AB_PROFILE); + typeQualifiers.put(IRSEDOMConstants.TYPE_PROPERTY, AB_PROPERTY); + typeQualifiers.put(IRSEDOMConstants.TYPE_PROPERTY_SET, AB_PROPERTY_SET); + typeQualifiers.put(IRSEDOMConstants.TYPE_SERVER_LAUNCHER, AB_SERVICE_LAUNCHER); + typeQualifiers.put(IRSEDOMConstants.TYPE_SUBSYSTEM, AB_SUBSYSTEM); + return typeQualifiers; + } + + /** + * Write a set of properties to a file. + * @param properties The Properties object to write. + * @param header The header to include in the properties file. + * @param file The IFile which will contain the properties. + * @param monitor The progress monitor. + */ + private void writeProperties(Properties properties, String header, IFile file) { +// System.out.println("writing "+file.getFullPath()+"..."); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(500); + PrintWriter out = new PrintWriter(outStream); + out.println("# " + header); + Map map = new TreeMap(properties); + Set keys = map.keySet(); + + for (Iterator z = keys.iterator(); z.hasNext();) { + String key = (String) z.next(); + String value = (String)map.get(key); + String keyvalue = key + "=" + escapeValue(value); +// System.out.println("writing "+keyvalue); + out.println(keyvalue); + } + out.close(); +// System.out.println("...wrote "+file.getFullPath()); + ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray()); + try { + if (!file.exists()) { + file.create(inStream, true, null); + } else { + file.setContents(inStream, true, true, null); + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Tests if a node's definition should be embedded in its parent's definition or + * if it should be a separate definition. The test is usually based on node type. + * Currently only filter strings are embedded in their parent filter definition. + * @param node The node to be tested. + * @return true if the node is to be embedded. + */ + private boolean isNodeEmbedded(RSEDOMNode node) { + boolean result = false; + if (node.getType().equals(IRSEDOMConstants.TYPE_FILTER_STRING)) { + result = true; + } + return result; + } + + /** + * Transforms an integer into its five digit counterpart complete with leading + * zeroes. + * @param i an integer from 0 to 99999. + * @return a string equivalent from "00000" to "99999" + */ + private String getIndexString(int i) { + if (i < 0 || i > 99999) throw new IllegalArgumentException("Argument must be between 0 and 99999"); + String index = "00000" + Integer.toString(i); + index = index.substring(index.length() - 5); + return index; + } + + /** + * "Fixes" a value. Values in Properties objects may not be null. Changes all + * null values to the string "null" and escapes the characters in other values. + * @param value The value to check. + * @return The fixed value + */ + private String fixValue(String value) { + if (value == null) return NULL_VALUE_STRING; + return value; + } + + /** + * Escapes the characters in the supplied string according to the rules + * for properties files. + * @param value The value to examine. + * @return The equivalent value with escapes. + */ + private String escapeValue(String value) { + StringBuffer buffer = new StringBuffer(value.length() + 20); + char[] characters = value.toCharArray(); + for (int i = 0; i < characters.length; i++) { + char c = characters[i]; + if (c == '\\') { + buffer.append("\\\\"); + } else if (c == '\t') { + buffer.append("\\t"); + } else if (c == '\f') { + buffer.append("\\f"); + } else if (c == '\n') { + buffer.append("\\n"); + } else if (c == '\r') { + buffer.append("\\r"); + } else if ((c < '\u0020' && c > '\u007E')) { + String cString = "0000" + Integer.toHexString(c); + cString = cString.substring(cString.length() - 4); + cString = "\\u" + cString; + buffer.append(cString); + } else if ("=!#:".indexOf(c) >= 0) { + buffer.append('\\'); + buffer.append(c); + } else { + buffer.append(c); + } + } + return buffer.toString(); + } + + /** + * Constructs a properties object containing all the properties for this node. + * The following properties exist: + * name property, type property, embedded child properties, and referenced + * child properties. Each property has its own key format in the Properties + * object. + * @param node The node to extract the properties from. + * @param force Force children to be embedded rather than reference. + * @param monitor The progress monitor. The work count is increased by one each time + * this method is invoked. + * @return The Properties object containing that node definition. + */ + private Properties getProperties(RSEDOMNode node, boolean force, IProgressMonitor monitor) { + Properties properties = new Properties(); + properties.put(MT_NODE_NAME, node.getName()); + properties.put(MT_NODE_TYPE, node.getType()); + properties.putAll(getAttributes(node)); + RSEDOMNode[] children = node.getChildren(); + for (int i = 0; i < children.length; i++) { + RSEDOMNode child = children[i]; + String index = getIndexString(i); + if (force || isNodeEmbedded(child)) { + String prefix = combine(MT_CHILD, index); + Properties childProperties = getProperties(child, true, monitor); + Enumeration e = childProperties.keys(); + while (e.hasMoreElements()) { + String key = (String) e.nextElement(); + String value = childProperties.getProperty(key); + String newKey = combine(prefix, key); + properties.put(newKey, value); + } + } + } + if (monitor != null) monitor.worked(1); + return properties; + } + + /** + * Constructs a Properties object from the attributes present in a DOM node. + * @param node The node containing the attributes. Keys for attributes are of the + * form "attribute.[attribute-name]". If the attribute has a type then there + * will also be an "attribute-type.[attribute-name]" property. + * [attribute-name] may contain periods but must not be null. + * @return The newly constructed Properties object. + */ + private Properties getAttributes(RSEDOMNode node) { + Properties properties = new Properties(); + RSEDOMNodeAttribute[] attributes = node.getAttributes(); + for (int i = 0; i < attributes.length; i++) { + RSEDOMNodeAttribute attribute = attributes[i]; + String attributeName = attribute.getKey(); + String propertyKey = combine(MT_ATTRIBUTE, attributeName); + properties.put(propertyKey, fixValue(attribute.getValue())); + String attributeType = attribute.getType(); + if (attributeType != null) { + propertyKey = combine(MT_ATTRIBUTE_TYPE, attributeName); + properties.put(propertyKey, attributeType); + } + } + return properties; + } + + /** + * Count the number of nodes in a tree rooted in the supplied node. The + * supplied node is counted so the mininum result is one. + * @param node The root of the tree. + * @return The node count. + */ + private int countNodes(RSEDOMNode node) { + RSEDOMNode[] children = node.getChildren(); + int result = 1; + for (int i = 0; i < children.length; i++) { + RSEDOMNode child = children[i]; + result += countNodes(child); + } + return result; + } + + /* (non-Javadoc) + * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#loadRSEDOM(org.eclipse.rse.model.ISystemProfileManager, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) + */ + public RSEDOM loadRSEDOM(String profileName, IProgressMonitor monitor) { + RSEDOM dom = null; + IFolder profileFolder = getProfileFolder(profileName); + if (profileFolder.exists()) { + //System.out.println("loading from " + profileFolder.getFullPath().toString() + "..."); + int n = countPropertiesFiles(profileFolder); + if (monitor != null) monitor.beginTask("Loading DOM", n); + dom = (RSEDOM) loadNode(null, profileFolder, monitor); + if (monitor != null) monitor.done(); + } else { + //System.out.println(profileFolder.getFullPath().toString() + " does not exist."); + } + return dom; + } + + /** + * Counts the number of properties files in this folder and below. This provides + * a lower bound to the number of nodes that have to be created from this + * persistent form of a DOM. + * @param folder + * @return the number of properties files found. + */ + private int countPropertiesFiles(IFolder folder) { + int result = 0; + IFile propertiesFile = folder.getFile(PROPERTIES_FILE_NAME); + if (propertiesFile.exists()) { + result += 1; + try { + IResource[] members = folder.members(); + for (int i = 0; i < members.length; i++) { + IResource member = members[i]; + if (member.getType() == IResource.FOLDER) { + IFolder childFolder = (IFolder) member; + result += countPropertiesFiles(childFolder); + } + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return result; + } + + /** + * Loads a node from a folder. + * @param parent The parent of the node to be created. If null then this node is assumed to + * be a DOM root node (RSEDOM). + * @param nodeFolder The folder in which the node.properties file of this node is found. + * @param monitor The monitor used to report progress and cancelation. If the monitor is + * in canceled state then it this does method does nothing and returns null. If the monitor + * is not canceled then its work count is incremented by one. + * @return The newly loaded node. + */ + private RSEDOMNode loadNode(RSEDOMNode parent, IFolder nodeFolder, IProgressMonitor monitor) { + RSEDOMNode node = null; + if (monitor == null || !monitor.isCanceled()) { + Properties properties = loadProperties(nodeFolder); + if (properties != null) { + node = makeNode(parent, nodeFolder, properties, monitor); + } + if (monitor != null) monitor.worked(1); + } + return node; + } + + /** + * Loads the properties found in the folder. Returns null if no properties + * file was found. + * @param folder The folder in which to look for properties. + * @return The Properties object. + */ + private Properties loadProperties(IFolder folder) { + Properties properties = null; + IFile attributeFile = folder.getFile(PROPERTIES_FILE_NAME); + if (attributeFile.exists()) { + properties = new Properties(); + try { + InputStream inStream = attributeFile.getContents(); + try { + properties.load(inStream); + inStream.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return properties; + } + + /** + * Makes a new RSEDOMNode from a set of properties. The properties must (at least) include + * a "name" property and a "type" property. Any child nodes are created and attached as well. + * @param parent The parent node of the node to be created. + * @param nodeFolder The folder in which referenced child folders can be found. This will + * almost always be the folder in which the properties for the node to be created were found. + * @param properties The properties from which to create the node. + * @param monitor a monitor to support cancelation and progress reporting. + * @return the newly created DOM node and its children. + */ + private RSEDOMNode makeNode(RSEDOMNode parent, IFolder nodeFolder, Properties properties, IProgressMonitor monitor) { + String nodeType = properties.getProperty(MT_NODE_TYPE); + String nodeName = properties.getProperty(MT_NODE_NAME); + RSEDOMNode node = (parent == null) ? new RSEDOM(nodeName) : new RSEDOMNode(parent, nodeType, nodeName); + node.setRestoring(true); + Set keys = properties.keySet(); + Map attributes = new HashMap(); + Map attributeTypes = new HashMap(); + Map childPropertiesMap = new HashMap(); + Set childNames = new TreeSet(); // child names are 5 digit strings, a tree set is used to maintain ordering + Set referenceNames = new TreeSet(); // ditto for reference names + for (Iterator z = keys.iterator(); z.hasNext();) { + String key = (String) z.next(); + String[] words = split(key, 2); + String metatype = words[0]; + if (metatype.equals(MT_ATTRIBUTE)) { + String value = properties.getProperty(key); + attributes.put(words[1], value); + } else if (metatype.equals(MT_ATTRIBUTE_TYPE)) { + String type = properties.getProperty(key); + attributeTypes.put(words[1], type); + } else if (metatype.equals(MT_REFERENCE)) { + String referenceName = words[1]; + referenceNames.add(referenceName); + } else if (metatype.equals(MT_CHILD)) { + String value = properties.getProperty(key); + words = split(words[1], 2); + String childName = words[0]; + childNames.add(childName); + String newKey = words[1]; + Properties p = getProperties(childPropertiesMap, childName); + p.put(newKey, value); + } + } + Set attributeNames = attributes.keySet(); + for (Iterator z = attributeNames.iterator(); z.hasNext();) { + String attributeName = (String) z.next(); + String attributeValue = (String) attributes.get(attributeName); + if (attributeValue.equals(NULL_VALUE_STRING)) attributeValue = null; + String attributeType = (String) attributeTypes.get(attributeName); + node.addAttribute(attributeName, attributeValue, attributeType); + } + for (Iterator z = childNames.iterator(); z.hasNext();) { + String childName = (String) z.next(); + Properties p = getProperties(childPropertiesMap, childName); + makeNode(node, nodeFolder, p, monitor); + } + for (Iterator z = referenceNames.iterator(); z.hasNext();) { + String referenceName = (String) z.next(); + String key = combine(MT_REFERENCE, referenceName); + String childFolderName = properties.getProperty(key); + IFolder childFolder = getFolder(nodeFolder, childFolderName); + loadNode(node, childFolder, monitor); + } + node.setRestoring(false); + return node; + } + + /** + * Returns a Properties object from the given Map that holds them using the + * selector String. Creates a new Properties object and places it in the map + * if one does not exist for the selector. + * @param propertiesMap The map in which to look for Properties objects. + * @param selector The name of the Properties object + * @return a Properties object. + */ + private Properties getProperties(Map propertiesMap, String selector) { + Properties p = (Properties)propertiesMap.get(selector); + if (p == null) { + p = new Properties(); + propertiesMap.put(selector, p); + } + return p; + } + + /** + * Returns the IFolder in which this persistence provider stores its profiles. + * This will create the folder if the folder was not found. + * @return The folder that was created or found. + */ + private IFolder getProviderFolder() { + IProject project = RSEPersistenceManager.getRemoteSystemsProject(); + try { + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (Exception e) { + } + //IFolder providerFolder = getFolder(project, "org.eclipse.rse.dom.properties"); + IFolder providerFolder = getFolder(project, "dom.properties"); + return providerFolder; + } + + + /** + * Returns the IFolder in which a profile is stored. + * @return The folder that was created or found. + */ + private IFolder getProfileFolder(String profileName) { + String profileFolderName = combine(AB_PROFILE, profileName); + IFolder providerFolder = getProviderFolder(); + IFolder profileFolder = getFolder(providerFolder, profileFolderName); + return profileFolder; + } + + /** + * Returns the specified folder of the parent container. If the folder does + * not exist it creates it. + * @param parent the parent container - typically a project or folder + * @param name the name of the folder to find or create + * @return the found or created folder + */ + private IFolder getFolder(IContainer parent, String name) { + IPath path = new Path(name); + IFolder folder = parent.getFolder(path); + if (!folder.exists()) { + try { + folder.create(IResource.NONE, true, null); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return folder; + } + + /** + * Convenience method to combine two names into one. The individual names in the + * combined name are separated by periods. + * @param typeName The first name. + * @param nodeName The second name + * @return the combined name. + */ + private String combine(String typeName, String nodeName) { + return combine(new String[] {typeName, nodeName}); + } + + /** + * The generic method for creating a qualified name from a string of segments. + * The individual names are separated by periods. + * @param names The names to combine + * @return The combined name. + */ + private String combine(String[] names) { + StringBuffer buf = new StringBuffer(100); + for (int i = 0; i < names.length; i++) { + String name = names[i]; + if (i > 0) buf.append('.'); + buf.append(name); + } + return buf.toString(); + } + + /** + * Splits a combined name into its component parts. The period is used as the name + * separator. If a limit > 0 is specified the return value will contain at most that + * number of segments. The last segment may, in fact, be split some more. + * @param longName The name to be split + * @param limit The number of parts to split the name into. + * @return The parts of the name. + */ + private String[] split(String longName, int limit) { + return period.split(longName, limit); + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java new file mode 100644 index 00000000000..e43b3fc0f33 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java @@ -0,0 +1,425 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.internal.persistence; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; +import org.eclipse.rse.core.filters.SystemFilterPoolManager; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemHostPool; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemProfileManager; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.persistence.dom.RSEDOMExporter; +import org.eclipse.rse.internal.persistence.dom.RSEDOMImporter; +import org.eclipse.rse.logging.Logger; +import org.eclipse.rse.persistence.IRSEPersistenceManager; +import org.eclipse.rse.persistence.IRSEPersistenceProvider; +import org.eclipse.rse.persistence.dom.RSEDOM; + + +/** + * The persistence manager controls all aspects of persisting the RSE data model. It will both + * save and restore this model. There should be only persistence manager in existence. This instance + * can be retrieved using RSEUIPlugin.getThePersistenceManager. + * @see RSEUIPlugin#getThePersistenceManager() + */ +public class RSEPersistenceManager implements IRSEPersistenceManager { + + private static final int STATE_NONE = 0; + private static final int STATE_IMPORTING = 1; + private static final int STATE_EXPORTING = 2; + + private Map loadedProviders = new HashMap(10); + private int _currentState = STATE_NONE; + private RSEDOMExporter _exporter; + private RSEDOMImporter _importer; + + private static IProject remoteSystemsProject = null; + public static final String RESOURCE_PROJECT_NAME = "RemoteSystemsConnections"; + + private ISystemRegistry _registry; + private ISystemProfileManager _profileManager; + + public RSEPersistenceManager(ISystemRegistry registry) + { + _registry = registry; + _profileManager = registry.getSystemProfileManager(); + _exporter = RSEDOMExporter.getInstance(); + _exporter.setSystemRegistry(registry); + _importer = RSEDOMImporter.getInstance(); + _importer.setSystemRegistry(registry); + } + + /** + * Get the default remote systems project. + * @return IProject handle of the project. Use exists() to test existence. + */ + public static IProject getRemoteSystemsProject() + { + if (remoteSystemsProject == null) + { + remoteSystemsProject = ResourcesPlugin.getWorkspace().getRoot().getProject(RESOURCE_PROJECT_NAME); + } + return remoteSystemsProject; + } + + public void registerRSEPersistenceProvider(String id, IRSEPersistenceProvider provider) { + loadedProviders.put(id, provider); + } + + /** + * Returns the persistence provider denoted by the id. Only one instance of this + * persistence provider is created. + * @param id The id of the persistence provider, as denoted by the id attribute on its declaration. + * @return an IRSEPersistenceProvider which may be null if this id is not found. + */ + public IRSEPersistenceProvider getRSEPersistenceProvider(String id) { + Logger logger = RSECorePlugin.getDefault().getLogger(); + IRSEPersistenceProvider provider = (IRSEPersistenceProvider) loadedProviders.get(id); + if (provider == null) { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IConfigurationElement[] providerCandidates = registry.getConfigurationElementsFor("org.eclipse.rse.core", "persistenceProviders"); + for (int j = 0; j < providerCandidates.length; j++) { + IConfigurationElement providerCandidate = providerCandidates[j]; + if (providerCandidate.getName().equals("persistenceProvider")) { + String candidateId = providerCandidate.getAttribute("id"); + if (candidateId != null) { + if (candidateId.equals(id)) { + try { + provider = (IRSEPersistenceProvider) providerCandidate.createExecutableExtension("class"); + } catch (CoreException e) { + logger.logError("Exception loading persistence provider", e); // DWD nls + } + } + } else { + logger.logError("Missing id attribute in persistenceProvider element", null); // DWD nls + } + } else { + logger.logError("Invalid element in persistenceProviders extension point", null); // DWD nls + } + } + if (provider == null) { + logger.logError("Persistence provider not found.", null); // DWD nls + } + loadedProviders.put(id, provider); // even if provider is null + } + return provider; + } + + /** + * @return the default IRSEPersistenceProvider for this installation. + * TODO: need to determine what this is. Having more than one is problematic. + */ + public IRSEPersistenceProvider getRSEPersistenceProvider() { + IRSEPersistenceProvider provider = getRSEPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider"); + return provider; + } + + public boolean restore(ISystemProfileManager profileManager) { + return load(profileManager); + } + + /** + * Restore a profile of a given name from disk... + */ + protected ISystemProfile restoreProfile(ISystemProfileManager mgr, String name) throws Exception { + /* + * FIXME String fileName = mgr.getRootSaveFileName(name); java.util.List + * ext = null;//FIXME + * getMOFHelpers().restore(SystemResourceManager.getProfileFolder(name),fileName); + * // should be exactly one profile... Iterator iList = ext.iterator(); + * SystemProfile profile = (SystemProfile)iList.next(); + * mgr.initialize(profile, name); return profile; + */ + return null; + } + + /** + * Save all profiles to disk + */ + public boolean commit(ISystemProfileManager profileManager) { + + ISystemProfile[] profiles = profileManager.getSystemProfiles(); + for (int idx = 0; idx < profiles.length; idx++) { + try { + commit(profiles[idx]); + } catch (Exception exc) { + exc.printStackTrace(); + System.out.println("Error saving profile " + profiles[idx] + ": " + exc.getClass().getName() + " " + exc.getMessage()); + return false; + } + } + + return true; + } + + public boolean restore(ISystemHostPool connectionPool) { + return false; + } + + /** + * Restore a connection of a given name from disk... + */ + protected IHost restoreHost(ISystemHostPool hostPool, String connectionName) throws Exception { + /* + * FIXME //System.out.println("in SystemConnectionPoolImpl#restore for + * connection " + connectionName); String fileName = + * getRootSaveFileName(connectionName); + * //System.out.println(".......fileName = " + fileName); + * //System.out.println(".......folderName = " + + * getConnectionFolder(connectionName).getName()); java.util.List ext = + * getMOFHelpers().restore(getConnectionFolder(connectionName),fileName); + * // should be exactly one profile... Iterator iList = ext.iterator(); + * SystemConnection connection = (SystemConnection)iList.next(); if + * (connection != null) { if + * (!connection.getAliasName().equalsIgnoreCase(connectionName)) { + * RSEUIPlugin.logDebugMessage(this.getClass().getName(),"Incorrect + * alias name found in connections.xmi file for " + connectionName+". + * Name was reset"); connection.setAliasName(connectionName); // just in + * case! } internalAddConnection(connection); } return connection; + */ + return null; + } + + public boolean commit(ISystemHostPool connectionPool) { + if (connectionPool.isDirty()) { + commit(connectionPool.getSystemProfile()); + connectionPool.setDirty(false); + } + /* + Host[] connections = connectionPool.getHosts(); + for (int idx = 0; idx < connections.length; idx++) + { + if (!saveHost(connectionPool, connections[idx])) + { + return false; + } + } + return true; + */ + return false; // all persistence should be at profile level + } + + public boolean commit(ISystemFilterPoolManager filterPoolManager) { + if (filterPoolManager.isDirty()) { + commit(filterPoolManager.getSystemProfile()); + filterPoolManager.setDirty(false); + } + return false; + } + + public boolean commit(ISystemFilterPool filterPool) { + if (filterPool.isDirty()) { + commit(filterPool.getSystemFilterPoolManager().getSystemProfile()); + filterPool.setDirty(false); + } + return false; + } + + public boolean restore(ISystemFilterPool filterPool) { + //System.out.println("restore filterpool"); + // DWD function Is this method really needed? + return false; + } + + public boolean commit(ISystemFilter filter) { + // System.out.println("commit filter"); + // DWD function Is this method really needed? + /* + if (filter.isDirty()) + { + System.out.println("saving filter: "+filter.getName()); + filter.setDirty(false); + } + */ + /* FIXME + //initMOF(); assume caller did this! + String fileName = getRootSaveFileName(this); + IFolder folder = getFolder(this); + getMOFHelpers().save(folder,fileName, this); + */ + return false; + } + + public ISystemFilterPool restoreFilterPool(String name) { + //System.out.println("restore filter pool "+name); + // DWD function is this method really needed? + return null; + } + + public boolean commit(ISubSystem subSystem) { + + if (subSystem.isDirty()) { + // System.out.println("updated " + subSystem.getName()); + try { + // commit everything for now + commit(_profileManager); + subSystem.setDirty(false); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + /* + // FIXME + if (subSystem.isDirty()) + { + System.out.println("saving subsystem: "+subSystem.getName()); + } + */ + return false; + } + + /** + * Restore the filter pools from disk. + * @param logger The logging object to log errors to + * @param mgrFolder folder containing filter pool folders, or single file for that save policy + * @param name the name of the manager to restore. File name is derived from it when saving to one file. + * @param savePolicy How to persist filters. See SystemFilterConstants. + * @param namingPolicy Naming prefix information for persisted data file names. + * @return the restored manager, or null if it does not exist. If anything else went + * wrong, an exception is thrown. + */ + public ISystemFilterPoolManager restoreFilterPoolManager(ISystemProfile profile, Logger logger, ISystemFilterPoolManagerProvider caller, String name) { + ISystemFilterPoolManager mgr = SystemFilterPoolManager.createManager(profile); + ((SystemFilterPoolManager) mgr).initialize(logger, caller, name); // core data + mgr.setWasRestored(false); // DWD let's try this + return mgr; + } + + /** + * Attempt to save single profile to disk. + */ + public boolean commit(ISystemProfile profile) { + if (profile != null) { + return save(profile, false); + } + return false; + } + + public boolean commit(IHost host) { + return commit(host.getSystemProfile()); + } + + /** + * Loads and restores RSE artifacts from the last session + * @param profileManager + * @return true if the profiles are loaded + */ + private boolean load(ISystemProfileManager profileManager) { + boolean successful = true; + if (isExporting() || isImporting()) { + successful = false; + } else { + _currentState = STATE_IMPORTING; + IProject project = getRemoteSystemsProject(); + try { + if (!project.isSynchronized(IResource.DEPTH_ONE)) project.refreshLocal(IResource.DEPTH_ONE, null); + IRSEPersistenceProvider persistenceProvider = getRSEPersistenceProvider(); + String profileNames[] = persistenceProvider.getSavedProfileNames(); + for (int i = 0; i < profileNames.length; i++) { + String profileName = profileNames[i]; + RSEDOM dom = importRSEDOM(profileName); + if (dom != null) { + ISystemProfile restoredProfile = _importer.restoreProfile(profileManager, dom); + if (restoredProfile == null) { + successful = false; + } + } else { + successful = false; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + _currentState = STATE_NONE; + } + return successful; + } + + /** + * Writes the RSE model to a DOM and schedules writing of that DOM to disk. + * May, in fact, update an existing DOM instead of creating a new one. + * If in the process of importing, skip writing. + * @return true if the profile is written to a DOM + */ + private boolean save(ISystemProfile profile, boolean force) { + boolean result = false; + if (!isImporting()) { + _currentState = STATE_EXPORTING; + RSEDOM dom = exportRSEDOM(profile, true); // DWD should do merge, but does not handle deletes properly yet + _currentState = STATE_NONE; + result = true; + if (dom.needsSave()) { + Job job = dom.getSaveJob(); + if (job == null) { + job = new SaveRSEDOMJob(dom, getRSEPersistenceProvider()); + dom.setSaveJob(job); + } + job.schedule(3000); // five second delay + } + } + return result; + } + + public boolean isExporting() { + return _currentState == STATE_EXPORTING; + } + + public boolean isImporting() { + return _currentState == STATE_IMPORTING; + } + +// public void setState(int state) { +// _currentState = state; +// } + + private RSEDOM exportRSEDOM(ISystemProfile profile, boolean force) { + RSEDOM dom = _exporter.createRSEDOM(profile, force); + return dom; + } + + private RSEDOM importRSEDOM(String domName) { + RSEDOM dom = null; + IRSEPersistenceProvider provider = getRSEPersistenceProvider(); + if (provider != null) { + dom = provider.loadRSEDOM(domName, null); + } else { + Logger logger = RSECorePlugin.getDefault().getLogger(); + logger.logError("Persistence provider is not available.", null); // DWD NLS + } + return dom; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SaveRSEDOMJob.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SaveRSEDOMJob.java new file mode 100644 index 00000000000..1dadad5e11e --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SaveRSEDOMJob.java @@ -0,0 +1,50 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.internal.persistence; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.rse.persistence.IRSEPersistenceProvider; +import org.eclipse.rse.persistence.dom.RSEDOM; + +public class SaveRSEDOMJob extends Job { + + private RSEDOM _dom; + private IRSEPersistenceProvider _provider; + + public SaveRSEDOMJob(RSEDOM dom, IRSEPersistenceProvider provider) { + super("Saving RSE Profile: " + dom.getName()); + _dom = dom; + _provider = provider; + } + + protected IStatus run(IProgressMonitor monitor) { + IStatus result = Status.OK_STATUS; + synchronized (_dom) { // synchronize on the DOM to prevent its update while writing + if (_dom.needsSave()) { + _provider.saveRSEDOM(_dom, monitor); + _dom.markUpdated(); + } else { + result = Status.CANCEL_STATUS; + } + } + return result; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SerializingProvider.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SerializingProvider.java new file mode 100644 index 00000000000..7c8c3eedd30 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/SerializingProvider.java @@ -0,0 +1,179 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.internal.persistence; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Vector; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.persistence.IRSEPersistenceProvider; +import org.eclipse.rse.persistence.dom.RSEDOM; + + +/** + * This is class is used to restore an RSE DOM from disk and import it into RSE. + * @author dmcknigh + * + */ +public class SerializingProvider implements IRSEPersistenceProvider +{ + + /* (non-Javadoc) + * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#getSavedProfileNames() + */ + public String[] getSavedProfileNames() { + /* + * We look for folders inside the RemoteSystemsConnections folder that contain + * a single file named folderName.rsedom. We return the array of folder names. + */ + List names = new Vector(10); + try { + IProject project = RSEPersistenceManager.getRemoteSystemsProject(); + IResource[] candidates = project.members(); + for (int i = 0; i < candidates.length; i++) { + IResource candidate = candidates[i]; + if (candidate.getType() == IResource.FOLDER) { + IFolder candidateFolder = (IFolder) candidate; + IResource[] children = candidateFolder.members(); + if (children.length == 1) { + IResource child = children[0]; + if (child.getType() == IResource.FILE) { + String profileName = candidateFolder.getName(); + String domFileName = profileName + ".rsedom"; + String childName = child.getName(); + if (childName.equals(domFileName)) { + names.add(profileName); + } + } + } + } + } + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + String[] result = new String[names.size()]; + names.toArray(result); + return result; + } + + /** + * Restores a system profile in RSE. This API will likely change. + * + * @param profileManager + * @param profileFile the file representing the profile + * @return + */ + public RSEDOM loadRSEDOM(String profileName, IProgressMonitor monitor) + { + RSEDOM dom = null; + IFile profileFile = getProfileFile(profileName, monitor); + if (profileFile.exists()) + { + //System.out.println("loading "+ profileFile.getLocation().toOSString() + "..."); // DWD debugging + try + { + InputStream iStream = profileFile.getContents(); + + ObjectInputStream inStream = new ObjectInputStream(iStream); + dom = (RSEDOM)inStream.readObject(); + inStream.close(); + } + catch (Exception e) + { + e.printStackTrace(); + try + { + profileFile.delete(true, false, monitor); + } + catch (Exception e2) + { + e.printStackTrace(); + } + + } + } + return dom; + } + + private IFile getProfileFile(String domName, IProgressMonitor monitor) + { + IProject project = RSEPersistenceManager.getRemoteSystemsProject(); + + // before loading, make sure the project is in synch + try + { + project.refreshLocal(IResource.DEPTH_INFINITE, monitor); + } + catch (Exception e) + { + } + + IFolder folder = project.getFolder(domName); + if (!folder.exists()) + { + try + { + folder.create(true, true, monitor); + } + catch (Exception e) + { + } + } + return folder.getFile(domName + ".rsedom"); + } + + /** + * Saves an RSE dom to disk. This API will likely change. + * @param dom + * @param profileFile + * @return true if succcessful + */ + public boolean saveRSEDOM(RSEDOM dom, IProgressMonitor monitor) + { + + IFile profileFile = getProfileFile(dom.getName(), monitor); + File osFile = profileFile.getLocation().toFile(); + // System.out.println("saving "+ osFile.getAbsolutePath() + "..."); // DWD debugging + try + { + OutputStream oStream = new FileOutputStream(osFile); + ObjectOutputStream outStream = new ObjectOutputStream(oStream); + outStream.writeObject(dom); + outStream.close(); + profileFile.getParent().refreshLocal(IResource.DEPTH_ONE, monitor); + } + catch (Exception e) + { + e.printStackTrace(); + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java new file mode 100644 index 00000000000..00c8a454e01 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMExporter.java @@ -0,0 +1,447 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.internal.persistence.dom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IPropertySet; +import org.eclipse.rse.core.model.IPropertyType; +import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServerLauncherProperties; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.persistence.dom.IRSEDOMConstants; +import org.eclipse.rse.persistence.dom.IRSEDOMExporter; +import org.eclipse.rse.persistence.dom.RSEDOM; +import org.eclipse.rse.persistence.dom.RSEDOMNode; + +public class RSEDOMExporter implements IRSEDOMExporter { + private static RSEDOMExporter _instance = new RSEDOMExporter(); + private Map _domMap; + private ISystemRegistry _registry; + + /** + * Constructor to create a new DOM exporter. + */ + protected RSEDOMExporter() { + _domMap = new HashMap(); + } + + public void setSystemRegistry(ISystemRegistry registry) + { + _registry = registry; + } + + /** + * @return the singleton instance of this exporter + */ + public static RSEDOMExporter getInstance() { + return _instance; + } + + /** + * Returns the RSEDOM for this profile if it exists + * @param profile the profile for which to get the DOM + * @return the DOM for a particular profile, null if the DOM does not exist + */ + public RSEDOM getRSEDOM(ISystemProfile profile) { + return (RSEDOM) _domMap.get(profile); + } + + /** + * Creates the RSE DOM for this profile. After it has found the DOM it will + * synchronize on the DOM to ensure its integrity while it is being updated. + * @param profile the profile for which to create the DOM + * @param clean indicates whether to create from scratch or merge with existing DOM + * @return The DOM for this profile + */ + public RSEDOM createRSEDOM(ISystemProfile profile, boolean clean) { + RSEDOM dom = getRSEDOM(profile); + if (dom == null) { + dom = new RSEDOM(profile); + _domMap.put(profile, dom); + clean = true; + } + synchronized (dom) { + populateRSEDOM(dom, profile, clean); + } + return dom; + } + + /** + * Creates an RSE DOM for use in persistence + * @param dom the root node for the target DOM + * @param profile the profile from which to populate the DOM + * @param clean indicates whether to create from scratch or merge with existing DOM + * @return The DOM, updated with the data from the profile + */ + public RSEDOM populateRSEDOM(RSEDOM dom, ISystemProfile profile, boolean clean) { + // for now we do complete refresh + // clean dom for fresh creation + if (clean) { + dom.clearChildren(); + } + + if (clean || profile.isDirty() || dom.isDirty()) { + dom.clearAttributes(); + dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT_PRIVATE, getBooleanString(profile.isDefaultPrivate())); + dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_IS_ACTIVE, getBooleanString(profile.isActive())); + } + + // create the dom using the profile + + // create filter pool nodes + ISystemFilterPool[] filterPools = profile.getFilterPools(); + for (int i = 0; i < filterPools.length; i++) { + ISystemFilterPool pool = filterPools[i]; + createNode(dom, pool, clean); + } + + // create hosts nodes + + // old nodes to compare with + RSEDOMNode[] oldHostNodes = null; + if (!clean) { + oldHostNodes = dom.getChildren(IRSEDOMConstants.TYPE_HOST); + } + + List missingNodes = new ArrayList(); + if (!clean) { + for (int o = 0; o < oldHostNodes.length; o++) { + missingNodes.add(oldHostNodes[o]); + } + } + + IHost[] hosts = profile.getHosts(); + for (int j = 0; j < hosts.length; j++) { + IHost host = hosts[j]; + RSEDOMNode hnode = createNode(dom, host, clean); + + if (!clean) { + // remove this one from the missing list + missingNodes.remove(hnode); + } + } + + if (!clean) { + // remaining missingNodes are probably deleted now + for (int x = 0; x < missingNodes.size(); x++) { + dom.removeChild((RSEDOMNode) missingNodes.get(x)); + } + } + + // create generic property set nodes + createPropertySetNodes(dom, profile, clean); + dom.setDirty(false); + + return dom; + } + + /** + * Creates DOM nodes for each associated property set + * @param parent The node of the DOM that needs a property set + * @param modelObject the RSE model object that has the property set. + * @param clean true if we are creating, false if we are merging + * @return an array of DOM nodes - each one being a property set + */ + public RSEDOMNode[] createPropertySetNodes(RSEDOMNode parent, IRSEModelObject modelObject, boolean clean) { + IPropertySet[] propertySets = modelObject.getPropertySets(); + for (int i = 0; i < propertySets.length; i++) { + IPropertySet set = propertySets[i]; + RSEDOMNode node = new RSEDOMNode(parent, IRSEDOMConstants.TYPE_PROPERTY_SET, set.getName()); + String[] keys = set.getPropertyKeys(); + for (int k = 0; k < keys.length; k++) { + String key = keys[k]; + String value = set.getPropertyValue(key); + IPropertyType type = set.getPropertyType(key); + node.addAttribute(key, value, type.toString()); + } + } + return parent.getChildren(); + } + + /** + * Create a DOM node representing a filter pool + * @param parent the parent DOM node + * @param filterPool the filter pool from which to create a DOM node linked to this parent + * @param clean true if we are creating, false if we are merging + * @return the DOM node representing the filter pool + */ + public RSEDOMNode createNode(RSEDOMNode parent, ISystemFilterPool filterPool, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_FILTER_POOL, filterPool, clean); + if (clean || node.isDirty()) { + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, filterPool.getType()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_ID, filterPool.getId()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_NESTED_FILTERS, getBooleanString(filterPool.supportsNestedFilters())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DELETABLE, getBooleanString(filterPool.isDeletable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT, getBooleanString(filterPool.isDefault())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_STRING_CASE_SENSITIVE, getBooleanString(filterPool.isSetStringsCaseSensitive())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_DUPLICATE_FILTER_STRINGS, getBooleanString(filterPool.supportsDuplicateFilterStrings())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE, "" + filterPool.getRelease()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY, getBooleanString(filterPool.isSetSingleFilterStringOnly())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_OWNING_PARENT_NAME, filterPool.getOwningParentName()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_NON_RENAMABLE, getBooleanString(filterPool.isNonRenamable())); + } + ISystemFilter[] filters = filterPool.getSystemFilters(); + for (int i = 0; i < filters.length; i++) { + createNode(node, filters[i], clean); + } + createPropertySetNodes(node, filterPool, clean); + node.setDirty(false); + return node; + } + + /** + * Creates a DOM node for a filter + * @param parent The parent DOM node for this filter, usually a DOM node for a filter pool + * @param filter the filter for which to create a new node + * @param clean true if we are creating, false if we are merging + * @return the DOM node representing the filter + */ + public RSEDOMNode createNode(RSEDOMNode parent, ISystemFilter filter, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_FILTER, filter, clean); + if (clean || node.isDirty()) { + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_ID, filter.getName()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_NESTED_FILTERS, getBooleanString(filter.isSupportsNestedFilters())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELATIVE_ORDER, "" + filter.getRelativeOrder()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT, getBooleanString(filter.isDefault())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_STRING_CASE_SENSITIVE, getBooleanString(filter.isSetStringsCaseSensitive())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE, getBooleanString(filter.isPromptable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_DUPLICATE_FILTER_STRINGS, getBooleanString(filter.supportsDuplicateFilterStrings())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_NON_DELETABLE, getBooleanString(filter.isNonDeletable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_NON_RENAMABLE, getBooleanString(filter.isNonRenamable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_NON_CHANGEABLE, getBooleanString(filter.isNonChangable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE, getBooleanString(filter.isStringsNonChangable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE, "" + filter.getRelease()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY, getBooleanString(filter.isSetSingleFilterStringOnly())); + } + + // add nested filters + ISystemFilter[] nestedFilters = filter.getSystemFilters(); + for (int i = 0; i < nestedFilters.length; i++) { + createNode(node, nestedFilters[i], clean); + } + + // add filter strings + ISystemFilterString[] filterStrings = filter.getSystemFilterStrings(); + for (int j = 0; j < filterStrings.length; j++) { + createNode(node, filterStrings[j], clean); + } + + createPropertySetNodes(node, filter, clean); + node.setDirty(false); + return node; + } + + /** + * Creates a DOM node for a filter string + * @param parent the DOM node that is the parent to this filter string. This should be a node for a filter. + * @param filterString The filter string for which the node will be created + * @param clean true if we are creating, false if we are merging + * @return the DOM node for the filter string + */ + public RSEDOMNode createNode(RSEDOMNode parent, ISystemFilterString filterString, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_FILTER_STRING, filterString, clean); + + if (clean || node.isDirty()) { + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_STRING, filterString.getString()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, filterString.getType()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT, getBooleanString(filterString.isDefault())); + } + + createPropertySetNodes(node, filterString, clean); + return node; + } + + /** + * Create a DOM node representing a host + * @param parent The DOM node that is the parent to this host, usually a node representing a profile + * @param host The host for which to create the DOM node + * @param clean true if we are creating, false if we are merging + * @return the DOM node for the host + */ + public RSEDOMNode createNode(RSEDOMNode parent, IHost host, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_HOST, host, clean); + + if (clean || node.isDirty()) { + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, host.getSystemType()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_OFFLINE, getBooleanString(host.isOffline())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE, getBooleanString(host.isPromptable())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_HOSTNAME, host.getHostName()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION, host.getDescription()); + } + + IConnectorService[] connectorServices = host.getConnectorServices(); + for (int i = 0; i < connectorServices.length; i++) { + IConnectorService service = connectorServices[i]; + createNode(node, service, clean); + } + + createPropertySetNodes(node, host, clean); + node.setDirty(false); + return node; + } + + /** + * Creates a DOM node for a connector service + * @param parent the DOM node representing the parent for a connector service. This should be a Host + * @param connectorService the connector service for which a DOM node is to be created + * @param clean true if we are creating, false if we are merging + * @return the DOM node for the connector service + */ + public RSEDOMNode createNode(RSEDOMNode parent, IConnectorService connectorService, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_CONNECTOR_SERVICE, connectorService, clean); + if (clean || node.isDirty()) { + // store it's attributes + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, connectorService.getHostType()); + + // can't do this til connector service owns the properties (right now it's still subsystem) + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_GROUP, connectorService.getName()); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_USE_SSL, getBooleanString(connectorService.isUsingSSL())); + } + // store the server launcher + // right now subsystem still owns the server launchers + // that will change later + + IServerLauncherProperties serverLauncher = connectorService.getRemoteServerLauncherProperties(); + if (serverLauncher != null) { + createNode(node, serverLauncher, clean); + } + + // store each subsystem + ISubSystem[] subSystems = connectorService.getSubSystems(); + for (int i = 0; i < subSystems.length; i++) { + createNode(node, subSystems[i], clean); + } + + createPropertySetNodes(node, connectorService, clean); + node.setDirty(false); + return node; + } + + /** + * Creates a DOM node for a server launcher + * @param parent the DOM node represnting a parent for a server launcher, usually a connector service + * @param serverLauncher the server launcher from which to create the node + * @param clean true if we are creating, false if we are merging + * @return the node representing the server launcher + */ + public RSEDOMNode createNode(RSEDOMNode parent, IServerLauncherProperties serverLauncher, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_SERVER_LAUNCHER, serverLauncher, clean); + + if (clean || node.isDirty()) { + } + + serverLauncher.saveToProperties(); + createPropertySetNodes(node, serverLauncher, clean); + return node; + } + + /** + * Creates a DOM node for a subsystem + * @param parent the DOM node representing the parent for this subsystem, usually a connector service + * @param subSystem the subsystem from which to create the DOM node + * @param clean true if we are creating, false if we are merging + * @return the DOM node representing the subsystem + */ + public RSEDOMNode createNode(RSEDOMNode parent, ISubSystem subSystem, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_SUBSYSTEM, subSystem, clean); + + if (clean || node.isDirty()) { + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_HIDDEN, getBooleanString(subSystem.isHidden())); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, subSystem.getSubSystemConfiguration().getId()); + } + + // create filter pool reference nodes + ISystemFilterPoolReferenceManager refMgr = subSystem.getFilterPoolReferenceManager(); + if (refMgr != null) { + ISystemFilterPoolReference[] references = refMgr.getSystemFilterPoolReferences(); + for (int i = 0; i < references.length; i++) { + ISystemFilterPoolReference ref = references[i]; + createNode(node, ref, clean); + } + } + + createPropertySetNodes(node, subSystem, clean); + node.setDirty(false); + return node; + } + + /** + * Creates a DOM node for a filter pool reference + * @param parent the DOM node representing the parent for a filter pool reference, usually a subsystem + * @param filterPoolReference the reference from which to create a new DOM node + * @param clean true if we are creating, false if we are merging + * @return the DOM node created for the filter pool reference + */ + public RSEDOMNode createNode(RSEDOMNode parent, ISystemFilterPoolReference filterPoolReference, boolean clean) { + RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE, filterPoolReference, clean); + + if (clean || node.isDirty()) { + ISystemFilterPool filterPool = filterPoolReference.getReferencedFilterPool(); + node.addAttribute(IRSEDOMConstants.ATTRIBUTE_REF_ID, filterPool.getId()); + } + + createPropertySetNodes(node, filterPoolReference, clean); + node.setDirty(false); + return node; + } + + /** + * @param parent the DOM node representing the parent of the node we are trying to find + * @param type the type of the DOM node to look for + * @param modelObject the model object for which we are trying to find a matching node + * @param clean true if we are creating, false if we are merging + * @return the DOM node that we found or created + */ + private RSEDOMNode findOrCreateNode(RSEDOMNode parent, String type, IRSEModelObject modelObject, boolean clean) { + RSEDOMNode node = null; + String name = modelObject.getName(); + if (!clean) { + node = parent.getChild(type, name); + if (node != null && modelObject.isDirty()) { + node.clearAttributes(); + node.setDirty(true); + } + } + boolean newNode = (node == null); + if (newNode) { + node = new RSEDOMNode(parent, type, name); + } + return node; + } + + /** + * Helper to get either "true" or "false" based on boolean flag + * @param flag the flag which to translate + * @return a string value suitable for the DOM + */ + private String getBooleanString(boolean flag) { + return flag ? IRSEDOMConstants.ATTRIBUTE_TRUE : IRSEDOMConstants.ATTRIBUTE_FALSE; + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java new file mode 100644 index 00000000000..c5853fedec3 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java @@ -0,0 +1,554 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.internal.persistence.dom; + +import java.util.Vector; + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterConstants; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterStartHere; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IPropertySet; +import org.eclipse.rse.core.model.IPropertyType; +import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemProfileManager; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.model.PropertyType; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServerLauncherProperties; +import org.eclipse.rse.core.subsystems.IServiceSubSystem; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.core.subsystems.SubSystemFilterNamingPolicy; +import org.eclipse.rse.persistence.dom.IRSEDOMConstants; +import org.eclipse.rse.persistence.dom.IRSEDOMImporter; +import org.eclipse.rse.persistence.dom.RSEDOM; +import org.eclipse.rse.persistence.dom.RSEDOMNode; +import org.eclipse.rse.persistence.dom.RSEDOMNodeAttribute; + + + +public class RSEDOMImporter implements IRSEDOMImporter +{ + private static RSEDOMImporter _instance = new RSEDOMImporter(); + private ISystemRegistry _registry; + + public static RSEDOMImporter getInstance() + { + return _instance; + } + + public RSEDOMImporter() + { + } + + public void setSystemRegistry(ISystemRegistry registry) + { + _registry = registry; + } + + /** + * Restores the profile represented by dom + * @param profileManager + * @param dom + * @return the restored profile + */ + public ISystemProfile restoreProfile(ISystemProfileManager profileManager, RSEDOM dom) + { + // create the profile + String profileName = dom.getName(); + boolean defaultPrivate = getBooleanValue(dom.getAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT_PRIVATE).getValue()); + boolean isActive = getBooleanValue(dom.getAttribute(IRSEDOMConstants.ATTRIBUTE_IS_ACTIVE).getValue()); + ISystemProfile profile = profileManager.createSystemProfile(profileName, isActive); + + + if (profile != null) + { + profile.setDefaultPrivate(defaultPrivate); + profileManager.makeSystemProfileActive(profile, isActive); + // restore the children for the profile + RSEDOMNode[] children = dom.getChildren(); + for (int i = 0;i < children.length; i++) + { + RSEDOMNode child = children[i]; + String type = child.getType(); + if (type.equals(IRSEDOMConstants.TYPE_HOST)) + { + restoreHost(profile, child); + } + else if (type.equals(IRSEDOMConstants.TYPE_FILTER_POOL)) + { + restoreFilterPool(profile, child); + } + else if (type.equals(IRSEDOMConstants.TYPE_PROPERTY_SET)) + { + restorePropertySet(profile, child); + } + } + } + return profile; + } + + /** + * Restores the host represented by hostNode + */ + public IHost restoreHost(ISystemProfile profile, RSEDOMNode hostNode) + { + IHost host = null; + + // get host node attributes + String connectionName = hostNode.getName(); + String systemType = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); + String hostName = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_HOSTNAME).getValue(); + String description = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION).getValue(); + boolean isOffline = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_OFFLINE).getValue()); + boolean isPromptable = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE).getValue()); + + // create host and set it's attributes + try + { + // NOTE create host effectively recreates the subsystems + // so instead of creating subsystems on restore, we should be updating their properties + host = profile.createHost(systemType, connectionName, hostName, description); + host.setOffline(isOffline); + host.setPromptable(isPromptable); + } + catch (Exception e) + { + e.printStackTrace(); + } + + // restore children of host + RSEDOMNode[] children = hostNode.getChildren(); + for (int i = 0;i < children.length; i++) + { + RSEDOMNode child = children[i]; + String type = child.getType(); + if (type.equals(IRSEDOMConstants.TYPE_CONNECTOR_SERVICE)) + { + restoreConnectorService(host, child); + } + else if (type.equals(IRSEDOMConstants.TYPE_PROPERTY_SET)) + { + restorePropertySet(profile, child); + } + } + + return host; + } + + /** + * Restore the connector service represented by connectorServiceNode + */ + public IConnectorService restoreConnectorService(IHost host, RSEDOMNode connectorServiceNode) + { + // TODO - this should come before subsystems + // but currently we're still using old way of creating subsystem first + IConnectorService service = null; + + // get attributes of the service +// String name = connectorServiceNode.getName(); +// String type = connectorServiceNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); +// String group = connectorServiceNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_GROUP).getValue(); + boolean useSSL = getBooleanValue(connectorServiceNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_USE_SSL).getValue()); + + // first restore subsystems (since right now we need subsystem to get at service + RSEDOMNode[] ssChildren = connectorServiceNode.getChildren(IRSEDOMConstants.TYPE_SUBSYSTEM); + for (int s = 0; s < ssChildren.length; s++) + { + RSEDOMNode ssChild = ssChildren[s]; + ISubSystem subSystem = restoreSubSystem(host, ssChild); + if (subSystem != null && service == null) + { + ISubSystemConfiguration factory = subSystem.getSubSystemConfiguration(); + service = factory.getConnectorService(host); + if (service != null) + { + if (factory.supportsServerLaunchProperties(host)) + { + IServerLauncherProperties sl = factory.createServerLauncher(service); + if (sl != null) + { + // get server launcher properties + // right now we just set them for subsystem, but later that will change + RSEDOMNode serverLauncherPropertiesNode = null; + RSEDOMNode[] slChildren = connectorServiceNode.getChildren(IRSEDOMConstants.TYPE_SERVER_LAUNCHER); + if (slChildren != null && slChildren.length > 0) + { + serverLauncherPropertiesNode = slChildren[0]; + restoreServerLauncher(service, serverLauncherPropertiesNode, sl); + } + } + } + + service.setIsUsingSSL(useSSL); + } + } + if (service != null && subSystem != null) + { + subSystem.setConnectorService(service); + } + } + + + + // restore all property sets + RSEDOMNode[] psChildren = connectorServiceNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); + for (int p = 0;p < psChildren.length; p++) + { + RSEDOMNode psChild = psChildren[p]; + restorePropertySet(service, psChild); + } + return service; + } + + public IServerLauncherProperties restoreServerLauncher(IConnectorService service, RSEDOMNode serverLauncherNode, IServerLauncherProperties sl) + { +// restore all property sets + RSEDOMNode[] psChildren = serverLauncherNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); + for (int p = 0;p < psChildren.length; p++) + { + RSEDOMNode psChild = psChildren[p]; + restorePropertySet(sl, psChild); + } + sl.restoreFromProperties(); + service.setRemoteServerLauncherProperties(sl); + return sl; + } + + /** + * Restores the subsystem represented by subSystemNode + */ + public ISubSystem restoreSubSystem(IHost host, RSEDOMNode subSystemNode) + { + // in most cases (if not all) the subsystem already exists + // since createHost() ends up recreating subsystems for each factory + String name = subSystemNode.getName(); + String type = subSystemNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); + boolean isHidden = getBooleanValue(subSystemNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_HIDDEN).getValue()); + ISubSystem subSystem = null; + ISubSystemConfiguration factory = getSubSystemConfiguration(type); + if (factory != null) + { + if (factory instanceof IServiceSubSystemConfiguration) + { + IServiceSubSystemConfiguration serviceFactory = (IServiceSubSystemConfiguration)factory; + ISubSystem[] existingSubSystems = _registry.getServiceSubSystems(serviceFactory.getServiceType(), host); + if (existingSubSystems != null && existingSubSystems.length > 0) + { + subSystem = existingSubSystems[0]; + // need to switch factories + ((IServiceSubSystem)subSystem).switchServiceFactory(serviceFactory); + } + } + else + { + ISubSystem[] existingSubSystems = _registry.getSubSystems(type, host); + + if (existingSubSystems != null && existingSubSystems.length > 0) + { + subSystem = existingSubSystems[0]; + } + } + + if (subSystem == null) + { + subSystem = factory.createSubSystemInternal(host); + } + subSystem.setHidden(isHidden); + subSystem.setHost(host); + subSystem.setSubSystemConfiguration(factory); + subSystem.setName(factory.getName()); + subSystem.setConfigurationId(factory.getId()); + subSystem.setWasRestored(true); + + if (factory.supportsFilters()) + { + ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere(); + ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name, new SubSystemFilterNamingPolicy()); + subSystem.setFilterPoolReferenceManager(fprMgr); + ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile()); + fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); + } + + + + // restore filer pool references + RSEDOMNode[] filterPoolReferenceChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE); + for (int i = 0; i < filterPoolReferenceChildren.length; i++) + { + RSEDOMNode fprChild = filterPoolReferenceChildren[i]; + restoreFilterPoolReference(subSystem, fprChild); + } + + // restore all property sets + RSEDOMNode[] psChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); + for (int p = 0;p < psChildren.length; p++) + { + RSEDOMNode psChild = psChildren[p]; + restorePropertySet(subSystem, psChild); + } + } + return subSystem; + } + + /** + * Restore the filter + */ + public ISystemFilter restoreFilter(ISystemFilterPool filterPool, RSEDOMNode node) + { + // get the node attributes for a filter + String name = node.getName(); + boolean supportsNestedFilters = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_NESTED_FILTERS).getValue()); + int relativeOrder = getIntegerValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_RELATIVE_ORDER).getValue()); + boolean isDefault = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT).getValue()); + boolean isSetStringsCaseSensitive = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_STRING_CASE_SENSITIVE).getValue()); + boolean isPromptable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_PROMPTABLE).getValue()); + boolean isSetSupportsDuplicateFilterStrings = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_DUPLICATE_FILTER_STRINGS).getValue()); + boolean isNonDeletable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_NON_DELETABLE).getValue()); + boolean isNonRenamable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_NON_RENAMABLE).getValue()); + boolean isNonChangable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_NON_CHANGEABLE).getValue()); + boolean isStringsNonChangable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_STRINGS_NON_CHANGABLE).getValue()); + int release = getIntegerValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE).getValue()); + boolean isSetSingleFilterStringOnly = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY).getValue()); + + Vector filterStrings = new Vector(); + + // create the filter strings + RSEDOMNode filterStringNodes[] = node.getChildren(IRSEDOMConstants.TYPE_FILTER_STRING); + for (int i = 0; i < filterStringNodes.length; i++) + { + RSEDOMNode filterStringNode = filterStringNodes[i]; + + // might not have to restore the filter strings this way + //restoreFilterString(filter, filterStringNode); + + filterStrings.add(filterStringNode.getName()); + } + + // create the filter + ISystemFilter filter = filterPool.createSystemFilter(name, filterStrings); + + filter.setWasRestored(true); + + // set filter attributes + filter.setSupportsNestedFilters(supportsNestedFilters); + filter.setRelativeOrder(relativeOrder); + filter.setDefault(isDefault); + filter.setStringsCaseSensitive(isSetStringsCaseSensitive); + filter.setPromptable(isPromptable); + filter.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings); + filter.setNonDeletable(isNonDeletable); + filter.setNonChangable(isNonChangable); + filter.setNonRenamable(isNonRenamable); + filter.setStringsNonChangable(isStringsNonChangable); + filter.setRelease(release); + filter.setSingleFilterStringOnly(isSetSingleFilterStringOnly); + + // restore all property sets + RSEDOMNode[] psChildren = node.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); + for (int p = 0;p < psChildren.length; p++) + { + RSEDOMNode psChild = psChildren[p]; + restorePropertySet(filter, psChild); + } + return filter; + } + + /** + * Restore the filter pool represented by the node + */ + public ISystemFilterPool restoreFilterPool(ISystemProfile profile, RSEDOMNode node) + { + ISystemFilterPool filterPool = null; + + // get the node attributes for a filter pool + String name = node.getName(); + String type = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); + String id = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_ID).getValue(); + boolean supportsNestedFilters = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_NESTED_FILTERS).getValue()); + boolean isDeletable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_DELETABLE).getValue()); + boolean isDefault = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT).getValue()); + boolean isSetStringsCaseSensitive = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_STRING_CASE_SENSITIVE).getValue()); + boolean isSetSupportsDuplicateFilterStrings = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SUPPORTS_DUPLICATE_FILTER_STRINGS).getValue()); + int release = getIntegerValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_RELEASE).getValue()); + boolean isSetSingleFilterStringOnly = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_SINGLE_FILTER_STRING_ONLY).getValue()); + String owningParentName = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_OWNING_PARENT_NAME).getValue(); + boolean isNonRenamable = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_NON_RENAMABLE).getValue()); + + // create the filter pool and set it's attributes + try + { + ISubSystemConfiguration factory = getSubSystemConfiguration(id); + if (factory != null) + { + ISystemFilterPoolManager mgr = factory.getFilterPoolManager(profile); + if (isDefault) + { + filterPool = mgr.getFirstDefaultSystemFilterPool(); + } + else + { + filterPool = mgr.getSystemFilterPool(name); + } + if (filterPool == null) + { + filterPool = _registry.getSystemFilterPool().createSystemFilterPool(name, + supportsNestedFilters, + isDeletable, + ISystemFilterConstants.TRY_TO_RESTORE_NO); + + if (filterPool != null) + { + filterPool.setSystemFilterPoolManager(mgr); + // add to model + mgr.getPools().add(filterPool); + } + } + filterPool.setType(type); + filterPool.setDefault(isDefault); + filterPool.setSupportsNestedFilters(supportsNestedFilters); + filterPool.setStringsCaseSensitive(isSetStringsCaseSensitive); + filterPool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings); + filterPool.setRelease(release); + filterPool.setSingleFilterStringOnly(isSetSingleFilterStringOnly); + filterPool.setOwningParentName(owningParentName); + filterPool.setNonRenamable(isNonRenamable); + + filterPool.setWasRestored(true); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + + // restore children + RSEDOMNode[] children = node.getChildren(); + for (int i = 0;i < children.length; i++) + { + RSEDOMNode child = children[i]; + String ctype = child.getType(); + if (ctype.equals(IRSEDOMConstants.TYPE_FILTER)) + { + if (filterPool != null) + { + restoreFilter(filterPool, child); + } + } + else if (ctype.equals(IRSEDOMConstants.TYPE_PROPERTY_SET)) + { + restorePropertySet(filterPool, child); + } + } + return filterPool; + } + + /** + * Restore the filter pool reference that is represented by the node + */ + public ISystemFilterPoolReference restoreFilterPoolReference(ISubSystem subsystem, RSEDOMNode node) { + ISystemFilterPoolReference filterPoolReference = null; + String subsystemName = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_REF_ID).getValue(); + String filterPoolName = node.getName(); + ISubSystemConfiguration configuration = getSubSystemConfiguration(subsystemName); + if (configuration != null) { + ISystemProfile profile = subsystem.getSystemProfile(); // DWD are there cases where this may be null? + ISystemFilterPoolManager filterPoolManager = configuration.getFilterPoolManager(profile); + ISystemFilterPool filterPool = filterPoolManager.getSystemFilterPool(filterPoolName); + ISystemFilterPoolReferenceManager referenceManager = subsystem.getFilterPoolReferenceManager(); + /* + * DWD filterpool can be null when restoring since there can be forward references. + * A profile may be being restored that has references to a filter pool in a profile that doesn't yet exist. + * Need to create an "unresolved" reference instead of a null object and then patch them up + * at the end. + */ + // create reference to the filterpool + if (filterPool != null) { + filterPoolReference = referenceManager.addReferenceToSystemFilterPool(filterPool); + } else { + try { + filterPoolReference = referenceManager.addReferenceToSystemFilterPool(filterPoolManager, filterPoolName); + } catch(NullPointerException e) { + //TODO Workaround for bug 153253 -- should be fixed properly + System.err.println("TODO: Fix bug 153253 - NPE reading connection-private filter pools"); + e.printStackTrace(); + } + } + } + return filterPoolReference; + } + + public ISystemFilterString restoreFilterString(ISystemFilter filter, RSEDOMNode node) + { + /* + String string = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_STRING).getValue(); + String type = node.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); + boolean isDefault = getBooleanValue(node.getAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT).getValue()); + + SystemFilterString filterString = filter + */ + return null;//not sure if we need this + } + + /** + * Restores the property set represented by propertySetNode + */ + public IPropertySet restorePropertySet(IRSEModelObject modelObject, RSEDOMNode propertySetNode) + { + String name = propertySetNode.getName(); + IPropertySet set = modelObject.createPropertySet(name); + RSEDOMNodeAttribute[] attributes = propertySetNode.getAttributes(); + for (int i = 0; i < attributes.length; i++) + { + RSEDOMNodeAttribute attribute = attributes[i]; + String typeStr = attribute.getType(); + IPropertyType type = PropertyType.fromString(typeStr); + + set.addProperty(attribute.getKey(), attribute.getValue(), type); + + } + return set; + } + + private boolean getBooleanValue(String booleanStr) + { + return ((booleanStr != null) && booleanStr.equalsIgnoreCase(IRSEDOMConstants.ATTRIBUTE_TRUE)); + } + + private int getIntegerValue(String integerString) + { + return Integer.parseInt(integerString); + } + + /** + * Returns the subsystem configuration for a given subsystem name + * @param subsystemName the name to look up + * @return the subsystem configuration matching the name + */ + private ISubSystemConfiguration getSubSystemConfiguration(String subsystemName) + { + return _registry.getSubSystemConfiguration(subsystemName); + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceManager.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceManager.java new file mode 100644 index 00000000000..c63dd1a9686 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceManager.java @@ -0,0 +1,119 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence; + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemHostPool; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemProfileManager; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.logging.Logger; + + +public interface IRSEPersistenceManager +{ + /** + * Register the persistence provider to be used when saving and restoring RSE doms. + * The provider is registered under the provided id. + * @param id the provider id. + * @param provider the provider. + */ + public void registerRSEPersistenceProvider(String id, IRSEPersistenceProvider provider); + + /** + * Restore all profiles + * @param profileManager + * @return true if successful + */ + public boolean restore(ISystemProfileManager profileManager); + + /** + * Save all profiles + * @param profileManager + * @return true if successful + */ + public boolean commit(ISystemProfileManager profileManager); + + public boolean commit(IHost host); + + /** + * Restore all connections in the connection pool + * @param connectionPool + * @return true if successful + */ + public boolean restore(ISystemHostPool connectionPool); + + /** + * Save all connections in the connection pool + * @param connectionPool + * @return true if successful + */ + public boolean commit(ISystemHostPool connectionPool); + + public boolean commit(ISystemFilterPoolManager filterPoolManager); + /** + * Save all the filters in the filter pool + * @param filterPool + * @return true if successful + */ + public boolean commit(ISystemFilterPool filterPool); + + /** + * Save this filter + * @param filter + * @return true if successful + */ + public boolean commit(ISystemFilter filter); + + /** + * Restore all the filters for the filter pool + * @param filterPool + * @return true if sucessful + */ + public boolean restore(ISystemFilterPool filterPool); + + /** + * Restore the filter pool + * @param name + * @return the filter pool if successful + */ + public ISystemFilterPool restoreFilterPool(String name); + + + /** + * Save this subsystem + * @param subSystem + * @return true if successful + */ + public boolean commit(ISubSystem subSystem); + + /** + * Save this profile + * @param profile + * @return true if successful + */ + public boolean commit(ISystemProfile profile); + + public ISystemFilterPoolManager restoreFilterPoolManager(ISystemProfile profile, Logger logger, ISystemFilterPoolManagerProvider caller, String name); + + public boolean isExporting(); + public boolean isImporting(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceProvider.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceProvider.java new file mode 100644 index 00000000000..1b7942a854b --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/IRSEPersistenceProvider.java @@ -0,0 +1,55 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.persistence.dom.RSEDOM; + + +/** + * This is the interface that needs to be implemented when providing an extension + * using the RSE persistence provider extension point. + * + * Implement this class to provide a specialized means of + * saving and restoring RSEDOM + * + */ +public interface IRSEPersistenceProvider +{ + /** + * Restores an RSE DOM given a profileName. + * + * @param profileName name of the Profile to load + * @param monitor + * @return the RSE DOM for the specified profile + */ + public RSEDOM loadRSEDOM(String profileName, IProgressMonitor monitor); + + /** + * Persists an RSE DOM. + * + * @param dom the RSE DOM to persist + * @param monitor + * @return true if succcessful + */ + public boolean saveRSEDOM(RSEDOM dom, IProgressMonitor monitor); + + /** + * @return The names of the profiles that have been saved by this persistence provider. + */ + public String[] getSavedProfileNames(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java new file mode 100644 index 00000000000..6ae4210baad --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMConstants.java @@ -0,0 +1,88 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence.dom; + +public interface IRSEDOMConstants +{ + // node types + public static final String TYPE_PROFILE = "Profile"; + public static final String TYPE_PROPERTY_SET = "PropertySet"; + public static final String TYPE_PROPERTY = "Property"; + public static final String TYPE_HOST = "Host"; + public static final String TYPE_FILTER_POOL = "FilterPool"; + public static final String TYPE_FILTER = "Filter"; + public static final String TYPE_FILTER_STRING = "FilterString"; + public static final String TYPE_FILTER_POOL_REFERENCE = "FilterPoolReference"; + public static final String TYPE_CONNECTOR_SERVICE = "ConnectorService"; + public static final String TYPE_SERVER_LAUNCHER = "ServerLauncher"; + public static final String TYPE_SUBSYSTEM = "SubSystem"; + + // node attributes + + // profile attributes + public static final String ATTRIBUTE_DEFAULT_PRIVATE="defaultPrivate"; + public static final String ATTRIBUTE_IS_ACTIVE="isActive"; + + // subsystem attributes + public static final String ATTRIBUTE_HIDDEN="hidden"; + + // common attributes + public static final String ATTRIBUTE_NAME="name"; + public static final String ATTRIBUTE_TYPE="type"; + + // host attributes + public static final String ATTRIBUTE_HOSTNAME = "hostname"; + public static final String ATTRIBUTE_OFFLINE = "offline"; + public static final String ATTRIBUTE_DESCRIPTION = "description"; + + // ConnectorService attributes + public static final String ATTRIBUTE_GROUP="group"; + public static final String ATTRIBUTE_USE_SSL="useSSL"; + + // Filter string attributes + public static final String ATTRIBUTE_STRING = "string"; + + // filter attributes + public static final String ATTRIBUTE_SUPPORTS_NESTED_FILTERS = "supportsNestedFilters"; + public static final String ATTRIBUTE_RELATIVE_ORDER = "relativeOrder"; + public static final String ATTRIBUTE_DEFAULT = "default"; + public static final String ATTRIBUTE_STRING_CASE_SENSITIVE = "stringsCaseSensitive"; + public static final String ATTRIBUTE_PROMPTABLE ="promptable"; + public static final String ATTRIBUTE_SUPPORTS_DUPLICATE_FILTER_STRINGS="supportsDuplicateFilterStrings"; + public static final String ATTRIBUTE_NON_DELETABLE="nonDeletable"; + public static final String ATTRIBUTE_NON_RENAMABLE="nonRenamable"; + public static final String ATTRIBUTE_NON_CHANGEABLE="nonChangable"; + public static final String ATTRIBUTE_STRINGS_NON_CHANGABLE="stringsNonChangable"; + public static final String ATTRIBUTE_RELEASE="release"; + public static final String ATTRIBUTE_SINGLE_FILTER_STRING_ONLY="singleFilterStringOnly"; + + // server launcher attributes + public static final String ATTRIBUTE_REXEC_PORT="rexecPort"; + public static final String ATTRIBUTE_DAEMON_PORT="daemonPort"; + public static final String ATTRIBUTE_PORT="port"; + public static final String ATTRIBUTE_SERVER_PATH="serverPath"; + public static final String ATTRIBUTE_SERVER_SCRIPT="serverScript"; + public static final String ATTRIBUTE_RESTRICTED_TYPES="restrictedTypes"; + + public static final String ATTRIBUTE_VALUE = "value"; + public static final String ATTRIBUTE_ID = "id"; + public static final String ATTRIBUTE_OWNING_PARENT_NAME = "owningParentName"; + public static final String ATTRIBUTE_REF_ID= "refID"; + public static final String ATTRIBUTE_DELETABLE = "deletable"; + public static final String ATTRIBUTE_TRUE = "true"; + public static final String ATTRIBUTE_FALSE = "false"; +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMExporter.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMExporter.java new file mode 100644 index 00000000000..33327052785 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMExporter.java @@ -0,0 +1,130 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence.dom; + + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServerLauncherProperties; +import org.eclipse.rse.core.subsystems.ISubSystem; + + +public interface IRSEDOMExporter +{ + /** + * Creates the RSE DOM for this profile + * @param profile + * @param clean indicates whether to create from scratch or merger + * @return + */ + RSEDOM createRSEDOM(ISystemProfile profile, boolean clean); + + /** + * Creates an RSE DOM for use in persistence + * @param dom + * @param profile + * @return + */ + public RSEDOM populateRSEDOM(RSEDOM dom, ISystemProfile profile, boolean clean); + + /** + * Returns the RSEDOM for this profile iff it exists + * @param profile + * @return + */ + RSEDOM getRSEDOM(ISystemProfile profile); + + /** + * Create a DOM node representing a host + * @param parent + * @param host + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, IHost host, boolean clean); + + /** + * Creates a DOM node for a connector service + * @param parent + * @param connectorService + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, IConnectorService cs, boolean clean); + + /** + * Creates a DOM node for a server launcher + * @param parent + * @param serverLauncher + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, IServerLauncherProperties sl, boolean clean); + + /** + * Creates a DOM node for a subsystem + * @param parent + * @param subSystem + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, ISubSystem ss, boolean clean); + + /** + * Creates a DOM node for a filter + * @param parent + * @param filter + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, ISystemFilter sf, boolean clean); + + /** + * Create a DOM node representing a filter pool + * @param parent + * @param filterPool + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, ISystemFilterPool fp, boolean clean); + + + /** + * Creates a DOM node for a filter pool reference + * @param parent + * @param filterPoolReference + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent , ISystemFilterPoolReference fpr, boolean clean); + + /** + * Creates a DOM node for a filter string + * @param parent + * @param filterString + * @return + */ + RSEDOMNode createNode(RSEDOMNode parent, ISystemFilterString fs, boolean clean); + + + /** + * Creates DOM nodes for each associated property set + * @param parent + * @param modelObject + * @return + */ + RSEDOMNode[] createPropertySetNodes(RSEDOMNode parent, IRSEModelObject mo, boolean clean); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMImporter.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMImporter.java new file mode 100644 index 00000000000..a32344d897f --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/IRSEDOMImporter.java @@ -0,0 +1,78 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence.dom; + + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IPropertySet; +import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemProfileManager; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServerLauncherProperties; +import org.eclipse.rse.core.subsystems.ISubSystem; + + + +public interface IRSEDOMImporter +{ + + /** + * Restores the profile represented by dom + * @param profileManager + * @param dom + * @return the restored profile + */ + ISystemProfile restoreProfile(ISystemProfileManager profileManager, RSEDOM dom); + + /** + * Restores the host represented by hostNode + */ + IHost restoreHost(ISystemProfile profile, RSEDOMNode hostNode); + + /** + * Restore the connector service represented by connectorServiceNode + */ + IConnectorService restoreConnectorService(IHost host, RSEDOMNode connectorServiceNode); + + IServerLauncherProperties restoreServerLauncher(IConnectorService service, RSEDOMNode serverLauncherNode, IServerLauncherProperties slproperties); + + /** + * Restores the subsystem represented by subSystemNode + */ + ISubSystem restoreSubSystem(IHost host, RSEDOMNode subSystemNode); + + + ISystemFilter restoreFilter(ISystemFilterPool filterPool, RSEDOMNode systemFilterNode); + + /** + * Restore the filter pool represented by the node + */ + ISystemFilterPool restoreFilterPool(ISystemProfile profile, RSEDOMNode systemFilterPoolNode); + + ISystemFilterPoolReference restoreFilterPoolReference(ISubSystem subSystem, RSEDOMNode systemFilterPoolReferenceNode); + ISystemFilterString restoreFilterString(ISystemFilter filter, RSEDOMNode systemFilterStringNode); + + /** + * Restores the property set represented by propertySetNode + */ + IPropertySet restorePropertySet(IRSEModelObject modelObject, RSEDOMNode propertySetNode); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOM.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOM.java new file mode 100644 index 00000000000..58e3382163f --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOM.java @@ -0,0 +1,99 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence.dom; + +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.rse.core.model.ISystemProfile; + +/** + * This class is the root node of an RSE DOM. Each + * RSEDOM represents the properties of a profile to persist. + */ +public class RSEDOM extends RSEDOMNode { + + /* + * Recommended for serializable objects. This should be updated if there is a schema change. + */ + private static final long serialVersionUID = 1L; + private Job saveJob = null; + private transient ISystemProfile _profile; + + public RSEDOM(ISystemProfile profile) { + super(null, TYPE_PROFILE, profile.getName()); + _profile = profile; + } + + public RSEDOM(String profileName) { + super(null, TYPE_PROFILE, profileName); + _profile = null; + } + + public ISystemProfile getProfile() { + return _profile; + } + + /** + * Indicate that this DOM needs to be saved + */ + public void markForSave() { + if (!restoring && !_needsSave) { + _needsSave = true; + } + } + + /** + * @return true if this DOM has the DOM changed since last saved or restored. + */ + public boolean needsSave() { + return _needsSave; + } + + public void print(RSEDOMNode node, String indent) { + String type = node.getType(); + String name = node.getName(); + RSEDOMNodeAttribute[] attributes = node.getAttributes(); + RSEDOMNode[] children = node.getChildren(); + + System.out.println(indent + "RSEDOMNode " + type); + System.out.println(indent + "{"); + String sindent = indent + " "; + + System.out.println(sindent + "name=" + name); + for (int i = 0; i < attributes.length; i++) { + RSEDOMNodeAttribute attribute = attributes[i]; + String key = attribute.getKey(); + String value = attribute.getValue(); + System.out.println(sindent + key + "=" + value); + } + + String cindent = sindent + " "; + for (int c = 0; c < children.length; c++) { + RSEDOMNode child = children[c]; + print(child, cindent); + } + System.out.println(indent + "}"); + } + + public Job getSaveJob() { + return saveJob; + } + + public void setSaveJob(Job saveJob) { + this.saveJob = saveJob; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNode.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNode.java new file mode 100644 index 00000000000..c5a0d40ee78 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNode.java @@ -0,0 +1,265 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.persistence.dom; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +public class RSEDOMNode implements IRSEDOMConstants, Serializable +{ + /* + * Recommended for serializable objects. This should be updated if there is a schema change. + */ + private static final long serialVersionUID = 1L; + protected String _type; + protected String _name; + protected RSEDOMNode _parent; + protected List _children; + protected List _attributes; + + protected boolean _needsSave = false; + protected boolean _isDirty = true; + protected boolean restoring = false; + + public RSEDOMNode(RSEDOMNode parent, String type, String name) + { + _type = type; + _name = name; + _parent = parent; + _children = new ArrayList(); + _attributes = new ArrayList(); + if (parent != null) + { + parent.addChild(this); + } + } + + public void markUpdated() + { + if (_needsSave) + { + _needsSave = false; + + for (int i = 0; i < _children.size(); i++) + { + RSEDOMNode child = (RSEDOMNode)_children.get(i); + child.markUpdated(); + } + } + } + + /** + * Propagate needs save indicator up to the root + * @param flag + */ + public void markForSave() + { + if (!restoring && !_needsSave) + { + _needsSave = true; + _parent.markForSave(); + } + } + + /** + * Recursively removes all the children from this node on down + * + */ + public void clearChildren() + { + RSEDOMNode[] children = getChildren(); + for (int i = 0; i < children.length; i++) + { + children[i].clearAttributes(); + children[i].clearChildren(); + } + _children.clear(); + } + + /** + * Clears all attributes + * + */ + public void clearAttributes() + { + _attributes.clear(); + } + + /** + * Returns the name of this node + * @return + */ + public String getName() + { + return _name; + } + + /** + * Returns the type of this node + * @return + */ + public String getType() + { + return _type; + } + + /** + * Returns the parent of this node + * @return + */ + public RSEDOMNode getParent() + { + return _parent; + } + + /** + * Returns all the children of this node + * @return + */ + public RSEDOMNode[] getChildren() + { + return (RSEDOMNode[])_children.toArray(new RSEDOMNode[_children.size()]); + } + + /** + * Returns the first attribute found that has the specified key + * @param key + * @return + */ + public RSEDOMNodeAttribute getAttribute(String key) + { + for (int i = 0; i < _attributes.size(); i++) + { + RSEDOMNodeAttribute attribute = (RSEDOMNodeAttribute)_attributes.get(i); + if (key.equals(attribute.getKey())) + { + return attribute; + } + } + return null; + } + + /** + * Returns the immediate children of this node that are of the specified type + * @param type + * @return + */ + public RSEDOMNode[] getChildren(String type) + { + List results = new ArrayList(); + for (int i = 0; i < _children.size(); i++) + { + RSEDOMNode child = (RSEDOMNode)_children.get(i); + if (type.equals(child.getType())) + { + results.add(child); + } + } + return (RSEDOMNode[])results.toArray(new RSEDOMNode[results.size()]); + } + + /** + * Returns the first immediate child of this node that is of the specified type and name + * @param type + * @param name + * @return + */ + public RSEDOMNode getChild(String type, String name) + { + for (int i = 0; i < _children.size(); i++) + { + RSEDOMNode child = (RSEDOMNode)_children.get(i); + if (type.equals(child.getType()) && name.equals(child.getName())) + { + return child; + } + } + return null; + } + + /** + * Returns all the attributes for this node + * @return + */ + public RSEDOMNodeAttribute [] getAttributes() + { + return (RSEDOMNodeAttribute[])_attributes.toArray(new RSEDOMNodeAttribute[_attributes.size()]); + } + + /** + * Adds a child to this node + * @param child + */ + public void addChild(RSEDOMNode child) + { + _children.add(child); + markForSave(); + } + + /** + * Removes a child from this node + * @param child + */ + public void removeChild(RSEDOMNode child) + { + _children.remove(child); + markForSave(); + } + + + /** + * Adds an attribute to the node + * @param name + * @param value + * @param type + */ + public void addAttribute(String name, String value, String type) + { + RSEDOMNodeAttribute attr = new RSEDOMNodeAttribute(name, value, type); + _attributes.add(attr); + markForSave(); + } + + /** + * Adds an attribute to the node + * @param name + * @param value + */ + public void addAttribute(String name, String value) + { + RSEDOMNodeAttribute attr = new RSEDOMNodeAttribute(name, value); + _attributes.add(attr); + markForSave(); + } + + public boolean isDirty() + { + return _isDirty; + } + + public void setDirty(boolean isDirty) + { + _isDirty = isDirty; + } + + public void setRestoring(boolean restoring) { + this.restoring = restoring; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNodeAttribute.java b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNodeAttribute.java new file mode 100644 index 00000000000..15819a10520 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/persistence/org/eclipse/rse/persistence/dom/RSEDOMNodeAttribute.java @@ -0,0 +1,58 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + + +package org.eclipse.rse.persistence.dom; + +import java.io.Serializable; + +public class RSEDOMNodeAttribute implements Serializable +{ + private static final long serialVersionUID = 1L; + private String _key; + private String _value; + private String _type; + + public RSEDOMNodeAttribute(String key, String value, String type) + { + _key = key; + _value = value; + _type = type; + } + + public RSEDOMNodeAttribute(String key, String value) + { + _key = key; + _value = value; + _type = null; + } + + + public String getKey() + { + return _key; + } + + public String getValue() + { + return _value; + } + + public String getType() + { + return _type; + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/plugin.xml b/rse/plugins/org.eclipse.rse.core/plugin.xml index 239628c2c78..188a193f557 100644 --- a/rse/plugins/org.eclipse.rse.core/plugin.xml +++ b/rse/plugins/org.eclipse.rse.core/plugin.xml @@ -3,4 +3,26 @@ + + + + + + + + + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.core/schema/persistenceProviders.exsd b/rse/plugins/org.eclipse.rse.core/schema/persistenceProviders.exsd new file mode 100644 index 00000000000..253a4c2cfc1 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/schema/persistenceProviders.exsd @@ -0,0 +1,134 @@ + + + + + + + + + This extension point is used to allow the delegation of profile persistence to vendors where needed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a unique name that will be used to identify the persistence Provider. + + + + + + + a translatable name that will be used to identify this persistence Provider in the UI. + + + + + + + a fully qualified name of the Java class that implements the <samp>org.eclipse.rse.persistence.IRSEPersistenceProvider</samp> interface. + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + + The following is an example of this extension point's usage: + +<p> +<pre> + <extension point="org.eclipse.rse.core.persistenceProviders"> + <persistenceProvider + id="org.eclipse.rse.persistence.DefaultRSEpersistenceProvider" + name="Default persistence Provider" + class="org.eclipse.rse.persistence.DefaultRSEpersistenceProvider"> + </persistenceProvider> + </extension> +</pre> +</p> + + + + + + + + + Plug-ins that want to extend this extension point must implement <samp>org.eclipse.rse.persistence.IRSEPersistenceProvider</samp> interface. + + + + + + + + + The Remote Systems Explorer in org.eclipse.rse.core provides a default implementation of this extension point. + + + + + + + + + Copyright (c) 2006 IBM Corporation. All Rights Reserved. +This program and the accompanying materials are made available under the terms +of the Eclipse Public License v1.0 which accompanies this distribution, and is +available at http://www.eclipse.org/legal/epl-v10.html + +Contributors: +IBM Corporation - initial API and implementation + + + + diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 945ece82ee0..859dc4a6708 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -22,8 +22,11 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.rse.core.internal.RSECoreRegistry; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.internal.persistence.RSEPersistenceManager; import org.eclipse.rse.logging.Logger; import org.eclipse.rse.logging.LoggerFactory; +import org.eclipse.rse.persistence.IRSEPersistenceManager; import org.osgi.framework.BundleContext; /** @@ -35,6 +38,24 @@ public class RSECorePlugin extends Plugin { private static RSECorePlugin plugin; private Logger logger = null; + private ISystemRegistry _registry; + private IRSEPersistenceManager _persistenceManager = null; + + public static IRSEPersistenceManager getThePersistenceManager() + { + return getDefault().getPersistenceManager(); + } + /** + * @return the persistence manager used for persisting RSE profiles + */ + public IRSEPersistenceManager getPersistenceManager() + { + if (_persistenceManager == null) + { + _persistenceManager = new RSEPersistenceManager(_registry); + } + return _persistenceManager; + } /** * @return the local machine name */ @@ -67,6 +88,16 @@ public class RSECorePlugin extends Plugin { public RSECorePlugin() { plugin = this; } + + public void setSystemRegistry(ISystemRegistry registry) + { + _registry = registry; + } + + public ISystemRegistry getSystemRegistry() + { + return _registry; + } /* * (non-Javadoc) diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java similarity index 87% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilter.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java index ad0345bad66..4469c410fcb 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilter.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilter.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import java.util.Vector; import org.eclipse.rse.core.model.IRSEModelObject; @@ -72,7 +72,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai String getName(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#getName Name}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getName Name}' attribute. * * * @param value the new value of the 'Name' attribute. @@ -98,7 +98,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai String getType(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#getType Type}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getType Type}' attribute. * * * @param value the new value of the 'Type' attribute. @@ -124,7 +124,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isSupportsNestedFilters(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isSupportsNestedFilters Supports Nested Filters}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSupportsNestedFilters Supports Nested Filters}' attribute. * * * @param value the new value of the 'Supports Nested Filters' attribute. @@ -150,7 +150,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai int getRelativeOrder(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#getRelativeOrder Relative Order}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getRelativeOrder Relative Order}' attribute. * * * @param value the new value of the 'Relative Order' attribute. @@ -176,7 +176,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isDefault(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isDefault Default}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isDefault Default}' attribute. * * * @param value the new value of the 'Default' attribute. @@ -204,7 +204,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isStringsCaseSensitive(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute. * * * @param value the new value of the 'Strings Case Sensitive' attribute. @@ -216,7 +216,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai void setStringsCaseSensitive(boolean value); /** - * Unsets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute. + * Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute. * * * @see #isSetStringsCaseSensitive() @@ -227,7 +227,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai void unsetStringsCaseSensitive(); /** - * Returns whether the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute is set. + * Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsCaseSensitive Strings Case Sensitive}' attribute is set. * * * @return whether the value of the 'Strings Case Sensitive' attribute is set. @@ -255,7 +255,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isPromptable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isPromptable Promptable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isPromptable Promptable}' attribute. * * * @param value the new value of the 'Promptable' attribute. @@ -286,7 +286,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai public boolean supportsDuplicateFilterStrings(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isSupportsDuplicateFilterStrings Supports Duplicate Filter Strings}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSupportsDuplicateFilterStrings Supports Duplicate Filter Strings}' attribute. * * * @param value the new value of the 'Supports Duplicate Filter Strings' attribute. @@ -312,7 +312,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isNonDeletable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isNonDeletable Non Deletable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonDeletable Non Deletable}' attribute. * * * @param value the new value of the 'Non Deletable' attribute. @@ -338,7 +338,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isNonRenamable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isNonRenamable Non Renamable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonRenamable Non Renamable}' attribute. * * * @param value the new value of the 'Non Renamable' attribute. @@ -364,7 +364,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isNonChangable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isNonChangable Non Changable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isNonChangable Non Changable}' attribute. * * * @param value the new value of the 'Non Changable' attribute. @@ -390,7 +390,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isStringsNonChangable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isStringsNonChangable Strings Non Changable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isStringsNonChangable Strings Non Changable}' attribute. * * * @param value the new value of the 'Strings Non Changable' attribute. @@ -416,7 +416,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai int getRelease(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#getRelease Release}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getRelease Release}' attribute. * * * @param value the new value of the 'Release' attribute. @@ -444,7 +444,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai boolean isSingleFilterStringOnly(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute. * * * @param value the new value of the 'Single Filter String Only' attribute. @@ -456,7 +456,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai void setSingleFilterStringOnly(boolean value); /** - * Unsets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute. + * Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute. * * * @see #isSetSingleFilterStringOnly() @@ -467,7 +467,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai void unsetSingleFilterStringOnly(); /** - * Returns whether the value of the '{@link org.eclipse.rse.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute is set. + * Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#isSingleFilterStringOnly Single Filter String Only}' attribute is set. * * * @return whether the value of the 'Single Filter String Only' attribute is set. @@ -480,8 +480,8 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Returns the value of the 'Nested Filters' containment reference list. - * The list contents are of type {@link org.eclipse.rse.filters.ISystemFilter}. - * It is bidirectional and its opposite is '{@link org.eclipse.rse.filters.ISystemFilter#getParentFilter Parent Filter}'. + * The list contents are of type {@link org.eclipse.rse.core.filters.ISystemFilter}. + * It is bidirectional and its opposite is '{@link org.eclipse.rse.core.filters.ISystemFilter#getParentFilter Parent Filter}'. * *

* If the meaning of the 'Nested Filters' containment reference list isn't clear, @@ -490,14 +490,14 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * * @return the value of the 'Nested Filters' containment reference list. * @see org.eclipse.rse.filters.FiltersPackage#getSystemFilter_NestedFilters() - * @see org.eclipse.rse.filters.ISystemFilter#getParentFilter + * @see org.eclipse.rse.core.filters.ISystemFilter#getParentFilter * @generated */ java.util.List getNestedFilters(); /** * Returns the value of the 'Parent Filter' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.rse.filters.ISystemFilter#getNestedFilters Nested Filters}'. + * It is bidirectional and its opposite is '{@link org.eclipse.rse.core.filters.ISystemFilter#getNestedFilters Nested Filters}'. * *

* If the meaning of the 'Parent Filter' container reference isn't clear, @@ -507,14 +507,14 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai * @return the value of the 'Parent Filter' container reference. * @see #setParentFilter(ISystemFilter) * @see org.eclipse.rse.filters.FiltersPackage#getSystemFilter_ParentFilter() - * @see org.eclipse.rse.filters.ISystemFilter#getNestedFilters + * @see org.eclipse.rse.core.filters.ISystemFilter#getNestedFilters * @model opposite="nestedFilters" * @generated */ ISystemFilter getParentFilter(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilter#getParentFilter Parent Filter}' container reference. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilter#getParentFilter Parent Filter}' container reference. * * * @param value the new value of the 'Parent Filter' container reference. @@ -525,7 +525,7 @@ public interface ISystemFilter extends IRSEReferencedObject, ISystemFilterContai /** * Returns the value of the 'Strings' containment reference list. - * The list contents are of type {@link org.eclipse.rse.filters.ISystemFilterString}. + * The list contents are of type {@link org.eclipse.rse.core.filters.ISystemFilterString}. * *

* If the meaning of the 'Strings' containment reference list isn't clear, diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterConstants.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterConstants.java similarity index 97% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterConstants.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterConstants.java index d5477da716a..ac053e31081 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterConstants.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterConstants.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; /** * Constants used throughout filters framework. */ diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainer.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainer.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainer.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainer.java index 8925828d67e..52f177913ef 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainer.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainer.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; // import java.util.Vector; diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainerReference.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainerReference.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainerReference.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainerReference.java index b5a0b8cdbe3..b35e8fb7e92 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterContainerReference.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterContainerReference.java @@ -14,10 +14,11 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.rse.core.subsystems.ISubSystem; + /** * Both SystemFilter and SystemFilterPool contain filters, so the * common methods for filters are abstracted out in SystemFilterContainer, diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPool.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java similarity index 91% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPool.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java index 423220c5289..8751c6c7741 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPool.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPool.java @@ -14,8 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; -import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy; +package org.eclipse.rse.core.filters; import org.eclipse.rse.core.model.IRSEModelObject; import org.eclipse.rse.core.references.IRSEPersistableReferencedObject; @@ -255,7 +254,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys boolean isSingleFilterStringOnly(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. * * * @param value the new value of the 'Single Filter String Only' attribute. @@ -267,7 +266,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys void setSingleFilterStringOnly(boolean value); /** - * Unsets the value of the '{@link org.eclipse.rse.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. + * Unsets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute. * * * @see #isSetSingleFilterStringOnly() @@ -278,7 +277,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys void unsetSingleFilterStringOnly(); /** - * Returns whether the value of the '{@link org.eclipse.rse.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute is set. + * Returns whether the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isSingleFilterStringOnly Single Filter String Only}' attribute is set. * * * @return whether the value of the 'Single Filter String Only' attribute is set. @@ -306,7 +305,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys String getOwningParentName(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilterPool#getOwningParentName Owning Parent Name}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#getOwningParentName Owning Parent Name}' attribute. * * * @param value the new value of the 'Owning Parent Name' attribute. @@ -332,7 +331,7 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys boolean isNonRenamable(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilterPool#isNonRenamable Non Renamable}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPool#isNonRenamable Non Renamable}' attribute. * * * @param value the new value of the 'Non Renamable' attribute. @@ -341,4 +340,9 @@ public interface ISystemFilterPool extends IRSEPersistableReferencedObject, ISys */ void setNonRenamable(boolean value); + public ISystemFilterPool createSystemFilterPool( + String name, + boolean allowNestedFilters, + boolean isDeletable, + boolean tryToRestore); } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManager.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManager.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManager.java index 906f6d5fd07..617c2da5622 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManager.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManager.java @@ -14,11 +14,11 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import java.util.Vector; +import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.persistance.IRSEPersistableContainer; -import org.eclipse.rse.model.ISystemProfile; @@ -622,7 +622,7 @@ public interface ISystemFilterPoolManager extends IRSEPersistableContainer boolean isSingleFilterStringOnly(); /** - * Sets the value of the '{@link org.eclipse.rse.filters.ISystemFilterPoolManager#isSingleFilterStringOnly Single Filter String Only}' attribute. + * Sets the value of the '{@link org.eclipse.rse.core.filters.ISystemFilterPoolManager#isSingleFilterStringOnly Single Filter String Only}' attribute. * * * @param value the new value of the 'Single Filter String Only' attribute. diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManagerProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManagerProvider.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManagerProvider.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManagerProvider.java index 24847141973..75687b87f89 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolManagerProvider.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolManagerProvider.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.core.runtime.IAdaptable; /** diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReference.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReference.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReference.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReference.java index 420c41922ce..88b071fb51f 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReference.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReference.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.rse.core.model.IRSEModelObject; import org.eclipse.rse.core.references.IRSEPersistableReferencingObject; diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManager.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManager.java index 44439a66f62..852a9ec1410 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManager.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import java.util.Vector; diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManagerProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManagerProvider.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManagerProvider.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManagerProvider.java index ab53e8b9787..4c99e41e31a 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManagerProvider.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolReferenceManagerProvider.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; /** * An interface for classes that instantiate SystemFilterPoolReferenceManager objects. * This is the "caller" and as is recorded and recoverable from any object within diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolSelectionValidator.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolSelectionValidator.java similarity index 97% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolSelectionValidator.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolSelectionValidator.java index 4ca0e68520d..07c78d228d3 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolSelectionValidator.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolSelectionValidator.java @@ -14,7 +14,8 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; + import org.eclipse.rse.services.clientserver.messages.SystemMessage; /** diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapper.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapper.java similarity index 97% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapper.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapper.java index 1b123842e82..0129a744847 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapper.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapper.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; /** * The system filter wizard allows callers to pass a list of wrapper objects * for the user to select a filter pool diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapperInformation.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapperInformation.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapperInformation.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapperInformation.java index d450dad2648..f0cdf3983bb 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolWrapperInformation.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterPoolWrapperInformation.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; /** * The system filter wizard allows callers to pass a list of wrapper objects * for the user to select a filter pool. Effectively, this prompting for diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterReference.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterReference.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterReference.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterReference.java index ce0f108a03b..57638d11648 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterReference.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterReference.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.rse.core.model.ISystemContainer; import org.eclipse.rse.core.model.ISystemContentsType; import org.eclipse.rse.core.references.IRSEReferencingObject; diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterSavePolicies.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterSavePolicies.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterSavePolicies.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterSavePolicies.java index 87c215218ca..60c8e14399b 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterSavePolicies.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterSavePolicies.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; /** * A save policy dictates how filter framework artifacts are persisted to disk. */ diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStartHere.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStartHere.java new file mode 100644 index 00000000000..7f710c37f2c --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStartHere.java @@ -0,0 +1,57 @@ +package org.eclipse.rse.core.filters; + +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.logging.Logger; + +public interface ISystemFilterStartHere { + + /** + * Factory method to return an instance populated with defaults. + * You can then simply override whatever is desired via setXXX methods. + */ + public IRSEFilterNamingPolicy createSystemFilterNamingPolicy(); + + + /** + * Factory to create a filter pool manager, when you do NOT want it to worry about + * saving and restoring the filter data to disk. Rather, you will save and restore + * yourself. + * @param logger A logging object into which to log errors as they happen in the framework + * @param caller Objects which instantiate this class should implement the + * SystemFilterPoolManagerProvider interface, and pass "this" for this parameter. + * Given any filter framework object, it is possible to retrieve the caller's + * object via the getProvider method call. + * @param name the name of the filter pool manager. Not currently used but you may + * find a use for it. + * @param allowNestedFilters true if filters inside filter pools in this manager are + * to allow nested filters. This is the default, but can be overridden at the + * individual filter pool level. + */ + public ISystemFilterPoolManager + createSystemFilterPoolManager(ISystemProfile profile, + Logger logger, + ISystemFilterPoolManagerProvider caller, + String name, + boolean allowNestedFilters); + + + + /** + * Create a SystemFilterPoolReferenceManager instance, when you do NOT want it + * to be saved and restored to its own file. Rather, you will save and restore it + * yourself. + * @param caller Objects which instantiate this class should implement the + * SystemFilterPoolReferenceManagerProvider interface, and pass "this" for this parameter. + * Given any filter framework object, it is possible to retrieve the caller's + * object via the getProvider method call. + * @param relatedPoolManagers The managers that own the master list of filter pools that + * this manager will contain references to. + * @param name the name of the filter pool reference manager. This is not currently + * used, but you may find a use for it. + * @param namingPolicy the naming policy object which will return the name of that one file. + */ + public ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager( + ISystemFilterPoolReferenceManagerProvider caller, + ISystemFilterPoolManagerProvider relatedPoolMgrProvider, + String name, IRSEFilterNamingPolicy namingPolicy); +} diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterString.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterString.java similarity index 99% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterString.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterString.java index 03b6a9a5f0d..25272c163e5 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterString.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterString.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.rse.core.model.IRSEModelObject; diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterStringReference.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStringReference.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterStringReference.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStringReference.java index ab659a71cbd..505692b591e 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterStringReference.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/ISystemFilterStringReference.java @@ -14,7 +14,7 @@ * {Name} (company) - description of contribution. ********************************************************************************/ -package org.eclipse.rse.filters; +package org.eclipse.rse.core.filters; import org.eclipse.rse.core.references.IRSEBaseReferencingObject; /** diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterNamingPolicy.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterNamingPolicy.java new file mode 100644 index 00000000000..2f18505863d --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterNamingPolicy.java @@ -0,0 +1,148 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.filters; +/** + * A naming policy so tool writers can override defaults used when + * saving filter data to disk. + *

+ * Subclass this and override what you wish to change. + */ +public class SystemFilterNamingPolicy implements IRSEFilterNamingPolicy, ISystemFilterConstants +{ + + protected String managerFileNamePrefix, poolFolderNamePrefix, poolFolderNameSuffix, + poolFileNamePrefix, filterFileNamePrefix, + referenceManagerFileNamePrefix; + /** + * Default prefix for filter pool manager persisted file: "filterPools_" + */ + public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOLMANAGER = "filterPools_"; + /** + * Default prefix for filter pool reference manager persisted file: "filterPoolRefs_" + */ + public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOLREFERENCEMANAGER = "filterPoolRefs_"; + /** + * Default prefix for filter pool persisted file: "filterPool_" + */ + public static final String DEFAULT_FILENAME_PREFIX_FILTERPOOL = "filterPool_"; + /** + * Default prefix for filter persisted file: "filter_" + */ + public static final String DEFAULT_FILENAME_PREFIX_FILTER = "filter_"; + /** + * Default prefix for filter pool folder: "FilterPool_" + */ + public static final String DEFAULT_FOLDERNAME_PREFIX_FILTERPOOL = "FilterPool_"; + + + /** + * Factory method to return an instance populated with defaults. + * Can then simply override whatever is desired. + */ + public static IRSEFilterNamingPolicy getNamingPolicy() + { + return new SystemFilterNamingPolicy(); + } + + /** + * Constructor for SystemFilterNamingPolicyImpl + */ + public SystemFilterNamingPolicy() + { + super(); + } + + /** + * Get the unqualified save file name for the given SystemFilterPoolManager object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns "filterPools_"+managerName by default. + */ + public String getManagerSaveFileName(String managerName) + { + return DEFAULT_FILENAME_PREFIX_FILTERPOOLMANAGER+managerName; + } + /** + * Get the unqualified save file name for the given SystemFilterPoolReferenceManager object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns "filterPoolRefs_"+managerName by default. + */ + public String getReferenceManagerSaveFileName(String managerName) + { + return DEFAULT_FILENAME_PREFIX_FILTERPOOLREFERENCEMANAGER+managerName; + } + /** + * Get the unqualified save file name for the given SystemFilterPool object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns getFilterPoolSaveFileNamePrefix()+poolName by default. + */ + public String getFilterPoolSaveFileName(String poolName) + { + return getFilterPoolSaveFileNamePrefix()+poolName; + } + /** + * Get the file name prefix for all pool files. + * Used to deduce the saved pools by examining the file system + *

+ * By default returns "filterPool_" + */ + public String getFilterPoolSaveFileNamePrefix() + { + return DEFAULT_FILENAME_PREFIX_FILTERPOOL; + } + /** + * Get the folder name for the given SystemFilterPool object. + *

+ * Returns getFilterPoolFolderNamePrefix()+poolName by default. + */ + public String getFilterPoolFolderName(String poolName) + { + return getFilterPoolFolderNamePrefix()+poolName; + } + /** + * Get the folder name prefix for all pool folders. + * Used to deduce the saved pools by examining the file system + *

+ * By default returns "FilterPool_" + */ + public String getFilterPoolFolderNamePrefix() + { + return DEFAULT_FOLDERNAME_PREFIX_FILTERPOOL; + } + /** + * Get the unqualified save file name for the given SystemFilter object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns getFilterSaveFileNamePrefix()+filterName by default. + */ + public String getFilterSaveFileName(String filterName) + { + return getFilterSaveFileNamePrefix()+filterName; + } + /** + * Get the file name prefix for all filter files. + * Used to deduce the saved filters by examining the file system + *

+ * Returns "Filter_" by default. + */ + public String getFilterSaveFileNamePrefix() + { + return DEFAULT_FILENAME_PREFIX_FILTER; + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterPoolManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterPoolManager.java new file mode 100644 index 00000000000..e5c53cd4e0f --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/filters/SystemFilterPoolManager.java @@ -0,0 +1,1962 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.filters; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Vector; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.references.IRSEBaseReferencingObject; +import org.eclipse.rse.logging.Logger; +import org.eclipse.rse.persistence.IRSEPersistenceManager; + + +// +// + +/** + * A filter pool manager manages filter pools. + *

+ * Each filter pool that is managed becomes a folder on disk. + *

+ * To create a filter pool manager instance, use the factory method + * in SystemFilterPoolManagerImpl in the ...impl package. + * You must pass a folder that represents the anchor point for the + * pools managed by this manager instance. + *

+ * Depending on your tools' needs, you have four choices about how + * the filter pools and filters are persisted to disk. The decision is + * made at the time you instantiate the pool manager and is one of the + * following constants from the SystemFilterConstants interface: + *

    + *
  • SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi + *
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool + *
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder + *
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool + *
+ *

+ * With the policy of one file per pool, there are two possibilities regarding + * the folder structure: + *

    + *
  • Each pool gets its own subfolder, and the pool's xmi file goes in + * the pool's unique subfolder: SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL + *
  • There are no subfolders per pool, all the xmi pool files go in the + * same folder as specified when creating this manager instance: + * SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER + *
+ *

+ * With the policy of one file per filter, each filter pool must have its own folder. + *

+ * With an instantiated filter pool manager (most tools will only need + * one such instance), you now simply call its methods to work with + * filter pools. For example, use it to: + *

    + *
  • Restore all filter pools from disk + *
  • Save all, or individual, filter pools to disk + *
  • Get a list of existing filter pools + *
  • Create filter pools + *
  • Delete filter pools + *
  • Clone filter pools + *
  • Rename filter pools + *
  • Save all, or individual, filter pools + *
+ * All the underlying file system work is handled for you. + *

+ * Further, this is the front door for working with filters too. By forcing all + * filter related activity through a single point like this, we can ensure that + * all changes are saved to disk, and events are fired properly. + *

+ * The filter framework logs to a {@link org.eclipse.rse.logging.Logger Logger} file. + * By default the log in the org.eclipse.rse.core plugin is used, but you can change this + * by calling {@link #setLogger(org.eclipse.rse.logging.Logger)}. + */ +/** + * @lastgen class SystemFilterPoolManagerImpl Impl implements SystemFilterPoolManager {} + */ +public class SystemFilterPoolManager implements ISystemFilterPoolManager +{ + private ISystemFilterPool[] poolArray = null; // cache for performance + private ISystemFilterPoolManagerProvider caller = null; + private Object poolMgrData; + private Vector poolNames; + private boolean initialized = false; + + private boolean suspendCallbacks = false; + private boolean suspendSave = false; + private Logger logger = null; + private ISystemProfile _profile; + + // persistence + protected boolean _isDirty = true; + private boolean _wasRestored = false; + + public static boolean debug = true; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + + protected String name = NAME_EDEFAULT; + /** + * The default value of the '{@link #isSupportsNestedFilters() Supports Nested Filters}' attribute. + * + * + * @see #isSupportsNestedFilters() + * @generated + * @ordered + */ + protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean supportsNestedFilters = SUPPORTS_NESTED_FILTERS_EDEFAULT; + /** + * The default value of the '{@link #isStringsCaseSensitive() Strings Case Sensitive}' attribute. + * + * + * @see #isStringsCaseSensitive() + * @generated + * @ordered + */ + protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean stringsCaseSensitive = STRINGS_CASE_SENSITIVE_EDEFAULT; + /** + * The default value of the '{@link #isSupportsDuplicateFilterStrings() Supports Duplicate Filter Strings}' attribute. + * + * + * @see #isSupportsDuplicateFilterStrings() + * @generated + * @ordered + */ + protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean supportsDuplicateFilterStrings = SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT; + /** + * This is true if the Supports Duplicate Filter Strings attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean supportsDuplicateFilterStringsESet = false; + + /** + * The default value of the '{@link #isSingleFilterStringOnly() Single Filter String Only}' attribute. + * + * + * @see #isSingleFilterStringOnly() + * @generated + * @ordered + */ + protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT = false; + + /** + * The cached value of the '{@link #isSingleFilterStringOnly() Single Filter String Only}' attribute. + * + * + * @see #isSingleFilterStringOnly() + * @generated + * @ordered + */ + protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected java.util.List pools = null; + + + /** + * Constructor + */ + protected SystemFilterPoolManager(ISystemProfile profile) + { + super(); + _profile = profile; + } + + public ISystemProfile getSystemProfile() + { + return _profile; + } + + /** + * Factory to create a filter pool manager. + * @param logger A logging object into which to log errors as they happen in the framework + * @param caller Objects which instantiate this class should implement the + * SystemFilterPoolManagerProvider interface, and pass "this" for this parameter. + * Given any filter framework object, it is possible to retrieve the caller's + * object via the getProvider method call. + * @param mgrFolder the folder that will be the manager folder. This is + * the parent of the filter pool folders the manager folder will hold, or the single + * xmi file for the save policy of one file per manager. This folder will be created + * if it does not already exist. + * @param name the name of the filter pool manager. Typically this is also the name + * of the given folder, but this is not required. For the save policy of one file + * per manager, the name of the file is derived from this. For other save policies, + * the name is not used. + * @param allowNestedFilters true if filters inside filter pools in this manager are + * to allow nested filters. This is the default, but can be overridden at the + * individual filter pool level. + * @param savePolicy The save policy for the filter pools and filters. One of the + * following constants from the + * {@link org.eclipse.rse.core.filters.ISystemFilterConstants SystemFilterConstants} interface: + *

    + *
  • SAVE_POLICY_NONE - no files, all save/restore handled elsewhere + *
  • SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi + *
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool + *
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder + *
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool + *
+ * @param namingPolicy The names to use for file and folders when persisting to disk. Pass + * null to just use the defaults, or if using SAVE_POLICY_NONE. + */ + public static ISystemFilterPoolManager + createSystemFilterPoolManager(ISystemProfile profile, Logger logger, + ISystemFilterPoolManagerProvider caller, + String name, + boolean allowNestedFilters, + int savePolicy, IRSEFilterNamingPolicy namingPolicy) + { + + SystemFilterPoolManager mgr = null; + if (namingPolicy == null) + namingPolicy = SystemFilterNamingPolicy.getNamingPolicy(); + try + { + mgr = (SystemFilterPoolManager)RSECorePlugin.getThePersistenceManager().restoreFilterPoolManager(profile, logger, caller, name); + /* + if (savePolicy != SystemFilterConstants.SAVE_POLICY_NONE) + mgr = (SystemFilterPoolManagerImpl)restore(; + */ + } + catch (Exception exc) // real error trying to restore, versus simply not found. + { + // todo: something. Log the exception somewhere? + } + if (mgr == null) // not found or some serious error. + { + mgr = createManager(profile); + } + if (mgr != null) + { + mgr.initialize(logger, caller, name, allowNestedFilters); + } + return mgr; + } + + /* + * Private helper method. + * Uses MOF to create an instance of this class. + */ + public static SystemFilterPoolManager createManager(ISystemProfile profile) + { + ISystemFilterPoolManager mgr = new SystemFilterPoolManager(profile); + + //FIXME SystemFilterImpl.initMOF().createSystemFilterPoolManager(); + return (SystemFilterPoolManager)mgr; + } + + /* + * Private helper method to initialize state + */ + public void initialize(Logger logger, ISystemFilterPoolManagerProvider caller, String name, + boolean allowNestedFilters) + { + if (!initialized) + initialize(logger, caller, name); // core data + + { + java.util.List pools = getPools(); + ISystemFilterPool pool = null; + Vector poolNames = getSystemFilterPoolNamesVector(); + for (int idx=0; idx + * + * @generated + */ + public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings) + { + supportsDuplicateFilterStrings = newSupportsDuplicateFilterStrings; + supportsDuplicateFilterStringsESet = true; + } + + /** + * + * + * @generated + */ + public boolean isStringsCaseSensitive() + { + return stringsCaseSensitive; + } + + /** + * Same as isStringsCaseSensitive() + * Are filter strings in this filter case sensitive? + * @return The value of the StringsCaseSensitive attribute + */ + public boolean areStringsCaseSensitive() + { + return isStringsCaseSensitive(); + } + /** + * Set attribute indicating if filters managed by this manager support case-sensitive filter strings, by default. + * Cascaded down to all pools, and all filters in all pools. + * Alternatively, just call it on the particular pool or filter it applies to. + */ + public void setStringsCaseSensitive(boolean newStringsCaseSensitive) + { + // as generated by emf... + setStringsCaseSensitiveGen(newStringsCaseSensitive); + // our special code... + ISystemFilterPool[] pools = getSystemFilterPools(); + for (int idx=0; idx + * + * @generated + */ + public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive) + { + stringsCaseSensitive = newStringsCaseSensitive; + } + + /** + * Set transient variable pointing back to us. Called after restoring. + * Cascaded down to all pools, and all filters in all pools. + */ + protected void setFilterPoolManager() + { + ISystemFilterPool[] pools = getSystemFilterPools(); + for (int idx=0; idx + * Does the following: + *
    + *
  • Removes all references + *
  • Removes pool object from in-memory model + *
  • Removes folder from disk for policies of one folder per pool + *
  • Removes file from disk for policy of one file per pool + *
  • Saves model to disk for policy of one file per manager + *
  • Invalidates in-memory caches + *
  • Calls back to inform caller of this event + *
+ * @param pool The filter pool object to physically delete + */ + public void deleteSystemFilterPool(ISystemFilterPool pool) + throws Exception + { + + + + // remove all references + IRSEBaseReferencingObject[] refs = pool.getReferencingObjects(); + //boolean needsSave = false; + if (refs != null) + { + for (int idx=0; idx < refs.length; idx++) + { + if (refs[idx] instanceof ISystemFilterPoolReference) + { + ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference)refs[idx]; + ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager(); + if (fprMgr != null) + fprMgr.removeSystemFilterPoolReference(fpRef,false);// false means don't dereference + } + } + } + // DWD removing a pool should mark its parent profile as dirty and cause a save to be "scheduled" + + // remove from model + java.util.List pools = getPools(); + pools.remove(pool); + + /* FIXME + // now in EMF, the pools are "owned" by the Resource, and only referenced by this pool manager, + // so I don't think just removing it from the manager is enough... it must also be removed from its + // resource. Phil. + Resource res = pool.eResource(); + if (res != null) + res.getContents().remove(pool); + + // remove from disk + if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) || + (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER) ) + { + String expectedFolderName = derivePoolFolderName(poolName); + if (expectedFolderName.equals(poolFolder.getName())) + { + // folder name equals what we would have named it if left to us. + // assumption is this folder only exists to hold this pool! + if (poolFolder.exists()) + getResourceHelpers().deleteResource(poolFolder); + } + } + else if (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER) + { + String poolFileName = SystemFilterPoolImpl.getSaveFileName(getMOFHelpers(),pool); + IFile poolFile = SystemResourceHelpers.getResourceHelpers().getFile(poolFolder,poolFileName); + if (poolFile.exists()) + getResourceHelpers().deleteResource(poolFile); + } + else // all pools in one file per manager. Just save it + { + commit(); + } + invalidatePoolCache(); + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterPoolDeleted(pool); + */ + } + + /** + * Delete all existing filter pools. Call this when you are about to delete this manager, say. + */ + public void deleteAllSystemFilterPools() + { + ISystemFilterPool[] allPools = getSystemFilterPools(); + for (int idx=0; idx + * Does the following: + *
    + *
  • Updates all referencing objects + *
  • Renames pool object in the in-memory model + *
  • Renames folder on disk for policies of one folder per pool + *
  • Renames file on disk for policy of one file per pool + *
  • Saves model to disk for policy of one file per manager + *
  • Invalidates in-memory caches + *
  • Calls back to provider to inform of this event. + *
+ * @param pool The filter pool object to physically rename + * @param newName The new name to give the pool + */ + public void renameSystemFilterPool(ISystemFilterPool pool, String newName) + throws Exception + { + /* + * DWD Renaming a filter pool should mark its parent profile as dirty and + * the pool itself as dirty. A rewrite of the profile should be scheduled. + */ + + String oldName = pool.getName(); + // rename on disk + /* FIXME + int oldLen = oldName.length(); + int newLen = newName.length(); + if ( (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL) || + (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER) ) + { + String expectedFolderName = derivePoolFolderName(pool.getName()); + boolean ourFolderName = expectedFolderName.equals(pool.getFolder().getName()); + // we must rename the old file... + String poolFileName = SystemFilterPoolImpl.getSaveFileName(getMOFHelpers(),pool); + String poolFileNewName = SystemFilterPoolImpl.getSaveFileName(getMOFHelpers(),pool,newName); + IFile poolFile = getResourceHelpers().getFile(pool.getFolder(),poolFileName); + IFolder poolFolder = pool.getFolder(); + + // first, pre-test for file-in-use error: + boolean inUse = poolFile.exists() && SystemResourceHelpers.testIfResourceInUse(poolFile); + if (inUse) + { + SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FILE_INUSE); + msg.makeSubstitution(poolFile.getFullPath()); + throw new SystemMessageException(msg); + } + // next, pre-test for folder-in-use error: + if (ourFolderName) + { + inUse = poolFolder.exists() && SystemResourceHelpers.testIfResourceInUse(poolFolder); + if (inUse) + { + SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_INUSE); + msg.makeSubstitution(poolFolder.getFullPath()); + throw new SystemMessageException(msg); + } + } + + if (poolFile.exists()) + { + // pre-test if the new name will be too long for MOF (256) + if (nameLenDiff > 0) + { + if (ourFolderName) + nameLenDiff *= 2; // new name affects folder and file + int newNameLen = poolFile.getLocation().toOSString().length() + nameLenDiff; + if (newNameLen > 256) + throw new Exception("Fully qualified filter pool name too long for "+newName+". Exceeds 256 characters"); + } + getResourceHelpers().renameResource(poolFile, poolFileNewName); + } + if (ourFolderName) + { + // folder name equals what we would have named it if left to us. + // assumption is this folder only exists to hold this pool! + if (poolFolder.exists()) + { + String newFolderName = derivePoolFolderName(newName); + getResourceHelpers().renameResource(poolFolder, newFolderName); + // as we now know, the original IFolder still points to the old name! + poolFolder = getResourceHelpers().getRenamedFolder(poolFolder, newFolderName); + pool.setFolder(poolFolder); + } + } + } + else if (savePolicy == SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER) + { + String poolFileName = SystemFilterPoolImpl.getSaveFileName(getMOFHelpers(),pool); + IFile poolFile = getResourceHelpers().getFile(pool.getFolder(),poolFileName); + // first, pre-test for file-in-use error: + boolean inUse = poolFile.exists() && SystemResourceHelpers.testIfResourceInUse(poolFile); + if (inUse) + { + SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FILE_INUSE); + msg.makeSubstitution(poolFile.getFullPath()); + throw new SystemMessageException(msg); + } + if (poolFile.exists()) + { + String poolFileNewName = SystemFilterPoolImpl.getSaveFileName(getMOFHelpers(),pool,newName); + getResourceHelpers().renameResource(poolFile, poolFileNewName); + } + } + */ + pool.setName(newName); + invalidatePoolCache(); + + // inform all referencees + IRSEBaseReferencingObject[] refs = pool.getReferencingObjects(); + if (refs != null) + { + for (int idx=0; idx < refs.length; idx++) + { + IRSEBaseReferencingObject ref = refs[idx]; + if (ref instanceof ISystemFilterPoolReference) + { + ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference)ref; + ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager(); + fprMgr.renameReferenceToSystemFilterPool(pool); + } + } + } + + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterPoolRenamed(pool,oldName); + } + + /** + * Copy the specified filter pool from this manager to this manager or another manager. + *

+ * Does the following: + *

    + *
  • Clones all filters within the pool + *
  • Clones all filter strings within each filter + *
  • Asks target manager to save to disk + *
  • Calls back to target manager provider, unless callbacks are suspended + *
+ * @param targetMgr The target manager to copy our filter pool to. Can be this manager, but target pool name must be unique. + * @param oldPool The filter pool to copy + * @param newName The new name to give the copied pool + * @return the new copy + */ + public ISystemFilterPool copySystemFilterPool(ISystemFilterPoolManager targetMgr, ISystemFilterPool oldPool, String newName) + throws Exception + { + ISystemFilterPool newPool = targetMgr.createSystemFilterPool(newName, oldPool.isDeletable()); + //System.out.println("In SystemFilterPoolManagerImpl#copySystemFilterPool: newPool "+newName+" null? " + (newPool == null)); + oldPool.cloneSystemFilterPool(newPool); + commit(newPool); // save it all to disk + return newPool; + } + + /** + * Move the specified filter pool from this manager to another manager. + *

+ * Does the following: + *

    + *
  • Performs a {@link #copySystemFilterPool(ISystemFilterPoolManager, ISystemFilterPool, String) copySystemFilterPool} operation. + *
  • If copy is successful, updates all references to reference the new copy. + *
  • If copy is successful, deletes original filter pool in this manager + *
  • If this final delete fails, deletes the copied version and restore original references + *
  • Asks target manager to save to disk + *
  • Saves this manager to disk + *
  • Calls back to both targer manager provider and this manager provider, unless callbacks are suspended + *
+ * @param targetMgr The target manager to move our filter pool to. Cannot be this manager. + * @param oldPool The filter pool to move + * @param newName The new name to give the moved pool + * @return the new copy of the moved system filter pool + */ + public ISystemFilterPool moveSystemFilterPool(ISystemFilterPoolManager targetMgr, ISystemFilterPool oldPool, String newName) + throws Exception + { + ISystemFilterPool newPool = copySystemFilterPool(targetMgr, oldPool, newName); + // find all references to original, and reset them to reference the new... + IRSEBaseReferencingObject[] refs = oldPool.getReferencingObjects(); + if (refs != null) + { + for (int idx=0; idx < refs.length; idx++) + { + if (refs[idx] instanceof ISystemFilterPoolReference) + { + ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference)refs[idx]; + //SystemFilterPool fp = fpRef.getReferencedFilterPool(); + ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager(); + fprMgr.resetSystemFilterPoolReference(fpRef, newPool); // reset the referenced pool + } + } + } + try + { + deleteSystemFilterPool(oldPool); + } + catch (Exception exc) + { + if (refs != null) + { + for (int idx=0; idx < refs.length; idx++) + { + if (refs[idx] instanceof ISystemFilterPoolReference) + { + ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference)refs[idx]; + ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager(); + fprMgr.resetSystemFilterPoolReference(fpRef, oldPool); // reset the referenced pool + } + } + } + targetMgr.deleteSystemFilterPool(newPool); + throw exc; + } + return newPool; + } + + /** + * Copy all filter pools from this manager to another manager. + *

+ * Does the following: + *

    + *
  • Clones all filter pools + *
  • Clones all filters within each pool + *
  • Clones all filter strings within each filter + *
  • Asks target manager to save to disk + *
  • Does not callback to caller to fire events, assumes caller doesn't want to know + *
+ * @param targetMgr The target manager to copy our filter pools to + */ + public void copySystemFilterPools(ISystemFilterPoolManager targetMgr) + throws Exception + { + targetMgr.setStringsCaseSensitive(areStringsCaseSensitive()); + ISystemFilterPool[] pools = getSystemFilterPools(); + if ((pools!=null) && (pools.length>0)) + { + targetMgr.suspendCallbacks(true); + //boolean oldSuspendCallbacks = suspendCallbacks; + for (int idx=0;idxCalls back to inform provider of this event (filterEventFilterCreated) + * @param parent The parent which is either a SystemFilterPool or a SystemFilter + * @param aliasName The name to give the new filter. Must be unique for this pool. + * @param filterStrings The list of String objects that represent the filter strings. + */ + public ISystemFilter createSystemFilter(ISystemFilterContainer parent, + String aliasName, Vector filterStrings) + throws Exception + { + ISystemFilter newFilter = null; + ISystemFilterPool parentPool = null; + if (parent instanceof ISystemFilterPool) + parentPool = (ISystemFilterPool)parent; + else + parentPool = ((ISystemFilter)parent).getParentFilterPool(); + newFilter = parent.createSystemFilter(aliasName,filterStrings); + if (!suspendSave) + commit(parentPool); + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterCreated(newFilter); + return newFilter; + } + /** + * Creates a new system filter that is typed. + * Same as {@link #createSystemFilter(ISystemFilterContainer, String, Vector)} but + * takes a filter type as an additional parameter. + *

+ * A filter's type is an arbitrary string that is not interpreted or used by the base framework. This + * is for use entirely by tools who wish to support multiple types of filters and be able to launch unique + * actions per type, say. + * + * @param parent The parent which is either a SystemFilterPool or a SystemFilter + * @param aliasName The name to give the new filter. Must be unique for this pool. + * @param filterStrings The list of String objects that represent the filter strings. + * @param type The type of this filter + */ + public ISystemFilter createSystemFilter(ISystemFilterContainer parent, + String aliasName, Vector filterStrings, String type) + throws Exception + { + boolean oldSuspendSave = suspendSave; + boolean oldSuspendCallbacks = suspendCallbacks; + suspendSave = true; + suspendCallbacks = true; + + ISystemFilter newFilter = createSystemFilter(parent, aliasName, filterStrings); + newFilter.setType(type); + + suspendSave = oldSuspendSave; + suspendCallbacks = oldSuspendCallbacks; + + if (!suspendSave) + { + ISystemFilterPool parentPool = null; + if (parent instanceof ISystemFilterPool) + parentPool = (ISystemFilterPool)parent; + else + parentPool = ((ISystemFilter)parent).getParentFilterPool(); + commit(parentPool); + } + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterCreated(newFilter); + return newFilter; + } + /** + * Creates a new system filter that is typed and promptable + * Same as {@link #createSystemFilter(ISystemFilterContainer, String ,Vector, String)} but + * takes a boolean indicating if it is promptable. + *

+ * A promptable filter is one in which the user is prompted for information at expand time. + * There is no base filter framework support for this, but tools can query this attribute and + * do their own thing at expand time. + * + * @param parent The parent which is either a SystemFilterPool or a SystemFilter + * @param aliasName The name to give the new filter. Must be unique for this pool. + * @param filterStrings The list of String objects that represent the filter strings. + * @param type The type of this filter + * @param promptable Pass true if this is a promptable filter + */ + public ISystemFilter createSystemFilter(ISystemFilterContainer parent, + String aliasName, Vector filterStrings, String type, boolean promptable) + throws Exception + { + boolean oldSuspendSave = suspendSave; + boolean oldSuspendCallbacks = suspendCallbacks; + suspendSave = true; + suspendCallbacks = true; + + ISystemFilter newFilter = createSystemFilter(parent, aliasName, filterStrings, type); + newFilter.setPromptable(promptable); + + suspendSave = oldSuspendSave; + suspendCallbacks = oldSuspendCallbacks; + + if (!suspendSave) + { + ISystemFilterPool parentPool = null; + if (parent instanceof ISystemFilterPool) + parentPool = (ISystemFilterPool)parent; + else + parentPool = ((ISystemFilter)parent).getParentFilterPool(); + commit(parentPool); + } + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterCreated(newFilter); + return newFilter; + } + + /** + * Delete an existing system filter. + * Does the following: + *

    + *
  • Removes filter from its parent in memory. + *
  • If appropriate for the save policy, deletes the filter's file from disk. + *
  • Save the SystemFilterPool which direct or indirectly contains the filter. + *
  • Calls back to provider to inform it of this event (filterEventFilterDeleted) + *
+ */ + public boolean deleteSystemFilter(ISystemFilter filter) + throws Exception + { + + // ok to proceed... + boolean ok = true; + ISystemFilterContainer parent = filter.getParentFilterContainer(); + parent.deleteSystemFilter(filter); + commit(filter.getParentFilterPool()); + + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterDeleted(filter); + return ok; + } + /** + * Renames a filter. This is better than filter.setName(String newName) as it + * saves the parent pool to disk. + *

+ * Does the following: + *

    + *
  • Renames the object in the in-memory cache + *
  • If appropriate for the save policy, rename's the filter's file on disk. + *
  • Save parent filter pool's in-memory object to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterRenamed) + *
+ * Does fire an event. + */ + public void renameSystemFilter(ISystemFilter filter, String newName) + throws Exception + { + + // ok to proceed + ISystemFilterContainer parent = filter.getParentFilterContainer(); + String oldName = filter.getName(); + parent.renameSystemFilter(filter, newName); + // rename on disk + try + { + + commit(filter.getParentFilterPool()); + } + catch (Exception exc) + { + parent.renameSystemFilter(filter, oldName); // rollback name change + throw exc; + } + // if caller provider, callback to inform them of this event + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterRenamed(filter,oldName); + } + + /** + * Updates a filter. This is better than doing it directly as it saves it to disk. + *

+ * Does the following: + *

    + *
  • Updates the object in the in-memory cache + *
  • Save parent filter pool's in-memory object to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterUpdated). + *
+ */ + public void updateSystemFilter(ISystemFilter filter, String newName, String[] strings) + throws Exception + { + + // ok to proceed... + ISystemFilterContainer parent = filter.getParentFilterContainer(); + String oldName = filter.getName(); + boolean rename = !oldName.equals(newName); + if (rename) + { + renameSystemFilter(filter, newName); + } + parent.updateSystemFilter(filter, newName, strings); + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterUpdated(filter); + } + + /** + * Sets a filter's type. This is better than calling filter.setType(String) directly as it saves the filter to disk after. + *

+ * A filter's type is an arbitrary string that is not interpreted or used by the base framework. This + * is for use entirely by tools who wish to support multiple types of filters and be able to launch unique + * actions per type, say. + * @param parent The parent which is either a SystemFilterPool or a SystemFilter + * @param type The type of this filter + */ + public void setSystemFilterType(ISystemFilter filter, String newType) + throws Exception + { + filter.setType(newType); + commit(filter.getParentFilterPool()); + } + + /** + * Copy a system filter to a pool in this or another filter manager. + */ + public ISystemFilter copySystemFilter(ISystemFilterPool targetPool, ISystemFilter oldFilter, String newName) + throws Exception + { + ISystemFilterPoolManager targetMgr = targetPool.getSystemFilterPoolManager(); + ISystemFilterPool oldPool = oldFilter.getParentFilterPool(); + + targetMgr.suspendCallbacks(true); + + ISystemFilter newFilter = oldPool.copySystemFilter(targetPool, oldFilter, newName); // creates it in memory + commit(targetPool); // save updated pool to disk + + targetMgr.suspendCallbacks(false); + + targetMgr.getProvider().filterEventFilterCreated(newFilter); + return newFilter; + } + /** + * Move a system filter to a pool in this or another filter manager. + * Does this by first copying the filter, and only if successful, deleting the old copy. + */ + public ISystemFilter moveSystemFilter(ISystemFilterPool targetPool, ISystemFilter oldFilter, String newName) + throws Exception + { + ISystemFilter newFilter = copySystemFilter(targetPool, oldFilter, newName); + if (newFilter != null) + { + deleteSystemFilter(oldFilter); + } + return newFilter; + } + + /** + * Return the zero-based position of a SystemFilter object within its container + */ + public int getSystemFilterPosition(ISystemFilter filter) + { + ISystemFilterContainer container = filter.getParentFilterContainer(); + int position = -1; + boolean match = false; + ISystemFilter[] filters = container.getSystemFilters(); + + for (int idx = 0; !match && (idx + *

+ * Does the following: + *

    + *
  • After the move, the pool containing the filter is saved to disk. + *
  • Calls back to provider to inform of this event + *
+ * @param filters Array of SystemFilters to move. + * @param newPosition new zero-based position for the filters (filterEventFiltersRePositioned) + */ + public void moveSystemFilters(ISystemFilter filters[], int delta) + throws Exception + { + /* + * DWD revisit this. Make sure that the pool is scheduled to be saved. + */ +// ISystemFilterContainer container = filters[0].getParentFilterContainer(); + int[] oldPositions = new int[filters.length]; + for (int idx=0; idx 0) // moving down, process backwards + for (int idx=filters.length-1; idx>=0; idx--) + moveFilter(filters[idx], oldPositions[idx]+delta); + else + for (int idx=0; idx + * While the framework has all the code necessary to arrange filters and save/restore + * that arrangement, you may choose to use preferences instead of this support. + * In this case, call this method and pass in the saved and sorted filter name list. + *

+ * Called by someone after restore. + */ + public void orderSystemFilters(ISystemFilterPool pool, String[] names) throws Exception + { + pool.orderSystemFilters(names); + commit(pool); + } + + // ------------------------------- + // SYSTEM FILTER STRING METHODS... + // ------------------------------- + /** + * Append a new filter string to the given filter's list + *

+ * Does the following: + *

    + *
  • Adds the filter string to the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringCreated) + *
+ */ + public ISystemFilterString addSystemFilterString(ISystemFilter filter, String newString) throws Exception + { + ISystemFilterString newFilterString = filter.addFilterString(newString); + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringCreated(newFilterString); + return newFilterString; + } + /** + * Insert a new filter string to the its filters' list, at the given zero-based position + *

+ * Does the following: + *

    + *
  • Adds the filter string to the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringCreated) + *
+ */ + public ISystemFilterString addSystemFilterString(ISystemFilter filter, String newString, int position) throws Exception + { + ISystemFilterString newFilterString = filter.addFilterString(newString, position); + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringCreated(newFilterString); + return newFilterString; + } + /** + * Delete a filter string from the given filter's list + *

+ * Does the following: + *

    + *
  • Removes the filter string from the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringDeleted) + *
+ * @return true if given string was found and hence was deleted. + */ + public boolean removeSystemFilterString(ISystemFilter filter, String oldString) throws Exception + { + ISystemFilterString oldFilterString = filter.removeFilterString(oldString); + if (oldFilterString == null) + return false; + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringDeleted(oldFilterString); + return true; + } + /** + * Remove a filter string from this filter's list, given its SystemFilterString object. + *

+ * Does the following: + *

    + *
  • Removes the filter string from the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringDeleted) + *
+ * @return true if the given string existed and hence was deleted. + */ + public boolean removeSystemFilterString(ISystemFilter filter, ISystemFilterString filterString) throws Exception + { + boolean ok = filter.removeFilterString(filterString); + if (!ok) + return false; + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringDeleted(filterString); + return ok; + } + /** + * Remove a filter string from the given filter's list, given its zero-based position + *

+ * Does the following: + *

    + *
  • Removes the filter string from the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringDeleted) + *
+ * @return true if a string existed at the given position and hence was deleted. + */ + public boolean removeSystemFilterString(ISystemFilter filter, int position) throws Exception + { + ISystemFilterString oldFilterString = filter.removeFilterString(position); + if (oldFilterString == null) + return false; + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringDeleted(oldFilterString); + return true; + } + /** + * Update a filter string's string vale + *

+ * Does the following: + *

    + *
  • Update the filter string in the in-memory cache + *
  • Saves parent filter pool to disk. + *
  • Calls back to provider to inform it of this event (filterEventFilterStringUpdated) + *
+ */ + public void updateSystemFilterString(ISystemFilterString filterString, String newValue) throws Exception + { + if (newValue.equals(filterString.getString())) + return; + ISystemFilter filter = filterString.getParentSystemFilter(); + filter.updateFilterString(filterString, newValue); + ISystemFilterPool parentPool = filter.getParentFilterPool(); + commit(parentPool); + if ((caller != null) && !suspendCallbacks) + caller.filterEventFilterStringUpdated(filterString); + } + /** + * Return the zero-based position of a SystemFilterString object within its filter + */ + public int getSystemFilterStringPosition(ISystemFilterString filterString) + { + ISystemFilter filter = filterString.getParentSystemFilter(); + int position = -1; + boolean match = false; + ISystemFilterString[] filterStrings = filter.getSystemFilterStrings(); + + String matchString = filterString.getString(); + for (int idx = 0; !match && (idx + *

+ * Does the following: + *

    + *
  • After the move, the filter pool containing the filter containing the filter strings is saved to disk. + *
  • Calls back to provider to inform of the event (filterEventFilterStringsRePositioned) + *
+ * @param filterStrings Array of SystemFilterStrings to move. + * @param newPosition new zero-based position for the filter strings + */ + public void moveSystemFilterStrings(ISystemFilterString filterStrings[], int delta) + throws Exception + { + ISystemFilter filter = filterStrings[0].getParentSystemFilter(); + int[] oldPositions = new int[filterStrings.length]; + for (int idx=0; idx 0) // moving down, process backwards + for (int idx=filterStrings.length-1; idx>=0; idx--) + moveFilterString(filter, filterStrings[idx], oldPositions[idx]+delta); + else + for (int idx=0; idx + * + * @generated + */ + public boolean isSingleFilterStringOnly() + { + return singleFilterStringOnly; + } + + /** + * + * + * @generated + */ + public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly) + { + boolean oldSingleFilterStringOnly = singleFilterStringOnly; + if (oldSingleFilterStringOnly != newSingleFilterStringOnly) + { + singleFilterStringOnly = newSingleFilterStringOnly; + setDirty(true); + } + } + + public boolean isDirty() + { + return _isDirty; + } + + public void setDirty(boolean flag) + { + if (_isDirty != flag) + { + _isDirty = flag; + } + } + + public boolean wasRestored() + { + return _wasRestored; + } + + public void setWasRestored(boolean flag) + { + _wasRestored = flag; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/AbstractSystemResourceSet.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/AbstractSystemResourceSet.java index b42e2d4d240..9e238ae21ad 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/AbstractSystemResourceSet.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/AbstractSystemResourceSet.java @@ -22,6 +22,8 @@ import java.util.List; import org.eclipse.rse.services.clientserver.messages.SystemMessage; + + public class AbstractSystemResourceSet implements ISystemResourceSet { private List _resourceSet; @@ -102,7 +104,7 @@ public class AbstractSystemResourceSet implements ISystemResourceSet buf.append(pathFor(resource)); if (i < _resourceSet.size()) { - buf.append(", "); //$NON-NLS-1$ + buf.append(", "); } buf.append('\n'); } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/IHost.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/IHost.java new file mode 100644 index 00000000000..e456d08ed99 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/IHost.java @@ -0,0 +1,212 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; + + + + +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.ISubSystem; + +/** + * Interface for SystemConnection objects. + * A SystemConnect holds information identifying a remote system. It also logically contains + * SubSystem objects, although this containment is achievable programmatically versus via + * object oriented containment. + *

+ */ +/** + * @lastgen interface SystemConnection {} + */ +public interface IHost extends IRSEModelObject +{ + /** + * Return the system profile that owns this connection + */ + public ISystemProfile getSystemProfile(); + + /** + * Return the name of the system profile that owns this connection + */ + public String getSystemProfileName(); + + /** + * Set the parent connection pool this is owned by. + * Connection pools are internal management objects, one per profile. + */ + public void setHostPool(ISystemHostPool pool); + /** + * Set the parent connection pool this is owned by. + * Connection pools are internal management objects, one per profile. + */ + public ISystemHostPool getHostPool(); + + /** + * Return the subsystem instances under this connection. + * Just a shortcut to {@link org.eclipse.rse.model.ISystemRegistry#getSubSystems(IHost)} + */ + public ISubSystem[] getSubSystems(); + + /** + * Return the local default user Id without resolving up the food chain. + * @see #getDefaultUserId() + */ + public String getLocalDefaultUserId(); + /** + * Clear the local default user Id so next query will return the value from + * the preference store. + *

+ * Same as calling setDefaultUserId(null) + * @see #setDefaultUserId(String) + */ + public void clearLocalDefaultUserId(); + + /** + * Private method called when this connection is being deleted, so + * we can do any pre-death cleanup we need. + *

+ * What we need to do is delete our entry in the preference store for our default userId. + */ + public void deletingHost(); + + /** + * Private method called when this connection's profile is being rename, so + * we can do any pre-death cleanup we need. + *

+ * What we need to do is rename our entry in the preference store for our default userId. + */ + public void renamingSystemProfile(String oldName, String newName); + /** + * Call this to query whether the default userId is to be uppercased. + */ + public boolean getForceUserIdToUpperCase(); + /** + * Call this to compare two userIds taking case sensitivity + */ + public boolean compareUserIds(String userId1, String userId2); +/** + * @return The value of the SystemType attribute + */ + public String getSystemType(); + +/** + * @param value The new value of the SystemType attribute + */ + public void setSystemType(String value); + +/** + * @return The value of the AliasName attribute + * The unique key for this object. Unique per connection pool + */ + public String getAliasName(); + +/** + * @param value The new value of the AliasName attribute + */ + public void setAliasName(String value); + +/** + * @return The value of the HostName attribute + */ + public String getHostName(); + +/** + * @param value The new value of the HostName attribute + */ + public void setHostName(String value); + +/** + * @return The value of the Description attribute + */ + public String getDescription(); + +/** + * @param value The new value of the Description attribute + */ + public void setDescription(String value); + +/** + * We return the default user Id. Note that we don't store it directly in + * the mof-modelled attribute, as we don't want the team to share it. Rather, + * we store the actual user Id in the preference store keyed by this connection's + * unique name (profile.connName) and store that key in this attribute. + *

+ * Further, it is possible that there is no default user id. If so, this + * method will go to the preference store and will try to get the default user + * Id per this connection's system type. + *

+ * This is all transparent to the caller though. + *

+ * @return The value of the DefaultUserId attribute + */ + public String getDefaultUserId(); + +/** + * Intercept of setDefaultUserId so we can force it to uppercase. + * Also, we do not store the user Id per se in the attribute, but rather + * we store it in the preference with a key name unique to this connection. + * We store that key name in this attribute. However, this is all transparent to + * the caller. + * @param value The new value of the DefaultUserId attribute + */ + public void setDefaultUserId(String value); + + /** + * @generated This field/method will be replaced during code generation + * @return The value of the Promptable attribute + */ + boolean isPromptable(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the Promptable attribute + */ + void setPromptable(boolean value); + + /** + * Returns the value of the 'Offline' attribute. + * + *

+ * Is this connection offline? If so, there is no live connection. Subsystems + * decide how much to enable while offline. + *

+ * + * @return the value of the 'Offline' attribute. + * @see #setOffline(boolean) + * @see org.eclipse.rse.model.ModelPackage#getSystemConnection_Offline() + * @model + * @generated + */ + boolean isOffline(); + + /** + * Sets the value of the '{@link org.eclipse.rse.core.model.IHost#isOffline Offline}' attribute. + * + * + * @param value the new value of the 'Offline' attribute. + * @see #isOffline() + * @generated + */ + void setOffline(boolean value); + + /** + * Returns all the connector services provided + * for this host + * @return the connector services + */ + IConnectorService[] getConnectorServices(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurationCategories.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurationCategories.java index 34e8f3bc688..cd1e7d464c2 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurationCategories.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISubSystemConfigurationCategories.java @@ -26,14 +26,14 @@ public interface ISubSystemConfigurationCategories /** * Job subsystems */ - public static final String SUBSYSTEM_CATEGORY_JOBS = "jobs"; //$NON-NLS-1$ + public static final String SUBSYSTEM_CATEGORY_JOBS = "jobs"; /** * File subsystems */ - public static final String SUBSYSTEM_CATEGORY_FILES = "files"; //$NON-NLS-1$ + public static final String SUBSYSTEM_CATEGORY_FILES = "files"; /** * Command subsystems */ - public static final String SUBSYSTEM_CATEGORY_CMDS = "commands"; //$NON-NLS-1$ + public static final String SUBSYSTEM_CATEGORY_CMDS = "commands"; } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemContainer.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemContainer.java index d96d98c05aa..960aea8400f 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemContainer.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemContainer.java @@ -52,7 +52,7 @@ public interface ISystemContainer /** * Marks the object as stale or not * @param isStale whether the object is to be marked stale or not - * @param clearCache indicates whether or not to clear the cache + * @param indicates whether or not to clear the cache */ public void markStale(boolean isStale, boolean clearCache); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java new file mode 100644 index 00000000000..32bca3563f8 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java @@ -0,0 +1,179 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; + +import java.util.List; + +import org.eclipse.rse.core.persistance.IRSEPersistableContainer; + + +// +/** + * A list of connections. + */ +/** + * @lastgen interface SystemConnectionPool {} + */ + +public interface ISystemHostPool extends IRSEPersistableContainer +{ + + + + /** + * Return the system profile that owns this connection pool + */ + public ISystemProfile getSystemProfile(); + /** + * Rename this connection pool. + */ + public void renameHostPool(String newName); + /** + * Return array of connections in this pool + */ + public IHost[] getHosts(); + /** + * Create a connection. + */ + public IHost createHost(String systemType, String aliasName, String hostName) + throws Exception; + /** + * Create a connection. + */ + public IHost createHost(String systemType, String aliasName, String hostName, String description) + throws Exception; + /** + * Create a connection. + */ + public IHost createHost(String systemType, String aliasName, String hostName, String description, + String defaultUserId, int defaultUserIdLocation) + throws Exception; + /** + * Update an existing connection given the new information. + * This method: + *
    + *
  • calls the setXXX methods on the given connection object, updating the information in it. + *
  • saves the connection to disk (renaming its folder if needed) + *
+ *

+ * @param conn SystemConnection to be updated + * @param systemType system type matching one of the system type names defined via the + * systemType extension point. + * @param aliasName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the connection. Can be null. + * @param defaultUserId userId to use as the default for the subsystems. + * @param defaultUserIdLocation where to set the given default user Id. See ISystemUserIdConstants + */ + public void updateHost(IHost conn, String systemType, + String aliasName, String hostName, + String description,String defaultUserId, int defaultUserIdLocation) + throws Exception; + + /** + * Return a connection given its name. + */ + public IHost getHost(String aliasName); + /** + * Return the connection at the given zero-based offset + */ + public IHost getHost(int pos); + /** + * Add a new connection to the list. + */ + public boolean addHost(IHost conn); + /** + * Removes a given connection from the list and deletes it from disk. + *

+ * This will: + *

    + *
  • Delete the connection in memory + *
  • Delete the underlying folder + *
+ *

+ * @param conn SystemConnection object to remove + */ + public void deleteHost(IHost conn); + /** + * Renames a given connection in the list. + * This will: + *

    + *
  • Rename the profile in memory + *
  • Rename the underlying folder + *
  • Update the user preferences if this profile is currently active. + *
+ * @param conn SystemConnection object to rename + * @param newName The new name to give that connection. + */ + public void renameHost(IHost conn, String newName) throws Exception; + /** + * Return the zero-based position of a SystemConnection object within its profile. + */ + public int getHostPosition(IHost conn); + /** + * Return the number of SystemConnection objects within this pool. + */ + public int getHostCount(); + + /** + * Duplicates a given connection in this list within this list or another list. + * @param targetPool The SystemConnectionPool to hold the copied connection. Can equal this connection, as long as alias name is unique + * @param conn SystemConnection object (within our pool) to clone + * @param alias New, unique, alias name to give this connection. Clone will fail if this is not unique. + */ + public IHost cloneHost(ISystemHostPool targetPool, IHost conn, String aliasName) + throws Exception; + + /** + * Move existing connections a given number of positions in the same pool. + * 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.

+ *

    + *
  • After the move, the pool containing the moved connection is saved to disk. + *
  • The connection's alias name must be unique in pool. + *
+ * TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION? + * @param conns Array of SystemConnections to move. + * @param newPosition new zero-based position for the connection + */ + public void moveHosts(IHost conns[], int delta); + + /** + * Order connections according to user preferences. + * Called after restore. + */ + public void orderHosts(String[] names); + + /** + * @generated This field/method will be replaced during code generation + * @return The value of the Name attribute + */ + String getName(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the Name attribute + */ + void setName(String value); + + /** + * @generated This field/method will be replaced during code generation + * @return The list of Connections references + */ + List getHostList(); + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeEvents.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeEvents.java index d4e2caaf759..1ebb90ca6b2 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeEvents.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeEvents.java @@ -16,17 +16,16 @@ package org.eclipse.rse.core.model; - /** * The event IDs sent when local resources in the RSE model change. * You should monitor for these events in your view if you display any of the resource types listed here. *

* To monitor, implement interface {@link org.eclipse.rse.core.model.ISystemModelChangeListener} and - * call {@link org.eclipse.rse.model.ISystemRegistry#addSystemModelChangeListener(ISystemModelChangeListener)} - * and in your dispose method, call {@link org.eclipse.rse.model.ISystemRegistry#removeSystemModelChangeListener(ISystemModelChangeListener)}. + * call {@link org.eclipse.rse.core.model.ISystemRegistry#addSystemModelChangeListener(ISystemModelChangeListener)} + * and in your dispose method, call {@link org.eclipse.rse.core.model.ISystemRegistry#removeSystemModelChangeListener(ISystemModelChangeListener)}. *

* If you are interesting in firing model change events, see - * {@link org.eclipse.rse.model.ISystemRegistry#fireModelChangeEvent(int, int, Object, String)}. + * {@link org.eclipse.rse.core.model.ISystemRegistry#fireModelChangeEvent(int, int, Object, String)}. */ public interface ISystemModelChangeEvents { diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeListener.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeListener.java index 76d26ca50df..cc386898ee4 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeListener.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemModelChangeListener.java @@ -15,20 +15,18 @@ ********************************************************************************/ package org.eclipse.rse.core.model; - - /** * Interface that listeners interesting in changes to local resources in the RSE model * implement, and subsequently register their interest, via SystemRegistry. *

* If you list any of the resource types defined in {@link org.eclipse.rse.core.model.ISystemModelChangeEvents} * you should monitor by implementing this interface, and registering with the - * system registry via {@link org.eclipse.rse.model.ISystemRegistry#addSystemModelChangeListener(ISystemModelChangeListener)}. + * system registry via {@link org.eclipse.rse.core.model.ISystemRegistry#addSystemModelChangeListener(ISystemModelChangeListener)}. * In your view's dispose method, you must also de-register by calling - * {@link org.eclipse.rse.model.ISystemRegistry#removeSystemModelChangeListener(ISystemModelChangeListener)}. + * {@link org.eclipse.rse.core.model.ISystemRegistry#removeSystemModelChangeListener(ISystemModelChangeListener)}. *

* If you are interesting in firing model change events, see - * {@link org.eclipse.rse.model.ISystemRegistry#fireModelChangeEvent(int, int, Object, String)}. + * {@link org.eclipse.rse.core.model.ISystemRegistry#fireModelChangeEvent(int, int, Object, String)}. */ public interface ISystemModelChangeListener { diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java new file mode 100644 index 00000000000..27cc60d308d --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemNewConnectionWizardPage.java @@ -0,0 +1,48 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; + +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; + +/** + * Interface that all subsystem factory supplied pages contributed to the New Connection wizard + * must implement. + * @see org.eclipse.rse.ui.wizards.AbstractSystemNewConnectionWizardPage + * @see org.eclipse.rse.ui.view.SubSystemConfigurationAdapter#getNewConnectionWizardPages(org.eclipse.rse.core.subsystems.ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard) + */ +public interface ISystemNewConnectionWizardPage +{ + + /** + * This is called when the users presses Finish. All that should be done here is validation + * of the input, returning true if all is ok and the finish can proceed. + */ + public boolean performFinish(); + + /** + * This is called frequently by the framework to decide whether to enable the Finish and + * Next buttons. + *

+ * Return true if the page is complete and has no errors + */ + public boolean isPageComplete(); + + /** + * Return the subsystem factory that supplied this page + */ + public ISubSystemConfiguration getSubSystemConfiguration(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfile.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfile.java new file mode 100644 index 00000000000..08b368d53aa --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfile.java @@ -0,0 +1,95 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; + +// + +/** + * The interface that RSE system profiles implement. + *

+ * A profile represents a user or name which is used to key important user-data + * by: + *

    + *
  • Hosts + *
  • Filter pools + *
  • User actions + *
  • Compile commands + *
+ * + *

+ * @lastgen interface SystemProfile {} + */ +public interface ISystemProfile extends IRSEModelObject +{ + + /** + * Set the in-memory pointer back to the parent system profile manager + */ + public void setProfileManager(ISystemProfileManager mgr); + /** + * Get the in-memory pointer back to the parent system profile manager + */ + public ISystemProfileManager getProfileManager(); + + /** + * Convenience method for create a new connection within this profile. + * Shortcut for {@link ISystemRegistry#createHost(String,String,String,String)} + */ + public IHost createHost(String systemType, String connectionName, String hostName, String description) throws Exception; + + /** + * @return The value of the Name attribute + */ + String getName(); + + /** + * @param value The new value of the Name attribute + */ + void setName(String value); + + /** + * @return The value of the DefaultPrivate attribute + * Is this profile created automatically, and is it the profile + * that is unique for this developer? + */ + boolean isDefaultPrivate(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the DefaultPrivate attribute + */ + void setDefaultPrivate(boolean value); + + /** + * Return all connections for this profile + */ + public IHost[] getHosts(); + /** + * Return all filter pools for this profile + */ + public ISystemFilterPool[] getFilterPools(); + /** + * Return all filter pools for this profile, scoped by a given subsystem factory + */ + public ISystemFilterPool[] getFilterPools(ISubSystemConfiguration ssf); + /** + * Return true if this profile is currently active for this user + */ + public boolean isActive(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfileManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfileManager.java new file mode 100644 index 00000000000..ba0031e688e --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemProfileManager.java @@ -0,0 +1,130 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; +import java.util.Vector; + + + + +/** + * A class that manages a list of SystemProfile objects. + */ +/** + * @lastgen interface SystemProfileManager {} + */ + +public interface ISystemProfileManager { + + + /** + * Create a new profile with the given name, and add to the list. + * The name must be unique within the existing list. + *

+ * The underlying folder is created in the file system. + *

+ * @param name What to name this profile + * @param makeActive true if this profile is to be added to the active profile list. + * @return new profile, or null if name not unique. + */ + public ISystemProfile createSystemProfile(String name, boolean makeActive); + /** + * Toggle an existing profile's state between active and inactive + */ + public void makeSystemProfileActive(ISystemProfile profile, boolean makeActive); + /** + * Get an array of all existing profiles. + */ + public ISystemProfile[] getSystemProfiles(); + /** + * Get an array of all existing profile names. + */ + public String[] getSystemProfileNames(); + /** + * Get a vector of all existing profile names. + */ + public Vector getSystemProfileNamesVector(); + /** + * Get a profile given its name. + */ + public ISystemProfile getSystemProfile(String name); + /** + * Return the profiles identified via preferences as the active profiles... + */ + public ISystemProfile[] getActiveSystemProfiles(); + /** + * Return the profile names currently selected by the user as his "active" profiles + */ + public String[] getActiveSystemProfileNames(); + /** + * Return 0-based position of the given active profile within the list of active profiles. + */ + public int getActiveSystemProfilePosition(String profileName); + /** + * Return the default private profile created at first touch. + * Will return null if it has been renamed! + */ + public ISystemProfile getDefaultPrivateSystemProfile(); + /** + * Return the default team profile created at first touch. + * Will return null if it has been renamed! + */ + public ISystemProfile getDefaultTeamSystemProfile(); + /** + * Rename the given profile. + */ + public void renameSystemProfile(ISystemProfile profile, String newName); + /** + * Delete the given profile + */ + public void deleteSystemProfile(ISystemProfile profile); + /** + * Clone the given profile + */ + public ISystemProfile cloneSystemProfile(ISystemProfile profile, String newName); + /** + * Return true if the given profile is active + * @see ISystemProfile#isActive() + */ + public boolean isSystemProfileActive(String profileName); + + + + /** + * @generated This field/method will be replaced during code generation + * @return The list of Profiles references + */ + java.util.List getProfiles(); + + + + +// /** +// * Reusable method to return a name validator for renaming a profile. +// * @param the current profile name on updates. Can be null for new profiles. Used +// * to remove from the existing name list the current connection. +// */ +// public ISystemValidator getProfileNameValidator(String profileName); +// /** +// * Reusable method to return a name validator for renaming a profile. +// * @param the current profile object on updates. Can be null for new profiles. Used +// * to remove from the existing name list the current connection. +// */ +// public ISystemValidator getProfileNameValidator(ISystemProfile profile); + + + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java new file mode 100644 index 00000000000..e39ec945d2b --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java @@ -0,0 +1,687 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; + +import java.util.List; +import java.util.Vector; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterStartHere; +import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; +import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; +import org.eclipse.swt.dnd.Clipboard; +import org.eclipse.swt.widgets.Shell; + + +/** + * 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 {@link org.eclipse.rse.ui.RSEUIPlugin#getTheSystemRegistry() getTheSystemRegistry} + * method in the RSEUIPlugin 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. + */ +public interface ISystemRegistry extends ISchedulingRule +{ + + public ISystemFilterStartHere getSystemFilterStartHere(); + + public ISystemFilterPool getSystemFilterPool(); + + // ---------------------------------- + // UI METHODS... + // ---------------------------------- + /** + * Show the RSE perspective if it is not already showing + */ + public void showRSEPerspective(); + /** + * Expand the given connection in the RSE, if the RSE is the active perspective. + */ + public void expandHost(IHost conn); + /** + * Expand the given subsystem in the RSE, if the RSE is the active perspective. + */ + public void expandSubSystem(ISubSystem subsystem); + + // ---------------------------- + // SUBSYSTEM FACTORY METHODS... + // ---------------------------- + /** + * Private method used by RSEUIPlugin to tell registry all registered subsystem + * factories. This way, all code can use this registry to access them versus the + * RSEUIPlugin. + */ + public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies); + /** + * Public method to retrieve list of subsystem factory proxies registered by extension points. + */ + public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies(); + /** + * Return all subsystem factory proxies matching a subsystem factory category. + * @see ISubSystemConfigurationCategories + */ + public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory); + /** + * Return all subsystem factories. Be careful when you call this, as it activates all + * subsystem factories. + */ + public ISubSystemConfiguration[] getSubSystemConfigurations(); + + /** + * Return the parent subsystemconfiguration given a subsystem object. + */ + public ISubSystemConfiguration getSubSystemConfiguration(ISubSystem subsystem); + /** + * Return the subsystemconfiguration, given its plugin.xml-declared id. + */ + public ISubSystemConfiguration getSubSystemConfiguration(String id); + /** + * 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 ISubSystemConfigurationCategories + */ + public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory); + /** + * Return all subsystem factories which support the given system type. If the type is null, + * returns all. + * + */ + public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType); + + /** + * Return all subsystem factories which support the given system type. If the type is null, + * returns all. + */ + public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType, boolean filterDuplicateServiceSubSystemFactories); + + + // ---------------------------- + // USER PREFERENCE METHODS... + // ---------------------------- + /** + * Are connection names to be qualified by profile name? + */ + public boolean getQualifiedHostNames(); + /** + * Set if connection names are to be qualified by profile name + */ + public void setQualifiedHostNames(boolean set); + /** + * Reflect the user changing the preference for showing filter pools. + */ + public void setShowFilterPools(boolean show); + /* + * Reflect the user changing the preference for showing filter strings. + * + public void setShowFilterStrings(boolean show); + */ + /** + * Reflect the user changing the preference for showing new connection prompt + */ + public void setShowNewHostPrompt(boolean show); + + // ---------------------------- + // PROFILE METHODS... + // ---------------------------- + /** + * Return singleton profile manager + */ + public ISystemProfileManager getSystemProfileManager(); + /** + * Return the profiles currently selected by the user as his "active" profiles + */ + public ISystemProfile[] getActiveSystemProfiles(); + /** + * Return the profile names currently selected by the user as his "active" profiles + */ + public String[] getActiveSystemProfileNames(); + /** + * Return all defined profiles + */ + public ISystemProfile[] getAllSystemProfiles(); + /** + * Return all defined profile names + */ + public String[] getAllSystemProfileNames(); + /** + * Return all defined profile names as a vector + */ + public Vector getAllSystemProfileNamesVector(); + /** + * Get a SystemProfile given its name + */ + public ISystemProfile getSystemProfile(String profileName); + /** + * Create a SystemProfile given its name and whether or not to make it active + */ + public ISystemProfile createSystemProfile(String profileName, boolean makeActive) + throws Exception; + /** + * Copy a SystemProfile. All connections connection data is copied. + * @param monitor Progress monitor to reflect each step of the operation + * @param profile Source profile to copy + * @param newName Unique name to give copied profile + * @param makeActive whether to make the copied profile active or not + * @return new SystemProfile object + */ + public ISystemProfile copySystemProfile(IProgressMonitor monitor, ISystemProfile profile, String newName, boolean makeActive) + 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. + */ + public void renameSystemProfile(ISystemProfile profile, String newName) + 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. + */ + public void deleteSystemProfile(ISystemProfile profile) + throws Exception; + /** + * Make or unmake the given profile active + */ + public void setSystemProfileActive(ISystemProfile profile, boolean makeActive); + + + /** + * Return the list of connector services provided for the given host + * @param conn the host + * @return the list of connector services + */ + public IConnectorService[] getConnectorServices(IHost conn); + + // ---------------------------- + // SUBSYSTEM METHODS... + // ---------------------------- + + /** + * Return list of subsystem objects for a given connection. If the subsystems have + * not all been read into memory, this loads them up + */ + public ISubSystem[] getSubSystems(IHost conn); + + /** + * Return list of subsystem objects for a given connection. Use the force + * flag to indicate whether or not to restore from disk + */ + public ISubSystem[] getSubSystems(IHost conn, boolean force); + + public ISubSystem[] getServiceSubSystems(Class serviceType, IHost connection); + + /** + * Resolve a subsystem from it's profile, connection and subsystem name. + * + * @param srcProfileName the name of the profile + * @param srcConnectionName the name of the connection + * @param subsystemFactoryId the id of the subsystem + * + * @return the subsystem + */ + public ISubSystem getSubSystem(String srcProfileName, String srcConnectionName, String subsystemFactoryId); + + /** + * Resolve a subsystem from it's absolute name + * + * @param absoluteSubSystemName the name of the subsystem + * + * @return the subsystem + */ + public ISubSystem getSubSystem(String absoluteSubSystemName); + + /** + * Return the absolute name for the specified subsystem + * @param the subsystem + * @return the absolute name of the subsystem + */ + public String getAbsoluteNameForSubSystem(ISubSystem subsystem); + + /** + * Return the absolute name for the specified connection + * @param the connection + * @return the absolute name of the connection + */ + public String getAbsoluteNameForConnection(IHost connection); + + /** + * 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. + */ + public ISubSystem[] getSubSystems(String factoryId); + /** + * 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. + */ + public ISubSystem[] getSubSystems(String factoryId, IHost 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 org.eclipse.rse.core.model.ISubSystemConfigurationCategories + */ + public ISubSystem[] getSubSystemsBySubSystemConfigurationCategory(String factoryCategory, IHost connection); + + /** + * Delete a subsystem object. This code finds the factory that owns it and + * delegates the request to that factory. + */ + public boolean deleteSubSystem(ISubSystem subsystem); + + // ---------------------------- + // CONNECTION METHODS... + // ---------------------------- + /** + * 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 {@link #createLocalHost(ISystemProfile, String, String)}. + */ + public IHost getLocalHost(); + + /** + * Return all connections in all active profiles. + */ + public IHost[] getHosts(); + /** + * Return all connections in a given profile name. + */ + public IHost[] getHostsByProfile(ISystemProfile profile); + /** + * Return all connections in a given profile. + */ + public IHost[] getHostsByProfile(String profileName); + /** + * Return all connections for which there exists one or more subsystems owned + * by a given subsystem factory. + * @see #getSubSystemConfiguration(String) + */ + public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory); + /** + * Return all connections for which there exists one or more subsystems owned + * by a given subsystem factory, identified by factory Id + */ + public IHost[] getHostsBySubSystemConfigurationId(String factoryId); + /** + * 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 org.eclipse.rse.core.model.ISubSystemConfigurationCategories + */ + public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory); + /** + * Return all connections for all active profiles, for the given system type. + */ + public IHost[] getHostsBySystemType(String systemType); + /** + * Return all connections for all active profiles, for the given system types. + */ + public IHost[] getHostsBySystemTypes(String[] systemTypes); + /** + * Return a SystemConnection object given a system profile containing it, + * and a connection name uniquely identifying it. + */ + public IHost getHost(ISystemProfile profile, String connectionName); + /** + * Return the zero-based position of a SystemConnection object within its profile. + */ + public int getHostPosition(IHost conn); + /** + * Return the number of SystemConnection objects within the given profile + */ + public int getHostCount(String profileName); + /** + * Return the number of SystemConnection objects within the given connection's owning profile + */ + public int getHostCountWithinProfile(IHost conn); + /** + * Return the number of SystemConnection objects within all active profiles + */ + public int getHostCount(); + /** + * Return a vector of previously-used connection names in the given named profile. + * @return Vector of String objects. + */ + public Vector getHostAliasNames(String profileName); + /** + * Return a vector of previously-used connection names in the given profile. + * @return Vector of String objects. + */ + public Vector getHostAliasNames(ISystemProfile profile); + /** + * Return a vector of previously-used connection names in all active profiles. + */ + public Vector getHostAliasNamesForAllActiveProfiles(); + + /** + * Return array of all previously specified hostnames. + */ + public String[] getHostNames(); + /** + * Return array of previously specified hostnames for a given system type. + */ + public String[] getHostNames(String systemType); + + /** + * Returns the clipboard used for copy actions + */ + public Clipboard getSystemClipboard(); + + /** + * Returns the list of objects on the system clipboard + * @param srcType the transfer type + * @return the list of clipboard objects + */ + public List getSystemClipboardObjects(int srcType); + + + /** + * Convenience method to create a local connection, as it often that one is needed + * for access to the local file system. + * @param 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. + * @param name - the name to give this profile. Must be unique and non-null. + * @param userId - the user ID to use as the default for the subsystems. Can be null. + */ + public IHost createLocalHost(ISystemProfile profile, String name, String userId); + + /** + * 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: + *

    + *
  • creates and saves a new connection within the given profile + *
  • calls all subsystem factories to give them a chance to create a subsystem instance + *
  • fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners + *
+ *

+ * @param profileName Name of the system profile the connection is to be added to. + * @param systemType system type matching one of the system type names defined via the + * systemTypes extension point. + * @param connectionName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the connection. Can be null. + * @param defaultUserId userId to use as the default for the subsystems. + * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants} + * that tells us where to set the user Id + * @param 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. + * @return SystemConnection object, or null if it failed to create. This is typically + * because the connectionName is not unique. Call getLastException() if necessary. + */ + public IHost createHost(String profileName, String systemType, + String connectionName, String hostName, + String description,String defaultUserId, int defaultUserIdLocation, + ISystemNewConnectionWizardPage[] newConnectionWizardPages) + 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: + *

    + *
  • creates and saves a new connection within the given profile + *
  • calls all subsystem factories to give them a chance to create a subsystem instance + *
  • fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners + *
+ *

+ * @param profileName Name of the system profile the connection is to be added to. + * @param systemType system type matching one of the system type names defined via the + * systemTypes extension point. + * @param connectionName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the connection. Can be null. + * @return SystemConnection object, or null if it failed to create. This is typically + * because the connectionName is not unique. Call getLastException() if necessary. + */ + public IHost createHost(String profileName, 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: + *

    + *
  • creates and saves a new connection within the given profile + *
  • calls all subsystem factories to give them a chance to create a subsystem instance + *
  • fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners + *
+ *

+ * @param systemType system type matching one of the system type names defined via the + * systemTypes extension point. + * @param connectionName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the connection. Can be null. + * @return SystemConnection object, or null if it failed to create. This is typically + * because the connectionName is not unique. Call getLastException() if necessary. + */ + public IHost createHost(String systemType, String connectionName, String hostName, String description) + throws Exception; + + /** + * Update an existing connection given the new information. + * This method: + *

    + *
  • calls the setXXX methods on the given connection object, updating the information in it. + *
  • save the connection's connection pool to disk + *
  • fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners + *
  • if the systemtype or hostname is changed, calls disconnect on each associated subsystem. + * We must do this because a hostname changes fundamentally affects the connection, + * rendering any information currently displayed under + * that connection obsolete. That is, the user will have to reconnect. + *
+ *

+ * @param conn SystemConnection to be updated + * @param systemType system type matching one of the system type names defined via the + * systemTypes extension point. + * @param connectionName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the connection. Can be null. + * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.ISystemUserIdConstants ISystemUserIdConstants} + * that tells us where to set the user Id + * @param defaultUserId userId to use as the default for the subsystems. + */ + public void updateHost(Shell shell, IHost conn, String systemType, + String connectionName, String hostName, + String description,String defaultUserId, int defaultUserIdLocation); + + /** + * Update the workoffline mode for a connection. + * + * @param conn SystemConnection to change + * @param offline true if connection should be set offline, false if it should be set online + */ + public void setHostOffline(IHost conn, boolean offline); + + /** + * Delete an existing connection. + *

+ * Lots to do here: + *

    + *
  • Delete all subsystem objects for this connection, including their file's on disk. + *
  • Delete the connection from memory. + *
  • Delete the connection's folder from disk. + *
+ * Assumption: firing the delete event is done elsewhere. Specifically, the doDelete method of SystemView. + */ + public void deleteHost(IHost conn); + /** + * Renames an existing connection. + *

+ * Lots to do here: + *

    + *
  • Reset the conn name for all subsystem objects for this connection + *
  • Rename the connection in memory. + *
  • Rename the connection's folder on disk. + *
+ * Assumption: firing the rename event is done elsewhere. Specifically, the doRename method of SystemView. + */ + public void renameHost(IHost conn, String newName) throws Exception; + /** + * 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.

+ *

    + *
  • After the move, the pool containing the moved connection is saved to disk. + *
  • The connection's name must be unique in pool. + *
  • Fires a single ISystemResourceChangeEvent event of type EVENT_MOVE, if the pool is the private pool. + *
+ * TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION? + * @param conns Array of SystemConnections to move. + * @param newPosition new zero-based position for the connection + */ + public void moveHosts(String profileName, IHost conns[], int delta); + /** + * Copy a SystemConnection. All subsystems are copied, and all connection data is copied. + * @param monitor Progress monitor to reflect each step of the operation + * @param conn The connection to copy + * @param targetProfile What profile to copy into + * @param newName Unique name to give copied profile + * @return new SystemConnection object + */ + public IHost copyHost(IProgressMonitor monitor, IHost conn, + ISystemProfile targetProfile, String newName) + throws Exception; + /** + * Move a SystemConnection to another profile. All subsystems are copied, and all connection data is copied. + * @param monitor Progress monitor to reflect each step of the operation + * @param conn The connection to move + * @param targetProfile What profile to move to + * @param newName Unique name to give moved profile + * @return new SystemConnection object + */ + public IHost moveHost(IProgressMonitor monitor, IHost conn, + ISystemProfile targetProfile, String newName) + throws Exception; + + /** + * Return true if any of the subsystems for the given connection are currently connected + */ + public boolean isAnySubSystemConnected(IHost conn); + + /** + * Return true if all of the subsystems for the given connection are currently connected + */ + public boolean areAllSubSystemsConnected(IHost conn); + + /** + * Disconnect all subsystems for the given connection, if they are currently connected. + */ + public void disconnectAllSubSystems(IHost conn); + + /** + * Inform the world when the connection status changes for a subsystem within a connection + */ + public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected); + + /** + * Inform the world when the connection status changes for a subsystem within a connection + */ + public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree); + + + + + // ---------------------------- + // MISCELLANEOUS METHODS... + // ---------------------------- + + /** + * Returns filter references associated with this resource under the subsystem + */ + public List findFilterReferencesFor(Object resource, ISubSystem subsystem); + + /** + * Marks all filters for this subsystem as stale to prevent caching + * @param subsystem + */ + public void invalidateFiltersFor(ISubSystem subsystem); + + /** + * Marks all filters for this subsystem the contain resourceParent as stale to prevent caching + * @param resourceParent + * @param subsystem + */ + public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem); + + + + /** + * Return last exception object caught in any method, or null if no exception. + * This has the side effect of clearing the last exception. + */ + public Exception getLastException(); + + // ---------------------------- + // SAVE / RESTORE METHODS... + // ---------------------------- + + /** + * Save everything! + */ + public boolean save(); + /** + * Save specific connection pool + * @return true if saved ok, false if error encountered. If false, call getLastException(). + */ + public boolean saveHostPool(ISystemHostPool pool); + /** + * Save specific connection + * @return true if saved ok, false if error encountered. If false, call getLastException(). + */ + public boolean saveHost(IHost conn); + /** + * Restore all connections within active profiles + * @return true if restored ok, false if error encountered. If false, call getLastException(). + */ + public boolean restore(); +} //SystemRegistry \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemChildrenContentsType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemChildrenContentsType.java index 8bfa1c66cd1..74908742cf1 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemChildrenContentsType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemChildrenContentsType.java @@ -18,13 +18,12 @@ package org.eclipse.rse.core.model; - /** * Represents contents that are children of a container */ public class SystemChildrenContentsType implements ISystemContentsType { - public static String CONTENTS_TYPE_CHILDREN = "contents_children"; //$NON-NLS-1$ + public static String CONTENTS_TYPE_CHILDREN = "contents_children"; public static SystemChildrenContentsType _instance = new SystemChildrenContentsType(); public static SystemChildrenContentsType getInstance() diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemSignonInformation.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemSignonInformation.java new file mode 100644 index 00000000000..dbc55c831e3 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/SystemSignonInformation.java @@ -0,0 +1,121 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.model; + + +/** + * This class encapsulates the signon information required for a remote system. This class + * must be secure and never disclose the password for the remote system in its unencrypted form. + * However the encrypted form of the password is not considered secret information and can be + * accessed by anyone. + * + * @author yantzi + */ +public final class SystemSignonInformation { + + + private String _hostname, _userid, _systemType, _password; + + /** + * Default no-arg constructor + */ + public SystemSignonInformation() + { + } + + /** + * Constructor for SystemSignonInformation. + */ + public SystemSignonInformation(String hostname, String userid, String systemType) { + _hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase(); + _userid = userid; + _systemType = systemType; + } + + /** + * Constructor for SystemSignonInformation. + */ + public SystemSignonInformation(String hostname, String userid, String password, String systemType) { + _hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase(); + _userid = userid; + _password = password; + _systemType = systemType; + } + + /** + * Returns the hostname of the remote system + * @return String + */ + public String getHostname() { + return _hostname; + } + + /** + * Returns the systemType of the remote system + * @return String + */ + public String getSystemType() { + return _systemType; + } + + /** + * Returns the userid for the remote system + * @return String + */ + public String getUserid() { + return _userid; + } + + /** + * Return the password for the remote system + */ + public String getPassword() { + return _password; + } + + /** + * Sets the password for the remote system + */ + public void setPassword(String string) { + _password = string; + } + + /** + * Sets the hostname. + * @param hostname The hostname to set + */ + public void setHostname(String hostname) { + _hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase(); + } + + /** + * Sets the systemType. + * @param systemType The systemType to set + */ + public void setSystemType(String systemType) { + _systemType = systemType; + } + + /** + * Sets the userid. + * @param userid The userid to set + */ + public void setUserid(String userid) { + _userid = userid; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/references/IRSEBasePersistableReferenceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/references/IRSEBasePersistableReferenceManager.java index 4abae979162..f4e5cb03992 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/references/IRSEBasePersistableReferenceManager.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/references/IRSEBasePersistableReferenceManager.java @@ -16,7 +16,6 @@ package org.eclipse.rse.core.references; import org.eclipse.core.resources.IFolder; -import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject; /** diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/CommunicationsEvent.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/CommunicationsEvent.java new file mode 100644 index 00000000000..398bc14c40a --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/CommunicationsEvent.java @@ -0,0 +1,46 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + + +public class CommunicationsEvent { + + + // Communications event types + public static final int BEFORE_CONNECT = 1; + public static final int AFTER_CONNECT = 2; + public static final int BEFORE_DISCONNECT = 3; + public static final int AFTER_DISCONNECT = 4; + public static final int CONNECTION_ERROR = 5; + + private IConnectorService system; + private int state; + + public CommunicationsEvent(IConnectorService system, int state) { + this.system = system; + this.state = state; + } + + public int getState() { + return state; + } + + public IConnectorService getSystem() { + return system; + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ICacheManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICacheManager.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ICacheManager.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICacheManager.java diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICommunicationsListener.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICommunicationsListener.java new file mode 100644 index 00000000000..b7659c912c7 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ICommunicationsListener.java @@ -0,0 +1,49 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + + +/** + * ICommunicationsListener - listen to communication events + * @see CommunicationsEvent + */ +public interface ICommunicationsListener { + + + /** + * This method is invoked whenever the communications state is invoked + * immediately before and after the state of the communications changes. + * The state field in CommunicationsEvent determines which state + * change is about to or has occured. + */ + public void communicationsStateChange(CommunicationsEvent e); + + /** + * This method determines if the communications listener is a passive or + * active listener. Typically a passive listener registers with the communications + * system and responds to events as they occur. An active listener typically + * registeres with the communications system only for the duration of the task (i.e. + * user editing a file, or outstanding communications request.) + * + * The user will be prompted on a disconnect if there are any active communication + * listeners registered. + * + * @return false if the communications listener is an active listener, true if the + * communications listener is a passive listener. + */ + public boolean isPassiveCommunicationsListener(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java new file mode 100644 index 00000000000..1380a156617 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java @@ -0,0 +1,339 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.swt.widgets.Shell; + + +/** + * This is the interface implemented by ConnectorService (formerly System) objects. + *

+ * A connector service manages a live connection to a remote system, with + * operations for connecting and disconnecting, and storing information + * typically cached from a subsystem: user ID, password, port, etc. + *

+ * The SubSystem interface includes a method, getConnectorService(), which returns an + * instance of an object that implements this interface for that subsystem. + *

+ * A single connector service object can be unique to a subsystem instance, but + * it can also be shared across multiple subsystems in a single host if those + * subsystems share a physical connection to the remote system. This sharing is done via + * subclasses of {@link org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager} + * which are returned by another getter method in SubSystem. + */ +public interface IConnectorService extends IRSEModelObject +{ + + /** + * Return the subsystem object this system is associated with + */ + public ISubSystem getPrimarySubSystem(); + + /** + * Return all the subsystems that use this service + * @return the subsystems that use this service + */ + public ISubSystem[] getSubSystems(); + + /** + * Set the subsystem, when its not known at constructor time + */ + public void registerSubSystem(ISubSystem ss); + + /** + * Deregister the subsystem + * @param ss + */ + public void deregisterSubSystem(ISubSystem ss); + + /** + * Return true if currently connected. + */ + public boolean isConnected(); + /** + * Attempt to connect to the remote system. + */ + public void connect(IProgressMonitor monitor) throws Exception; + /** + * Disconnect from the remote system + */ + public void disconnect(IProgressMonitor monitor) throws Exception; + /** + * Notifies all listeners of a disconnection through a communications event + */ + public void notifyDisconnection(); + /** + * Notifies all listeners of a connection through a communications event + */ + public void notifyConnection(); + /** + * Notifies all listeners of an error through a communications event + */ + public void notifyError(); + /** + * Reset after some fundamental change, such as a hostname change. + * Clear any memory of the current connection. + */ + public void reset(); + /** + * Return the version, release, modification of the remote system, + * if connected, if applicable and if available. Else return null. + *

+ * Up to each implementer to decide if this will be cached. + */ + public String getVersionReleaseModification(); + /** + * Return the home directory of the remote system for the current user, if available. + *

+ * Up to each implementer to decide how to implement, and if this will be cached. + */ + public String getHomeDirectory(); + /** + * Return the temp directory of the remote system for the current user, if available. + *

+ * Up to each implementer to decide how to implement, and if this will be cached. + */ + public String getTempDirectory(); + + // -------------------------------------------------------------------- + // Utility methods that offer combined connection and subsystem info... + // -------------------------------------------------------------------- + /** + * Return the system type for this connection. + */ + public String getHostType(); + + /** + * Return the name of this connector service + * @return the name of this connector service + */ + public String getName(); + + public void setHost(IHost host); + + /** + * Return the host + * @return + */ + public IHost getHost(); + + /** + * Return the host name for the connection this system's subsystem is associated with + */ + public String getHostName(); + + /** + * Return the port for this connector + */ + public int getPort(); + + /** + * Set the port for this connector + * @param port + */ + public void setPort(int port); + + /** + * Return the userId for this system's subsystem we are associated with + */ + public String getUserId(); + + /** + * Set the user id for this connector + * @param userId + */ + public void setUserId(String userId); + + + public boolean isUsingSSL(); + + public void setIsUsingSSL(boolean flag); + + /** + * Return the password for this system's subsystem we are associated with. + *

+ * If not currently set in transient memory, prompts the user for a password. + *

+ * Throws InterruptedException if user is prompted and user cancels that prompt. + * @param shell parent for the prompt dialog if needed. Can be null if know password exists. + * @param forcePrompt forces the prompt dialog to be displayed even if the password is currently + * in memory. + */ + public void promptForPassword(Shell shell, boolean forcePrompt) + throws InterruptedException; + /** + * Set the password if you got it from somewhere + */ + public void setPassword(String matchingUserId, String password); + + /** + * Set the password if you got it from somewhere + */ + public void setPassword(String matchingUserId, String password, boolean persist); + + /** + * Clear internal userId cache. Called when user uses the property dialog to + * change his userId. + */ + public void clearUserIdCache(); + /** + * Clear internal password cache. Called when user uses the property dialog to + * change his userId. + */ + public void clearPasswordCache(); + + /** + * Clear internal password cache. Called when user uses the property dialog to + * change his userId. + * @param clearDiskCache if true, clears the password from disk + */ + public void clearPasswordCache(boolean clearDiskCache); + /** + * Return true if password is currently cached. + */ + public boolean isPasswordCached(); + + + /** + * Return true if password is currently cached. + */ + public boolean isPasswordCached(boolean onDisk); + + /** + * Return true if this system can inherit the uid and password of + * other ISystems in this connection + * + * @return true if it can inherit the user/password + */ + public boolean inheritConnectionUserPassword(); + + /* + * Return true if this system can share it's uid and password + * with other ISystems in this connection + * + * @return true if it can share the user/password + */ + public boolean shareUserPasswordWithConnection(); + + /** + * Register a communications listener + */ + public void addCommunicationsListener(ICommunicationsListener listener); + /** + * Remove a communications listener + */ + public void removeCommunicationsListener(ICommunicationsListener listener); + /** + * Returns the suppressSignonPrompt flag. If this is set to true then the user + * will not be prompted to signon, instead an InterruptedException will be thrown + * by the promptForPassword method. + * + * @return boolean + */ + public boolean isSuppressSignonPrompt(); + /** + * Sets the suppressSignonPrompt flag. Tool writers can use this to temporarily + * disable the user from being prompted to signon. This would cause the promptForPassword + * method to throw an InterruptedException instead of prompting. The intent of this + * method is to allow tool writeres to prevent multiple signon prompts during a + * set period of time (such as a series of related communication calls) if the user + * cancels the first prompt. It is the callers responsability to set this value + * back to false when the tool no longer needs to suppress the signon prompt or all + * other tools sharing this connection will be affected. + * + * @param suppressSignonPrompt + */ + public void setSuppressSignonPrompt(boolean suppressSignonPrompt); + + /** + * Returns the value of the 'Remote Server Launcher' containment reference. + * It is bidirectional and its opposite is '{@link org.eclipse.rse.core.subsystems.IServerLauncherProperties#getParentSubSystem Parent Sub System}'. + * + *

+ * Get the remote server launcher, which may be null. This an optional object containing + * properties used to launch the remote server that communicates with this subsystem. + *

+ * + * @return the value of the 'Remote Server Launcher' containment reference. + * @see #setRemoteServerLauncher(IServerLauncherProperties) + * @see org.eclipse.rse.core.subsystems.SubsystemsPackage#getSubSystem_RemoteServerLauncher() + * @see org.eclipse.rse.core.subsystems.IServerLauncherProperties#getParentSubSystem + * @model opposite="parentSubSystem" containment="true" + * @generated + */ + IServerLauncherProperties getRemoteServerLauncherProperties(); + + /** + * Sets the value of the '{@link org.eclipse.rse.core.subsystems.ISubSystem#getRemoteServerLauncher Remote Server Launcher}' containment reference. + * + * Set the remote server launcher, which is an optional object containing + * properties used to launch the remote server that communicates with this subsystem. + * + * @param value the new value of the 'Remote Server Launcher' containment reference. + * @see #getRemoteServerLauncher() + * @generated + */ + void setRemoteServerLauncherProperties(IServerLauncherProperties value); + + boolean hasRemoteServerLauncherProperties(); + + boolean supportsRemoteServerLaunching(); + + /** + * Tell us if this subsystem factory supports server launch properties, which allow the user + * to configure how the server-side code for these subsystems are started. There is a Server + * Launch Setting property page, with a pluggable composite, where users can configure these + * properties. + */ + public boolean supportsServerLaunchProperties(); + + /** + * Report if this connector service can use a user identifier. + * Returns true in default implementation. + * Typically used to indicate if a login dialog needs to be presented when connecting. + * @return true if and only if the connector service can use a user id. + */ + public boolean supportsUserId(); + + /** + * Report if this connector service requires a user id. + * Returns true in default implementation. + * Typically used to indicate if a login dialog can allow an empty user id. + * Must be ignored if supportsUserId() is false. + * @return true or false to indicate if the connector service requires a user id. + */ + public boolean requiresUserId(); + + /** + * Can be used to determine if a password field is present on a login dialog for this connector service. + * The default implementation of this interface should return true. + * @return true if the subsystem can use a password, false if a password is irrelevant. + */ + public boolean supportsPassword(); + + /** + * If a password is supported this is used to determine if the password is required. + * Must be ignored if supportsPassword() returns false. + * The default implementation of this interface should return true. + * @return true if the connector service requires a password, false if a password may be empty. + */ + public boolean requiresPassword(); + + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java similarity index 96% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java index 24f8a9d5a9f..8485f57fe9e 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorServiceManager.java @@ -16,7 +16,8 @@ package org.eclipse.rse.core.subsystems; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; + public interface IConnectorServiceManager diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IFileConstants.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IFileConstants.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IFileConstants.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IFileConstants.java diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteContainer.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteContainer.java new file mode 100644 index 00000000000..530ae4c1135 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteContainer.java @@ -0,0 +1,62 @@ +/******************************************************************************** + * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + +import org.eclipse.rse.core.model.ISystemContainer; +import org.eclipse.rse.core.model.ISystemContentsType; + +/** + * @author dmcknigh + */ +public interface IRemoteContainer extends ISystemContainer +{ + + /** + * Returns whether the object has contents of a particular type associated with the specified filter string. + * @param contentsType type of contents + * @param filter criteria for contained contents + * @return true if the object has contents, false otherwise. + */ + public boolean hasContents(ISystemContentsType contentsType, String filter); + + /** + * Returns the contents of the object. + * @param contentsType type of contents + * @param filter criteria for contained contents. + * @return an array of contents. + */ + public Object[] getContents(ISystemContentsType contentsType, String filter); + + /* + * Replace occurrences of cached object with new object + */ + public void replaceContent(Object oldObject, Object newObject); + + /** + * Sets the contents of this object that match a particular filter + * @param contentsType type of contents + * @param filter matching criteria for the contained objects + * @param con the contained objects that match the filter + */ + public void setContents(ISystemContentsType contentsType, String filter, Object[] con); + + /** + * Copies the persistable contents from this one to another one + * @param container the container to copy contents to + */ + public void copyContentsTo(IRemoteContainer container); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteLineReference.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteLineReference.java new file mode 100644 index 00000000000..c24ce5e2fed --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteLineReference.java @@ -0,0 +1,62 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; +/** + * This interface represents an object that can be used to jump into line in source + */ +public interface IRemoteLineReference +{ + + + /** + * Gets the path to the file that this output references if it references any. It may return null if + * no such association exists. This may be used to jump to an editor from a view which displays + * this + * + * @return the path of the referenced file if there is one + */ + public String getAbsolutePath(); + + /** + * Gets the line number within a file that this references if it references any. By default + * it should return 0. If no file association exists, it also returns 0. This may be used to jump into + * a location within an editor from a view which displays remote output. + * + * @return the line number within a referenced file if there is one. + */ + public int getLine(); + + /** + * Get the start offset in a line corresponding to this reference. -1 indicates there is no offset + * @return the offset + */ + public int getCharStart(); + + /** + * Get the end offset in a line corresponding to this reference. -1 indicates there is no offset + * @return the offset + */ + public int getCharEnd(); + + /** + * Get the object that contains this object. + * + * @return the parent object + */ + public Object getParent(); + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectIdentifier.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectIdentifier.java new file mode 100644 index 00000000000..2ef6338fc29 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectIdentifier.java @@ -0,0 +1,30 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; +public interface IRemoteObjectIdentifier +{ + + + /** + * For drag and drop, and clipboard, support of remote objects. + *

+ * Return the unique ID for the given remote object within the subsystem. + */ + public String getAbsoluteName(Object object); + + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemoteObjectResolver.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectResolver.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemoteObjectResolver.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteObjectResolver.java diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemotePropertyHolder.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemotePropertyHolder.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemotePropertyHolder.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemotePropertyHolder.java diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemoteServerLauncher.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteServerLauncher.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IRemoteServerLauncher.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteServerLauncher.java diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteSystemEnvVar.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteSystemEnvVar.java new file mode 100644 index 00000000000..22b14104325 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IRemoteSystemEnvVar.java @@ -0,0 +1,78 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + + + +// + + +/** + * @lastgen interface RemoteSystemEnvVar {} + */ + +public interface IRemoteSystemEnvVar { + + + + /** + * + * + * @generated + */ + String copyright = "(c) Copyright IBM Corporation 2002, 2004."; + + /** + * @generated This field/method will be replaced during code generation + * @return The value of the Name attribute + * The name of the environment variable to set at connect time + */ + String getName(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the Name attribute + */ + void setName(String value); + + /** + * @generated This field/method will be replaced during code generation + * @return The value of the Value attribute + * The value to set this environment variable to at connect time + */ + String getValue(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the Value attribute + */ + void setValue(String value); + + /** + * @generated This field/method will be replaced during code generation + * @return The value of the AdditionalAttributes attribute + * Additional attributes that may need to be persisted per environment variable. + */ + String getAdditionalAttributes(); + + /** + * @generated This field/method will be replaced during code generation + * @param value The new value of the AdditionalAttributes attribute + */ + void setAdditionalAttributes(String value); + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IServerLauncher.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncher.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IServerLauncher.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncher.java index d6edaad6ac8..8a29c52597d 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/IServerLauncher.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncher.java @@ -18,7 +18,7 @@ package org.eclipse.rse.core.subsystems; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.rse.model.SystemSignonInformation; +import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.services.clientserver.messages.SystemMessage; diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncherProperties.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncherProperties.java new file mode 100644 index 00000000000..d6dd7c913b9 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServerLauncherProperties.java @@ -0,0 +1,51 @@ +/******************************************************************************** + * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; +import org.eclipse.rse.core.model.IRSEModelObject; + + + +/** + * Implement this interface to provide peristable properties for server launching + * All properties to be persisted to be are stored and restored from associated + * IPropertySets + * + */ +public interface IServerLauncherProperties extends IRSEModelObject +{ + + public IServerLauncherProperties cloneServerLauncher(IServerLauncherProperties newOne); + + /** + * Returns the connector service + * @return + */ + public IConnectorService getConnectorService(); + + /** + * Update cached values based on IPropertySets + * + */ + public void restoreFromProperties(); + + /** + * Store cached values based on IPropertySets + * + */ + public void saveToProperties(); + +} // ServerLauncher \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystem.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystem.java new file mode 100644 index 00000000000..1c3c477325d --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystem.java @@ -0,0 +1,24 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + + +public interface IServiceSubSystem extends ISubSystem +{ + public Class getServiceType(); + public void switchServiceFactory(IServiceSubSystemConfiguration factory); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystemConfiguration.java new file mode 100644 index 00000000000..85e8f8ebb03 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IServiceSubSystemConfiguration.java @@ -0,0 +1,38 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + + +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.services.IService; + + + +/** + * This is the interface for the class that is for subsystem-providers who desire not to use MOF. + * + * @lastgen interface DefaultSubSystemConfiguration extends SubSystemConfiguration {} + */ +public interface IServiceSubSystemConfiguration extends ISubSystemConfiguration +{ + public IConnectorService getConnectorService(IHost host); + public void setConnectorService(IHost host, IConnectorService connectorService); + public Class getServiceType(); + public Class getServiceImplType(); + public IService getService(IHost host); + +} //DefaultSubSystemConfiguration \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ISubSystem.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java similarity index 93% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ISubSystem.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java index 4391e02b21a..5d37ad9a027 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ISubSystem.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java @@ -18,19 +18,17 @@ package org.eclipse.rse.core.subsystems; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IRSEModelObject; +import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.persistance.IRSEPersistableContainer; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManager; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManagerProvider; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.filters.ISystemFilterString; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemProfile; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; -import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.PropertyPage; @@ -126,19 +124,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I */ public void checkIsConnected() throws SystemMessageException; - // ------------------------------------- - // GUI methods - // ------------------------------------- - /** - * Return the single property page to show in the tabbed notebook for the - * for SubSystem property of the parent Connection. Return null if no - * page is to be contributed for this. You are limited to a single page, - * so you may have to compress. It is recommended you prompt for the port - * if applicable since the common base subsystem property page is not shown - * To help with this you can use the SystemPortPrompt widget. - */ - public PropertyPage getPropertyPage(Composite parent); - + // --------------------------------------------------- // Methods for business partners to add their own // persisted attributes to the subsystem object... @@ -358,7 +344,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * Connect to the remote system. * In addition to calling getSystem().connect(),this might fire events. * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ public void connect(Shell shell) throws Exception; /** @@ -371,7 +357,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * Connect to the remote system, optionally forcing a signon prompt even if the password * is cached in memory or on disk. * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @param forcePrompt forces the prompt dialog to be displayed even if the password is currently * in memory. */ @@ -493,7 +479,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * type. Be sure to register your adapter factory. * * @param filterString filter pattern for objects to return. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Array of objects that are the result of this filter string */ public Object[] resolveFilterString(String filterString, Shell shell) @@ -506,7 +492,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * filter strings versus a single filter string. * * @param filterStrings array of filter patterns for objects to return. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Array of objects that are the result of resolving all the filter strings */ public Object[] resolveFilterStrings(String[] filterStrings, Shell shell) @@ -535,7 +521,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * * @param parent Object that is being expanded. * @param filterString filter pattern for children of parent. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Array of objects that are the result of this filter string */ public Object[] resolveFilterString(Object parent, String filterString, Shell shell) @@ -545,7 +531,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * Execute a remote command. This is only applicable if the subsystem factory reports * true for supportsCommands(). * @param command Command to be executed remotely. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @param Object context context of a command (i.e. working directory). Null is valid and means to use the default context. * @return Array of objects that are the result of running this command. Typically, these * are messages logged by the command. @@ -567,7 +553,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * @param subject Identifies which object to get the properties of * @param key Identifies property to set * @param value Value to set property to - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Object interpretable by subsystem. Might be a Boolean, or the might be new value for confirmation. */ public Object setProperty(Object subject, String key, String value, Shell shell) @@ -579,7 +565,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * true for supportsProperties(). * @param subject Identifies which object to get the properties of * @param key Identifies property to get value of - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return String The value of the requested key. */ public String getProperty(Object subject, String key, Shell shell) @@ -590,9 +576,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * a number of remote environment variables. This is only applicable if the subsystem factory reports * true for supportsProperties(). * @param subject Identifies which object to get the properties of - * @param keys Identifies properties to set - * @param values Values to set properties to. One to one mapping to keys by index number - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param key Identifies property to set + * @param value Values to set properties to. One to one mapping to keys by index number + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation. */ public Object setProperties(Object subject, String[] keys, String[] values, Shell shell) @@ -603,9 +589,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * a remote environment variable. This is only applicable if the subsystem factory reports * true for supportsProperties(). * @param subject Identifies which object to get the properties of - * @param keys Identifies properties to get value of - * @param shell parent shell used to show error message. Null means you will handle showing the error message. - * @return String[] The values of the requested keys. + * @param key Identifies property to get value of + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. + * @return Object The values of the requested keys. */ public String[] getProperties(Object subject, String[] keys, Shell shell) throws Exception; @@ -658,7 +644,24 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * Returns the parent object associated with a filter reference. It's up to the * subsystem implementation to decide what "parent object" means for a filter reference. * @param filterRef the filter reference to determine a target object from. + * @return */ Object getTargetForFilter(ISystemFilterReference filterRef); + + + +//// ------------------------------------- +// // GUI methods +// // ------------------------------------- +// /** +// * Return the single property page to show in the tabbed notebook for the +// * for SubSystem property of the parent Connection. Return null if no +// * page is to be contributed for this. You are limited to a single page, +// * so you may have to compress. It is recommended you prompt for the port +// * if applicable since the common base subsystem property page is not shown +// * To help with this you can use the SystemPortPrompt widget. +// */ +// public PropertyPage getPropertyPage(Composite parent); + } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java new file mode 100644 index 00000000000..4be2c22494f --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java @@ -0,0 +1,554 @@ +/******************************************************************************** + * Copyright (c) 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.persistance.IRSEPersistableContainer; +import org.eclipse.swt.widgets.Shell; + + +public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer +{ + // --------------------------------- + // CONSTANTS... + // --------------------------------- + public static final boolean FORCE_INTO_MEMORY = true; + public static final boolean LAZILY = false; + + /** + * Reset for a full refresh from disk, such as after a team synch. + */ + public void reset(); + // --------------------------------- + // CRITICAL METHODS... + // --------------------------------- + /** + * Return true if the subsystem supports more than one filter string + *

RETURNS true BY DEFAULT + */ + public boolean supportsMultiStringFilters(); + + /** + * Return true if the subsystem supports the exporting of filter strings from it's filters + *

RETURNS true BY DEFAULT + */ + public boolean supportsFilterStringExport(); + + /** + * Return true if subsystem instances from this factory support connect and disconnect actions + *

Returns true in default implementation. + */ + public boolean supportsSubSystemConnect(); + /** + * Return true (default) or false to indicate if subsystems of this factory support user-editable + * port numbers. + *

Returns true in default implementation. + */ + public boolean isPortEditable(); + /** + * Return true if subsystem instances from this factory support remote command execution + *

Returns false in default implementation, and is usually only true for command subsystems. + */ + public boolean supportsCommands(); + /** + * Return true if subsystem instances from this factory support getting and setting properties + *

Returns false in default implementation, and not actually used yet. + */ + public boolean supportsProperties(); + /** + * Required method for subsystem factory child classes. Return true if you support filters, false otherwise. + * If you support filters, then some housekeeping will be done for you automatically. Specifically, they + * will be saved and restored for you automatically. + *

Returns true in default implementation. + */ + public boolean supportsFilters(); + + /** + * Indicates whether the subsystem supports displaying children under + * its filters. By default, this will return true, but if filters that can't + * be expanded are desired, this can be overridden to return false. + */ + public boolean supportsFilterChildren(); + + /** + * Required method for subsystem factory child classes. Return true if you filter caching. + * If you support filter caching, then the views will always check the in-memory cache for + * filter results before attempting a query. + *

Returns true in default implementation. + */ + public boolean supportsFilterCaching(); + + /** + * Required method for subsystem factory child classes. Return true if you support filters, and you support + * multiple filter strings per filter. Return false to restrict the user to one string per filter. + *

Returns true in default implementation. + */ + public boolean supportsMultipleFilterStrings(); + /** + * Required method for subsystem factory child classes if returning true from supportsFilters. + * Return true if you support filters within filters, false otherwise. + *

Returns false in default implementation. + */ + public boolean supportsNestedFilters(); + /** + * Return true if you support quick filters. These allow the user to subset a remote system object at + * the time they expand it in the remote system explorer tree view. + *

+ * Not supported yet + */ + public boolean supportsQuickFilters(); + + /** + * Return true if filters of this subsystem factory support dropping into. + */ + public boolean supportsDropInFilters(); + + /** + * Return true if filters of this subsystem factory provide a custom implementation of drop support. + * By default, the filter reference adapter treats a drop on a filter as an update to the list of filter + * strings for a filter. For things like files, it is more desirable to treat the drop as a physical + * resource copy, so in that case, custom drop makes sense. + * + * By default this returns false. + */ + public boolean providesCustomDropInFilters(); + + /** + * Return true if you support user-defined actions for the remote system objects returned from expansion of + * subsystems created by this subsystem factory + * @see #getActionSubSystem(ISubSystem) + * @see #supportsUserDefinedActions(ISelection) + *

Returns false in default implementation. + */ + public boolean supportsUserDefinedActions(); + + /** + * Return true if you support compile actions for the remote system objects returned from expansion of + * subsystems created by this subsystem factory. + * @see #getCompileManager() + *

Returns false in default implementation. + */ + public boolean supportsCompileActions(); + /** + * Return true if you support user-defined/managed named file types + *

Returns false in default implementation. + */ + public boolean supportsFileTypes(); + /** + * Tell us if this subsystem factory supports targets, which are destinations for + * pushes and builds. Normally only true for file system factories. + */ + public boolean supportsTargets(); + /** + * Tell us if this subsystem factory supports server launch properties, which allow the user + * to configure how the server-side code for these subsystems are started. There is a Server + * Launch Setting property page, with a pluggable composite, where users can configure these + * properties. + *
By default we return false here. This is overridden in UniversalFileSubSystemConfiguration though. + */ + public boolean supportsServerLaunchProperties(IHost host); + /** + * If {@link #supportsServerLaunchProperties(IHost)} returns true, this method may be called by + * the server launcher to decide if a given remote server launch type is supported or not. + *
We return true by default. + * @see org.eclipse.rse.core.subsystems.ServerLaunchType + * @see #getServerLauncherForm(Shell, ISystemMessageLine) + */ + public boolean supportsServerLaunchType(ServerLaunchType serverLaunchType); + + /** + * Tell us if filter strings are case sensitive. + *

Returns false in default implementation. + */ + public boolean isCaseSensitive(); + + // --------------------------------- + // USER-PREFERENCE METHODS... + // --------------------------------- + /** + * If we support filters, should we show filter pools in the remote system explorer? + * Typically retrieved from user preferences. + */ + public boolean showFilterPools(); + /* + * If we support filters, should we show filter strings in the remote system explorer? + * Typically retrieved from user preferences. + * + public boolean showFilterStrings(); + */ + /** + * If we support filters, should we show filter pools in the remote system explorer? + * This is to set it after the user changes it in the user preferences. It may require + * refreshing the current view. + */ + public void setShowFilterPools(boolean show); + /* + * If we support filters, should we show filter strings in the remote system explorer? + * This is to set it after the user changes it in the user preferences. It may require + * refreshing the current view. + * + public void setShowFilterStrings(boolean show); + */ + + // --------------------------------- + // PROXY METHODS. USED INTERNALLY... + // --------------------------------- + /** + * Private method called by RSEUIPlugin + */ + public void setSubSystemConfigurationProxy(ISubSystemConfigurationProxy proxy); + /** + * Private method + */ + public ISubSystemConfigurationProxy getSubSystemConfigurationProxy(); + + // --------------------------------- + // FACTORY ATTRIBUTE METHODS... + // --------------------------------- + /** + * Return vendor of this factory. + * This comes from the xml "vendor" attribute of the extension point. + */ + public String getVendor(); + /** + * Return name of this factory. Matches value in name attribute in extension point xml + */ + public String getName(); + /** + * Return description of this factory. Comes from translated description string in extension point xml + */ + public String getDescription(); + /** + * Return unique id of this factory. Matches value in id attribute in extension point xml + */ + public String getId(); + + /** + * Return the category this subsystem factory subscribes to. + * @see org.eclipse.rse.model.ISubSystemConfigurationCategories + */ + public String getCategory(); + /** + * Return the system types this subsystem factory supports. + */ + public String[] getSystemTypes(); + + // --------------------------------- + // PROFILE METHODS... + // --------------------------------- + /** + * Called by SystemRegistry when we are about to delete a profile. + *

+ * Our only mission is to delete the filter pool associated with it, + * because the registry has already called deleteSubSystemsByConnection + * for every subsystem of every connection owned by this profile. + */ + public void deletingSystemProfile(ISystemProfile profile); + /** + * Called by SystemRegistry when we have toggled the active-status of a profile + */ + public void changingSystemProfileActiveStatus(ISystemProfile profile, boolean newStatus); + /** + * Get owning profile object given a filter pool object + */ + public ISystemProfile getSystemProfile(ISystemFilterPool pool); + + // --------------------------------- + // SUBSYSTEM METHODS... + // --------------------------------- + + /** + * Called by SystemRegistry's renameSystemProfile method to ensure we update our + * subsystem names within each subsystem. + *

+ * This is called AFTER changing the profile's name!! + */ + public void renameSubSystemProfile(ISubSystem ss, String oldProfileName, String newProfileName); + /** + * Called by SystemRegistry's renameSystemProfile method to pre-test if we are going to run into errors on a + * profile rename, due to file or folder in use. + */ + public void preTestRenameSubSystemProfile(String oldProfileName) throws Exception; + /** + * Called by SystemRegistry's renameConnection method to ensure we update our + * connection names within each subsystem. + *

+ * Must be called prior to changing the connection's name!! + */ + public void renameSubSystemsByConnection(IHost conn, String newConnectionName); + /** + * Called by SystemRegistry's deleteConnection method to ensure we delete all our + * subsystems for a given connection. + */ + public void deleteSubSystemsByConnection(IHost conn); + + /** + * Creates a new subsystem instance that is associated with the given connection object. + * SystemRegistryImpl calls this when a new connection is created, and appliesToSystemType returns true. + * @param conn The connection to create a subsystem for + * @param creatingConnection true if we are creating a connection, false if just creating + * another subsystem for an existing connection. + * @param yourNewConnectionWizardPages The wizard pages you supplied to the New Connection wizard, via the + * {@link org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter#getNewConnectionWizardPages(ISubSystemConfiguration, org.eclipse.jface.wizard.IWizard)} + * method or null if you didn't override this method. + */ + public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISystemNewConnectionWizardPage[] yourNewConnectionWizardPages); + + // used in the case where newsubsystems are added after a connection exists + public ISubSystem createSubSystemAfterTheFact(IHost conn); + + public ISubSystem createSubSystemInternal(IHost conn); + + + /** + * Find or create a connector service for this host + */ + public IConnectorService getConnectorService(IHost host); + + /** + * Overridable entry for child classes to contribute a server launcher instance + * for a given subsystem. + *

+ * Create an instance of ServerLauncher, and add it to the given subsystem. + * When a subsystem is created, and {@link #supportsServerLaunchProperties(IHost)} + * returns true, this method is called to create the server launcher instance + * associated with the subsystem. The default implementation is to create an + * instance of {@link IRemoteServerLauncher}, but override to create your own + * ServerLauncher instance if you have your own class. + */ + public IServerLauncherProperties createServerLauncher(IConnectorService connectorService); + + /** + * Updates user-editable attributes of an existing subsystem instance. + * These attributes typically affect the live connection, so the subsystem will be forced to + * disconnect. + *

+ * The subsystem will be saved to disk. + * @param shell parent shell needed in case an error message is displayed + * @param subsystem target of the update action + * @param updateUserId true if we are updating the userId, else false to ignore userId + * @param userId new local user Id. Ignored if updateUserId is false + * @param updatePort true if we are updating the port, else false to ignore port + * @param port new local port value. Ignored if updatePort is false + */ + public void updateSubSystem(Shell shell, ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port); + /** + * Update the port for the given subsystem instance. + * Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)} + */ + public void setSubSystemPort(Shell shell, ISubSystem subsystem, int port); + /** + * Update the user ID for the given subsystem instance. + * Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)} + */ + public void setSubSystemUserId(Shell shell, ISubSystem subsystem, String userId); + + /** + * Returns true if this factory allows users to delete instances of subsystem objects. + * Would only be true if users are allowed to create multiple instances of subsystem objects + * per connection. + */ + public boolean isSubSystemsDeletable(); + /** + * Deletes a given subsystem instance from the list maintained by this factory. + * SystemRegistryImpl calls this when the user selects to delete a subsystem object, + * or delete the parent connection this subsystem is associated with. + * In former case, this is only called if the factory supports user-deletable subsystems. + */ + public boolean deleteSubSystem(ISubSystem subsystem); + /** + * Clone a given subsystem into the given connection. + * Called when user does a copy-connection action. + * @param oldSubsystem The subsystem to be cloned + * @param newConnection The connection into which to create and clone the old subsystem + * @param copyProfileOperation Pass true if this is an profile-copy operation versus a connection-copy operation + * @return New subsystem within the new connection + */ + public ISubSystem cloneSubSystem(ISubSystem oldSubsystem, IHost newConnection, boolean copyProfileOperation) + throws Exception; + /** + * Returns a list of subsystem objects existing for the given connection. + * @param conn System connection to retrieve subsystems for + * @param force true if we should force all the subsystems to be restored from disk if not already + */ + public ISubSystem[] getSubSystems(IHost conn, boolean force); + /** + * Returns a list of all subsystem objects for all connections. + */ + public ISubSystem[] getSubSystems(boolean force); + /** + * Renames a subsystem. This is better than ss.setName(String newName) as it saves the subsystem to disk. + */ + public void renameSubSystem(ISubSystem subsystem, String newName); + /** + * Disconnect all subsystems currently connected. + * Called by shutdown() of RSEUIPlugin. + */ + public void disconnectAllSubSystems() + throws Exception; + + // --------------------------------- + // FILTER POOL METHODS... + // --------------------------------- + /** + * Get the filter pool manager for the given profile + */ + public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile); + /** + * Copy the filter pool manager and return a new one. Called during profile-copy operations. + * Will also copy all of the filter pools and their respective data. + */ + public ISystemFilterPoolManager copyFilterPoolManager(ISystemProfile oldProfile, ISystemProfile newProfile) + throws Exception; + + /** + * Given a subsystem, return the first (hopefully only) default pool for this + * subsystem's profile. + */ + public ISystemFilterPool getDefaultSystemFilterPool(ISubSystem subsys); + /** + * Test if any filter pools in the given profile are referenced by other profiles, + * which are active. + *

+ * Called when user tries to make a profile inactive. We prevent this if there exists + * active references. + * @param profile The profile being tested + * @return An array of the active subsystems which reference filter pools in this profile, + * or null if none are found. + */ + public ISubSystem[] testForActiveReferences(ISystemProfile profile); + + // --------------------------------- + // FILTER METHODS + // --------------------------------- + /** + * Return the translated string to show in the property sheet for the type property when a filter is selected. + */ + public String getTranslatedFilterTypeProperty(ISystemFilter selectedFilter); + /** + * Return true if we should show the refresh action in the popup for the given element. + */ + public boolean showRefreshOnFilter(); + + /** + * Return true if we should show the show in table action in the popup for the given element. + */ + public boolean showGenericShowInTableOnFilter(); + + + + + /** + * Given a filter, decide whether to show the Filter Strings property page + * for this filter. Default is true. + */ + public boolean showChangeFilterStringsPropertyPage(ISystemFilter filter); + + + /** + * Determines whether this factory is responsible for the creation of subsytems of the specified type + * Subsystem factories should override this to indicate which subsystems they support. + * + * @param subSystemType type of subsystem + * @return whether this factory is for the specified subsystemtype + */ + public boolean isFactoryFor(Class subSystemType); + + // --------------------------------- + // FILTER REFERENCE METHODS + // --------------------------------- + + // --------------------------------- + // STATE METHODS... + // --------------------------------- + /** + * Called by adapters prior to asking for actions, in case the connection of the currently selected + * object is required by the action. + */ + public void setConnection(IHost connection); + /** + * Called by adapters prior to asking for actions. For cases when current selection is needed. + */ + public void setCurrentSelection(Object[] selection); + // --------------------------------- + // SAVE METHODS... + // --------------------------------- + /** + * Saves absolutely everything to disk. This is called as a safety + * measure when the workbench shuts down. + *

+ * Totally handled for you! + *

+ * Calls saveSubSystems() and saveFilterPools() + *

+ * Exceptions are swallowed since we cannot deal with them on shutdown anyway! + */ + public boolean commit(); + /** + * Save one subsystem to disk. + * Called by each subsystem when their data changes. + */ + public void saveSubSystem(ISubSystem subsys) + throws Exception; + + /** + * Private. Do not call or use.
+ * @generated This field/method will be replaced during code generation + * @return The list of SubSystemList references + */ + java.util.List getSubSystemList(); + + /** + * Private. Do not call or use.
+ * @generated This field/method will be replaced during code generation + * @return The list of FilterPoolManagerList references + */ + java.util.List getFilterPoolManagerList(); + + public ISystemFilterPool getDefaultFilterPool(ISystemProfile profile, String oldProfileName); + public ISystemProfile getSystemProfile(String name); + public void renameFilterPoolManager(ISystemProfile profile); + + + +// /** +// * Return the validator for the userId. +// * A default is supplied. +// * Note this is only used for the subsystem's properties, so will not +// * be used by the connection's default. Thus, is only of limited value. +// *

+// * This must be castable to ICellEditorValidator for the property sheet support. +// */ +// public ISystemValidator getUserIdValidator(); +// /** +// * Return the validator for the password which is prompted for at runtime. +// * No default is supplied. +// */ +// public ISystemValidator getPasswordValidator(); +// /** +// * Return the validator for the port. +// * A default is supplied. +// * This must be castable to ICellEditorValidator for the property sheet support. +// */ +// public ISystemValidator getPortValidator(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java new file mode 100644 index 00000000000..709b932f3d6 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfigurationProxy.java @@ -0,0 +1,99 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + +/** + * Interface to SubSystemConfigurationExtension class + * Internal use, not likely you will ever need to use it or access it directly. + */ +public interface ISubSystemConfigurationProxy +{ + /** + * Return value of the name xml attribute. + * Return name of this factory. Matches value in name attribute in extension point xml + */ + public String getName(); + /** + * Return value of the description xml attribute. + * Return description of this factory. Matches value in description attribute in extension point xml + */ + public String getDescription(); + /** + * Return value of the id xml attribute. + * Return unique id of this configuration. + */ + public String getId(); + /** + * Return value of the systemTypes xml attribute. + * Return the system types this subsystem configuration supports. + */ + public String[] getSystemTypes(); + /** + * Return true if this factory supports all system types + */ + public boolean supportsAllSystemTypes(); + + /** + * Return value of the vendor xml attribute. + * Return vendor of this configuration. + */ + public String getVendor(); + /** + * Return value of the category xml attribute. + * Return the category this subsystem configuration subscribes to. + * @see org.eclipse.rse.model.ISubSystemConfigurationCategories + */ + public String getCategory(); + + + /** + * Return true if the subsystem factory has been instantiated yet + */ + public boolean isSubSystemConfigurationActive(); + + /** + * Returns the priority of the subsystem configuration. + */ + public int getPriority(); + + /** + * Return the subsystem factory singleton instance. Will instantiate if not already. + */ + public ISubSystemConfiguration getSubSystemConfiguration(); + /** + * Return an instance of the ISystem class identified by the "systemClass" attribute + * of this subsystemFactory extension point. Note each call to this method returns a + * new instance of the class, or null if no "systemClass" attribute was specified. + */ + public IConnectorService getSystemObject(); + + /** + * Test if the given system type matches one or more of the type names declared in the + * systemTypes attribute of this extension. + */ + public boolean appliesToSystemType(String type); + + /** + * Reset for a full refresh from disk, such as after a team synch. + */ + public void reset(); + + /** + * After a reset, restore from disk + */ + public void restore(); +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java similarity index 98% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java index 058a7a035e5..6f1f36581b3 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/RemoteChildrenContentsType.java @@ -18,12 +18,13 @@ package org.eclipse.rse.core.subsystems; import org.eclipse.rse.core.model.ISystemContentsType; + /** * Represents contents that are children of a container */ public class RemoteChildrenContentsType implements ISystemContentsType { - public static String CONTENTS_TYPE_CHILDREN = "contents_children"; //$NON-NLS-1$ + public static String CONTENTS_TYPE_CHILDREN = "contents_children"; public static RemoteChildrenContentsType _instance = new RemoteChildrenContentsType(); public static RemoteChildrenContentsType getInstance() diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ServerLaunchType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLaunchType.java similarity index 100% rename from rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/ServerLaunchType.java rename to rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLaunchType.java diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/SubSystemFilterNamingPolicy.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/SubSystemFilterNamingPolicy.java new file mode 100644 index 00000000000..167649e6c4d --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/SubSystemFilterNamingPolicy.java @@ -0,0 +1,121 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.core.subsystems; + +import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy; +import org.eclipse.rse.core.filters.SystemFilterNamingPolicy; + +/** + * A filter naming policy is responsible for returning the save file names for + * a given filter framework object. + * This policy implements our naming policy for the filter files in the + * remote systems project. + */ +public class SubSystemFilterNamingPolicy + extends SystemFilterNamingPolicy + implements IRSEFilterNamingPolicy +{ + + /** + * Constructor for SubSystemFilterNamingPolicy + */ + public SubSystemFilterNamingPolicy() + { + super(); + } + + /** + * Get the unqualified save file name for the given SystemFilterPoolManager object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns "filterPools_"+managerName by default. + */ + public String getManagerSaveFileName(String managerName) + { + return super.getManagerSaveFileName(managerName); + } + /** + * Get the unqualified save file name for the given SystemFilterPoolReferenceManager object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns "filterPoolRefs_"+managerName by default. + */ + public String getReferenceManagerSaveFileName(String managerName) + { + return super.getReferenceManagerSaveFileName(managerName); + } + /** + * Get the unqualified save file name for the given SystemFilterPool object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns getFilterPoolSaveFileNamePrefix()+poolName by default. + */ + public String getFilterPoolSaveFileName(String poolName) + { + return super.getFilterPoolSaveFileName(poolName); + } + /** + * Get the file name prefix for all pool files. + * Used to deduce the saved pools by examining the file system + *

+ * By default returns "filterPool_" + */ + public String getFilterPoolSaveFileNamePrefix() + { + return super.getFilterPoolSaveFileNamePrefix(); + } + /** + * Get the folder name for the given SystemFilterPool object. + *

+ * Returns getFilterPoolFolderNamePrefix()+poolName by default. + */ + public String getFilterPoolFolderName(String poolName) + { + return super.getFilterPoolFolderName(poolName); + } + /** + * Get the folder name prefix for all pool folders. + * Used to deduce the saved pools by examining the file system + *

+ * By default returns "FilterPool_" + */ + public String getFilterPoolFolderNamePrefix() + { + return super.getFilterPoolFolderNamePrefix(); + } + /** + * Get the unqualified save file name for the given SystemFilter object. + * Do NOT include the extension, as .xmi will be added. + *

+ * Returns getFilterSaveFileNamePrefix()+filterName by default. + */ + public String getFilterSaveFileName(String filterName) + { + return super.getFilterSaveFileName(filterName); + } + /** + * Get the file name prefix for all filter files. + * Used to deduce the saved filters by examining the file system + *

+ * Returns "Filter_" by default. + */ + public String getFilterSaveFileNamePrefix() + { + return super.getFilterSaveFileNamePrefix(); + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemKillProcessAction.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemKillProcessAction.java index 57c85c1da2b..90b5d39361d 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemKillProcessAction.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemKillProcessAction.java @@ -27,10 +27,11 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.processes.ui.ProcessesPlugin; import org.eclipse.rse.processes.ui.SystemProcessesResources; @@ -43,6 +44,7 @@ import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSyste import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; +import org.eclipse.rse.ui.actions.SystemBaseAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.swt.widgets.Shell; @@ -145,7 +147,7 @@ public class SystemKillProcessAction extends SystemBaseDialogAction implements I */ protected IRunnableContext getRunnableContext() { - ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); IRunnableContext irc = sr.getRunnableContext(); if (irc == null) irc = new ProgressMonitorDialog(getShell()); @@ -239,7 +241,7 @@ public class SystemKillProcessAction extends SystemBaseDialogAction implements I // update the ui - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); for (int i = 0; i < results.size(); i++) { ISystemFilterReference ref = (ISystemFilterReference)results.get(i); diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemNewProcessFilterAction.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemNewProcessFilterAction.java index 2051995f595..d77a8effb56 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemNewProcessFilterAction.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/actions/SystemNewProcessFilterAction.java @@ -16,7 +16,7 @@ package org.eclipse.rse.processes.ui.actions; -import org.eclipse.rse.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.processes.ui.SystemProcessFilterStringEditPane; import org.eclipse.rse.processes.ui.SystemProcessesResources; import org.eclipse.rse.ui.ISystemIconConstants; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/RemoteProcessesDialog.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/RemoteProcessesDialog.java index 98438f62b55..47f199e4914 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/RemoteProcessesDialog.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/RemoteProcessesDialog.java @@ -21,7 +21,7 @@ import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.rse.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.processes.ui.SystemProcessesResources; import org.eclipse.rse.services.clientserver.processes.IHostProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/SystemKillTableProvider.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/SystemKillTableProvider.java index ba66cc6a0c8..01c71d7ffe3 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/SystemKillTableProvider.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/dialogs/SystemKillTableProvider.java @@ -19,6 +19,7 @@ package org.eclipse.rse.processes.ui.dialogs; import java.util.Iterator; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.rse.ui.dialogs.SystemDeleteTableProvider; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/propertypages/ProcessServicesPropertyPage.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/propertypages/ProcessServicesPropertyPage.java index 08966d237dd..385b4fb62bb 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/propertypages/ProcessServicesPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/propertypages/ProcessServicesPropertyPage.java @@ -19,10 +19,10 @@ package org.eclipse.rse.processes.ui.propertypages; import java.util.ArrayList; import java.util.List; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystemConfiguration; import org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystem; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/RemoteProcessSubSystemConfigurationAdapter.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/RemoteProcessSubSystemConfigurationAdapter.java index e53d141129f..e29c855983b 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/RemoteProcessSubSystemConfigurationAdapter.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/RemoteProcessSubSystemConfigurationAdapter.java @@ -19,9 +19,9 @@ package org.eclipse.rse.processes.ui.view; import java.util.Vector; import org.eclipse.jface.action.IAction; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; import org.eclipse.rse.processes.ui.actions.SystemNewProcessFilterAction; import org.eclipse.rse.processes.ui.actions.SystemProcessUpdateFilterAction; import org.eclipse.rse.ui.view.SubSystemConfigurationAdapter; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewProcessAdapterFactory.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewProcessAdapterFactory.java index 2b6242a6ea0..1f7bf8e170b 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewProcessAdapterFactory.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewProcessAdapterFactory.java @@ -16,6 +16,7 @@ package org.eclipse.rse.processes.ui.view; +import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; diff --git a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewRemoteProcessAdapter.java b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewRemoteProcessAdapter.java index bdf188a334a..7995116d4ad 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewRemoteProcessAdapter.java +++ b/rse/plugins/org.eclipse.rse.processes.ui/src/org/eclipse/rse/processes/ui/view/SystemViewRemoteProcessAdapter.java @@ -107,13 +107,13 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter public ImageDescriptor getImageDescriptor(Object element) { //return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_PROCESS_ID); - return ProcessesPlugin.getDefault().getImageDescriptorFromPath("icons/full/obj16/activeprocess_obj.gif"); //$NON-NLS-1$ + return ProcessesPlugin.getDefault().getImageDescriptorFromPath("icons/full/obj16/activeprocess_obj.gif"); } public String getText(Object element) { String text = ((IRemoteProcess) element).getLabel(); - return (text == null) ? "" : text; //$NON-NLS-1$ + return (text == null) ? "" : text; } /** @@ -129,7 +129,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter public String getAbsoluteName(Object object) { IRemoteProcess process = (IRemoteProcess) object; - return "" + process.getPid(); //$NON-NLS-1$ + return "" + process.getPid(); } public String getType(Object element) @@ -259,7 +259,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getGid(); //$NON-NLS-1$ + return "" + process.getGid(); } else { @@ -274,7 +274,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getPid(); //$NON-NLS-1$ + return "" + process.getPid(); } else { @@ -285,7 +285,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getPPid(); //$NON-NLS-1$ + return "" + process.getPPid(); } else { @@ -307,7 +307,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getTgid(); //$NON-NLS-1$ + return "" + process.getTgid(); } else { @@ -318,7 +318,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getTracerPid(); //$NON-NLS-1$ + return "" + process.getTracerPid(); } else { @@ -329,7 +329,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter { if (formatted) { - return "" + process.getUid(); //$NON-NLS-1$ + return "" + process.getUid(); } else { @@ -368,18 +368,18 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter protected String formatState(String state) { - if (state == null) return ""; //$NON-NLS-1$ + if (state == null) return ""; state = state.trim(); - String longState = ""; //$NON-NLS-1$ - String[] allStates = state.split(","); //$NON-NLS-1$ + String longState = ""; + String[] allStates = state.split(","); if (allStates == null) return longState; SystemProcessStatesContentProvider zstates = new SystemProcessStatesContentProvider(); for (int i = 0; i < allStates.length; i++) { - longState = longState + allStates[i].charAt(0) + "-" + zstates.getStateString(allStates[i]); //$NON-NLS-1$ + longState = longState + allStates[i].charAt(0) + "-" + zstates.getStateString(allStates[i]); if (i < allStates.length - 1) - longState = longState + ", "; //$NON-NLS-1$ + longState = longState + ", "; } return longState; } @@ -392,7 +392,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter IRemoteProcess process = (IRemoteProcess) element; IRemoteProcess parent = process.getParentRemoteProcess(); if (parent != null) return parent.getAbsolutePath(); - else return "/proc/0"; //$NON-NLS-1$ + else return "/proc/0"; } /** @@ -422,8 +422,8 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter String[] pids = EMPTY_STRING_LIST; IRemoteProcess process = (IRemoteProcess) element; - String parentName = "" + process.getPPid(); //$NON-NLS-1$ - if (parentName.equals("-1")) // given a root? //$NON-NLS-1$ + String parentName = "" + process.getPPid(); + if (parentName.equals("-1")) // given a root? return pids; // not much we can do. Should never happen: you can't rename a root! Object[] children = getChildren(process.getParentRemoteProcess()); @@ -432,7 +432,7 @@ public class SystemViewRemoteProcessAdapter extends AbstractSystemViewAdapter pids = new String[children.length]; for (int idx = 0; idx < pids.length; idx++) - pids[idx] = "" + ((IRemoteProcess) children[idx]).getPid(); //$NON-NLS-1$ + pids[idx] = "" + ((IRemoteProcess) children[idx]).getPid(); return pids; } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java index d8bf4f30223..b90c137f4a0 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java @@ -20,11 +20,11 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteCmdSubSystem; import org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteCommandShell; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.shells.ui.view.SystemCommandsUI; import org.eclipse.rse.shells.ui.view.SystemCommandsViewPart; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java index eb165ddb8a1..aabc608a6dc 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java @@ -16,8 +16,8 @@ package org.eclipse.rse.shells.ui; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISubSystemConfigurationCategories; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.model.ISystemResourceChangeEvent; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.subsystems.files.core.model.ISystemRemoteCommand; diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java index 1520a6ef7d5..5afdec48ad7 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java @@ -22,9 +22,9 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.shells.ui.RemoteCommandHelpers; import org.eclipse.rse.shells.ui.ShellResources; diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/propertypages/ShellServicesPropertyPage.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/propertypages/ShellServicesPropertyPage.java index 78f62b11f17..16bd5b0de74 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/propertypages/ShellServicesPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/propertypages/ShellServicesPropertyPage.java @@ -19,11 +19,11 @@ package org.eclipse.rse.shells.ui.propertypages; import java.util.ArrayList; import java.util.List; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.model.DummyHost; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystemConfiguration; import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ShellServiceSubSystem; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java index 1bce5476d86..6f4ba95bb8e 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java @@ -27,9 +27,9 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteOutput; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.shells.ui.ShellResources; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemBuildErrorViewPart.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemBuildErrorViewPart.java index 1f097036e3e..0ba643fa852 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemBuildErrorViewPart.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemBuildErrorViewPart.java @@ -27,11 +27,12 @@ import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.IRemoteLineReference; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvent; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeListener; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; @@ -208,7 +209,7 @@ public class SystemBuildErrorViewPart extends ViewPart implements ISelectionList ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService(); selectionService.addSelectionListener(this); - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.addSystemResourceChangeListener(this); @@ -251,7 +252,7 @@ public class SystemBuildErrorViewPart extends ViewPart implements ISelectionList selectionService.removeSelectionListener(this); _viewer.dispose(); - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.removeSystemResourceChangeListener(this); super.dispose(); } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java index 6967cddfff5..7b88974e0d5 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java @@ -35,12 +35,13 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvent; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeListener; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.shells.ui.RemoteCommandHelpers; import org.eclipse.rse.shells.ui.ShellResources; @@ -314,7 +315,7 @@ public class SystemCommandsViewPart SystemWidgetHelpers.setHelp(_folder, RSEUIPlugin.HELPPREFIX + "ucmd0000"); //$NON-NLS-1$ - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); @@ -336,7 +337,7 @@ public class SystemCommandsViewPart selectionService.removeSelectionListener(this); _folder.dispose(); - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.removeSystemResourceChangeListener(this); super.dispose(); } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileAPIProviderImpl.java index 48adcc4099b..c99030c1f39 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileAPIProviderImpl.java @@ -15,9 +15,9 @@ ********************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.subsystems.files.core.model.ISystemFileAPIProvider; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.ui.RSEUIPlugin; @@ -33,7 +33,7 @@ public class SystemFileAPIProviderImpl { - protected ISystemRegistry sr = null; + protected SystemRegistry sr = null; protected boolean directoryMode = false; //protected Object[] emptyList = new Object[0]; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemAPIProviderImpl.java index 24ccce5b793..451f7999df8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemAPIProviderImpl.java @@ -16,7 +16,7 @@ package org.eclipse.rse.internal.subsystems.files.core; import org.eclipse.core.runtime.Platform; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.subsystems.files.core.model.ISystemFileAPIProvider; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java index 99f27420857..96fa640a9a2 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/SystemFileSubSystemConfigurationAPIProviderImpl.java @@ -16,8 +16,8 @@ package org.eclipse.rse.internal.subsystems.files.core; import org.eclipse.core.runtime.Platform; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.subsystems.files.core.model.ISystemFileAPIProvider; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileAPIProvider.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileAPIProvider.java index 7dcc4465da1..62a9d84f802 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileAPIProvider.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/ISystemFileAPIProvider.java @@ -15,7 +15,7 @@ ********************************************************************************/ package org.eclipse.rse.subsystems.files.core.model; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.ui.view.ISystemViewInputProvider; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java index 2f89405b1f3..f988d74d2c7 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java @@ -19,10 +19,10 @@ package org.eclipse.rse.subsystems.files.core.model; import java.util.ArrayList; import java.util.List; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration; import org.eclipse.rse.ui.RSEUIPlugin; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java index 1a2bec00f1c..8bd09c147ca 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemotePath.java @@ -17,9 +17,9 @@ package org.eclipse.rse.subsystems.files.core.model; import org.eclipse.rse.core.SystemBasePlugin; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemProfile; -import org.eclipse.rse.model.ISystemRegistry; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java index b7bfb8299df..aa19736bdb3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java @@ -16,7 +16,7 @@ package org.eclipse.rse.subsystems.files.core.servicesubsystem; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.services.files.IHostFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index 3b489fec531..3e095769cee 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -22,11 +22,11 @@ import java.io.InputStream; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.rse.core.SystemBasePlugin; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.PathUtility; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; import org.eclipse.rse.services.clientserver.SystemSearchString; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystemConfiguration.java index 63ab897d457..0dee9969d5a 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystemConfiguration.java @@ -19,7 +19,7 @@ package org.eclipse.rse.subsystems.files.core.servicesubsystem; import java.util.HashMap; import java.util.Map; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.services.IService; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.search.ISearchService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystem.java index fb04a645bca..6e56d32c144 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystem.java @@ -17,7 +17,7 @@ package org.eclipse.rse.subsystems.files.core.servicesubsystem; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystem; +import org.eclipse.rse.core.subsystems.IServiceSubSystem; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystemConfiguration.java index 03356f09447..4e3856da31c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/IFileServiceSubSystemConfiguration.java @@ -17,9 +17,9 @@ package org.eclipse.rse.subsystems.files.core.servicesubsystem; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/OutputRefresh.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/OutputRefresh.java index a68fd85884e..4edce04d152 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/OutputRefresh.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/OutputRefresh.java @@ -16,8 +16,8 @@ package org.eclipse.rse.subsystems.files.core.servicesubsystem; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.services.search.IHostSearchConstants; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; @@ -39,7 +39,7 @@ public class OutputRefresh implements Runnable if (searchConfig != null) { - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.fireEvent(new SystemResourceChangeEvent(searchConfig, ISystemResourceChangeEvents.EVENT_REFRESH, null)); if (isDone) diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFile.java index 57ceb265b49..830dc260834 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFile.java @@ -18,9 +18,9 @@ package org.eclipse.rse.subsystems.files.core.subsystems; import java.util.Date; import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IRemoteContainer; import org.eclipse.rse.core.subsystems.IRemotePropertyHolder; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.files.IHostFile; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java index 5beacc7e464..f9da1f93776 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java @@ -30,10 +30,10 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.MultiRule; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemContentsType; import org.eclipse.rse.core.subsystems.IRemoteContainer; import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.StringComparePatternMatcher; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index f8e86006cb3..3dbb5e92875 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -35,6 +35,9 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemMessageObject; import org.eclipse.rse.core.model.SystemChildrenContentsType; import org.eclipse.rse.core.model.SystemMessageObject; @@ -42,11 +45,9 @@ import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IRemoteContainer; +import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType; import org.eclipse.rse.core.subsystems.SubSystem; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.filters.ISystemFilterString; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.model.SystemRemoteResourceSet; import org.eclipse.rse.services.clientserver.FileTypeMatcher; import org.eclipse.rse.services.clientserver.IClientServerConstants; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java index 7b3ce41d4ad..7aac9d8f4b6 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystemConfiguration.java @@ -18,20 +18,20 @@ package org.eclipse.rse.subsystems.files.core.subsystems; import java.util.Vector; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; import org.eclipse.rse.core.subsystems.IFileConstants; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.subsystems.files.core.SystemFileResources; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; import org.eclipse.rse.subsystems.files.core.util.ValidatorFileFilterString; import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ValidatorFileName; import org.eclipse.rse.ui.validators.ValidatorFolderName; -import org.eclipse.rse.ui.wizards.ISystemNewConnectionWizardPage; /** diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/old/SearchResultsChangeListener.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/old/SearchResultsChangeListener.java index 29a5f6668b1..3198a3de2c9 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/old/SearchResultsChangeListener.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/old/SearchResultsChangeListener.java @@ -24,11 +24,12 @@ import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.extra.internal.extra.DomainEvent; import org.eclipse.dstore.extra.internal.extra.IDomainListener; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; @@ -156,7 +157,7 @@ public class SearchResultsChangeListener implements IDomainListener, ICommunicat } private void handleSearchResults() { - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); // append new results to existing results List results = _status.getNestedData(); @@ -353,7 +354,7 @@ public class SearchResultsChangeListener implements IDomainListener, ICommunicat _searchConfig.setStatus(IRemoteSearchConstants.DISCONNECTED); } - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.fireEvent(new SystemResourceChangeEvent(_searchConfig, ISystemResourceChangeEvents.EVENT_SEARCH_FINISHED, null)); } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemConfiguration.java index 538a2842ae8..8610ae38bbb 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemConfiguration.java @@ -18,10 +18,10 @@ package org.eclipse.rse.subsystems.files.dstore.subsystem; import org.eclipse.rse.connectorservice.dstore.DStoreConnectorService; import org.eclipse.rse.connectorservice.dstore.DStoreConnectorServiceManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.dstore.IDStoreService; import org.eclipse.rse.services.dstore.files.DStoreFileService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreWindowsFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreWindowsFileSubSystemConfiguration.java index b620fa62b63..fa61baf37e1 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreWindowsFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreWindowsFileSubSystemConfiguration.java @@ -3,9 +3,9 @@ package org.eclipse.rse.subsystems.files.dstore.subsystem; import java.util.Vector; import org.eclipse.rse.core.SystemBasePlugin; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.subsystems.files.core.SystemFileResources; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java index a956e1e9843..7015c4153a8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java @@ -28,12 +28,13 @@ import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.extra.internal.extra.DomainEvent; import org.eclipse.dstore.extra.internal.extra.IDomainListener; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.subsystems.files.core.SystemFileResources; import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem; import org.eclipse.rse.subsystems.files.dstore.model.DStoreFile; @@ -54,7 +55,7 @@ public class RemoteFilePropertyChangeListener implements IDomainListener, protected Shell shell; - protected ISystemRegistry _registry; + protected SystemRegistry _registry; protected IConnectorService system; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/FTPFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/FTPFileSubSystemConfiguration.java index 8c0c1a915df..d196b1fef97 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/FTPFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/FTPFileSubSystemConfiguration.java @@ -16,10 +16,10 @@ package org.eclipse.rse.subsystems.files.ftp; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.ftp.IFTPService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorService.java b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorService.java index 9cf233f48df..2e51a71bd79 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorService.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorService.java @@ -17,9 +17,9 @@ package org.eclipse.rse.subsystems.files.ftp.connectorservice; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.subsystems.AbstractConnectorService; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.SystemSignonInformation; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.ftp.FTPService; import org.eclipse.rse.subsystems.files.core.SystemFileResources; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorServiceManager.java index 2996981261e..3e6eabe1294 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.ftp/src/org/eclipse/rse/subsystems/files/ftp/connectorservice/FTPConnectorServiceManager.java @@ -17,10 +17,10 @@ package org.eclipse.rse.subsystems.files.ftp.connectorservice; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.AbstractConnectorServiceManager; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/subsystems/files/local/LocalFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/subsystems/files/local/LocalFileSubSystemConfiguration.java index 277f8dc7252..a7287653f59 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/subsystems/files/local/LocalFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.local/src/org/eclipse/rse/subsystems/files/local/LocalFileSubSystemConfiguration.java @@ -21,12 +21,12 @@ import java.util.Vector; import org.eclipse.rse.connectorservice.local.LocalConnectorService; import org.eclipse.rse.connectorservice.local.LocalConnectorServiceManager; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.local.ILocalService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/subsystems/files/ssh/SftpFileSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/subsystems/files/ssh/SftpFileSubSystemConfiguration.java index 5a4434e766f..08a9b0d1d7e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/subsystems/files/ssh/SftpFileSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/subsystems/files/ssh/SftpFileSubSystemConfiguration.java @@ -13,10 +13,10 @@ package org.eclipse.rse.subsystems.files.ssh; import org.eclipse.rse.connectorservice.ssh.SshConnectorService; import org.eclipse.rse.connectorservice.ssh.SshConnectorServiceManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.SystemSearchString; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.dstore/src/org/eclipse/rse/subsystems/processes/dstore/DStoreProcessSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.processes.dstore/src/org/eclipse/rse/subsystems/processes/dstore/DStoreProcessSubSystemConfiguration.java index 206697d9dd1..401bbe07a9d 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.dstore/src/org/eclipse/rse/subsystems/processes/dstore/DStoreProcessSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.dstore/src/org/eclipse/rse/subsystems/processes/dstore/DStoreProcessSubSystemConfiguration.java @@ -18,9 +18,9 @@ package org.eclipse.rse.subsystems.processes.dstore; import org.eclipse.rse.connectorservice.dstore.DStoreConnectorService; import org.eclipse.rse.connectorservice.dstore.DStoreConnectorServiceManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.dstore.IDStoreService; import org.eclipse.rse.services.dstore.processes.DStoreProcessService; import org.eclipse.rse.services.processes.IProcessService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.local/src/org/eclipse/rse/subsystems/processes/local/LocalProcessSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.processes.local/src/org/eclipse/rse/subsystems/processes/local/LocalProcessSubSystemConfiguration.java index 9310a45453b..b901ddee4f4 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.local/src/org/eclipse/rse/subsystems/processes/local/LocalProcessSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.local/src/org/eclipse/rse/subsystems/processes/local/LocalProcessSubSystemConfiguration.java @@ -19,9 +19,9 @@ package org.eclipse.rse.subsystems.processes.local; import org.eclipse.rse.connectorservice.local.LocalConnectorService; import org.eclipse.rse.connectorservice.local.LocalConnectorServiceManager; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.local.ILocalService; import org.eclipse.rse.services.local.processes.LocalProcessService; import org.eclipse.rse.services.processes.IProcessService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/servicesubsystem/OutputRefreshJob.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/servicesubsystem/OutputRefreshJob.java index b03afede9df..48d2f1ce7bb 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/servicesubsystem/OutputRefreshJob.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/servicesubsystem/OutputRefreshJob.java @@ -19,8 +19,9 @@ package org.eclipse.rse.internal.subsystems.shells.servicesubsystem; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.rse.model.ISystemRegistry; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.subsystems.shells.core.ShellStrings; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; @@ -73,7 +74,7 @@ public class OutputRefreshJob extends UIJob { try { - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); if (_outputs != null) { registry.fireEvent( diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java index e515524bca6..be3d50fafb9 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java @@ -26,15 +26,16 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IPropertySet; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IRemoteSystemEnvVar; import org.eclipse.rse.core.subsystems.SubSystem; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; @@ -704,7 +705,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd public void run() { - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.fireEvent(new SystemResourceChangeEvent(_ss, ISystemResourceChangeEvents.EVENT_REFRESH, _ss)); } } @@ -722,7 +723,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd public void run() { - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.fireEvent(new SystemResourceChangeEvent(_cmdShell, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_REMOVED, null)); registry.fireEvent(new SystemResourceChangeEvent(_ss, ISystemResourceChangeEvents.EVENT_REFRESH, _ss)); } @@ -875,7 +876,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd } } - ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); + SystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); registry.fireEvent(new SystemResourceChangeEvent(this, ISystemResourceChangeEvents.EVENT_REFRESH, this)); return cmdShell; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystemConfiguration.java index da3e7d30f0e..74cb509f8c0 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystemConfiguration.java @@ -16,10 +16,10 @@ package org.eclipse.rse.internal.subsystems.shells.subsystems; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.subsystems.SubSystemConfiguration; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystemConfiguration; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCommandShell.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCommandShell.java index 2e5eb6ebf13..68aeb831c5e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCommandShell.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCommandShell.java @@ -21,9 +21,9 @@ import java.util.List; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Platform; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystem.java index 6254bd7d147..564e815911f 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystem.java @@ -17,7 +17,7 @@ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystem; +import org.eclipse.rse.core.subsystems.IServiceSubSystem; import org.eclipse.rse.services.shells.IShellService; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystemConfiguration.java index 9439ce2ed61..c0db48e0d31 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/IShellServiceSubSystemConfiguration.java @@ -17,8 +17,8 @@ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; -import org.eclipse.rse.model.IHost; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.services.shells.IHostShell; import org.eclipse.rse.services.shells.IShellService; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java index c8d99f82b1b..81952430b08 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java @@ -23,10 +23,10 @@ import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.SystemBasePlugin; -import org.eclipse.rse.core.servicesubsystem.IServiceSubSystemConfiguration; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; +import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteCmdSubSystem; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.shells.IHostShell; import org.eclipse.rse.services.shells.IShellService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystemConfiguration.java index 0f25bbd3f2a..89eed108df3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystemConfiguration.java @@ -21,8 +21,8 @@ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; import java.util.HashMap; import java.util.Map; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.internal.subsystems.shells.subsystems.RemoteCmdSubSystemConfiguration; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.services.IService; import org.eclipse.rse.services.shells.IHostShell; import org.eclipse.rse.services.shells.IShellService; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java index 4c22e52adfa..4f3ec54c48c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java @@ -56,29 +56,30 @@ import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemElapsedTimer; import org.eclipse.rse.core.SystemPopupMenuActionContributorManager; import org.eclipse.rse.core.SystemPreferencesManager; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterContainer; +import org.eclipse.rse.core.filters.ISystemFilterContainerReference; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.filters.ISystemFilterStringReference; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemContainer; import org.eclipse.rse.core.model.ISystemMessageObject; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.references.IRSEBaseReferencingObject; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterContainer; -import org.eclipse.rse.filters.ISystemFilterContainerReference; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolReference; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManager; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManagerProvider; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.filters.ISystemFilterString; -import org.eclipse.rse.filters.ISystemFilterStringReference; -import org.eclipse.rse.model.IHost; import org.eclipse.rse.model.ISystemPromptableObject; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemRemoteChangeEvent; import org.eclipse.rse.model.ISystemRemoteChangeEvents; import org.eclipse.rse.model.ISystemRemoteChangeListener; import org.eclipse.rse.model.ISystemResourceChangeEvent; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeListener; +import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemRemoteElementResourceSet; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.ISystemContextMenuConstants; @@ -415,7 +416,7 @@ public class SystemView extends TreeViewer implements ISystemTree, // ----------------------------- // Enable right-click popup menu // ----------------------------- - menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ + menuMgr = new MenuManager("#PopupMenu"); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(this); Menu menu = menuMgr.createContextMenu(getTree()); @@ -519,7 +520,7 @@ public class SystemView extends TreeViewer implements ISystemTree, { if ((event.character == SWT.DEL) && (event.stateMask == 0) && (((IStructuredSelection)getSelection()).size()>0) ) { - scanSelections("handleKeyPressed"); //$NON-NLS-1$ + scanSelections("handleKeyPressed"); /* DKM - 53694 if (showDelete() && canDelete()) { @@ -859,7 +860,7 @@ public class SystemView extends TreeViewer implements ISystemTree, // WHEN THAT CHANGES, WILL CALL CANDELETE() HERE. THAT IN TURN WILL CALL SCANSELECTIONS. // THIS MEANS SCAN SELECTIONS GETS CALL TWICE ON MOST RIGHT CLICK ACTIONS. if (!selectionFlagsUpdated) // might already be called by the global delete action wh - scanSelections("fillContextMenu"); //$NON-NLS-1$ + scanSelections("fillContextMenu"); // ADD COMMON ACTIONS... @@ -1189,13 +1190,13 @@ public class SystemView extends TreeViewer implements ISystemTree, return; else { - logMyDebugMessage(this.getClass().getName(),": -----------------------------------------------------------"); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE SSFID.......: " + element.getSubSystemConfigurationId(firstSelection)); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE NAME........: " + element.getName(firstSelection)); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE TYPECATEGORY: " + element.getRemoteTypeCategory(firstSelection)); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE TYPE........: " + element.getRemoteType(firstSelection)); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE SUBTYPE.....: " + element.getRemoteSubType(firstSelection)); //$NON-NLS-1$ - logMyDebugMessage(this.getClass().getName(),": REMOTE SUBSUBTYPE..: " + element.getRemoteSubSubType(firstSelection)); //$NON-NLS-1$ + logMyDebugMessage(this.getClass().getName(),": -----------------------------------------------------------"); + logMyDebugMessage(this.getClass().getName(),": REMOTE SSFID.......: " + element.getSubSystemConfigurationId(firstSelection)); + logMyDebugMessage(this.getClass().getName(),": REMOTE NAME........: " + element.getName(firstSelection)); + logMyDebugMessage(this.getClass().getName(),": REMOTE TYPECATEGORY: " + element.getRemoteTypeCategory(firstSelection)); + logMyDebugMessage(this.getClass().getName(),": REMOTE TYPE........: " + element.getRemoteType(firstSelection)); + logMyDebugMessage(this.getClass().getName(),": REMOTE SUBTYPE.....: " + element.getRemoteSubType(firstSelection)); + logMyDebugMessage(this.getClass().getName(),": REMOTE SUBSUBTYPE..: " + element.getRemoteSubSubType(firstSelection)); } } } @@ -1204,7 +1205,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (!debugProperties) return; //RSEUIPlugin.logDebugMessage(prefix, msg); - System.out.println(prefix+" "+msg); //$NON-NLS-1$ + System.out.println(prefix+" "+msg); } /** @@ -1421,7 +1422,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (doTimings && (item instanceof TreeItem) && (((TreeItem)item).getData() != null)) { elapsedTime.setEndTime(); - System.out.println("Time to expand for " + ((TreeItem)item).getItemCount() + " items: " + elapsedTime); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Time to expand for " + ((TreeItem)item).getItemCount() + " items: " + elapsedTime); } } @@ -1809,7 +1810,7 @@ public class SystemView extends TreeViewer implements ISystemTree, case EVENT_ADD_RELATIVE: if (debug) { - logDebugMsg("SV event: EVENT_ADD "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_ADD "); } clearSelection(); //refresh(parent); @@ -1850,7 +1851,7 @@ public class SystemView extends TreeViewer implements ISystemTree, case EVENT_ADD_MANY: if (debug) { - logDebugMsg("SV event: EVENT_ADD_MANY"); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_ADD_MANY"); } multiSource = _event.getMultiSource(); clearSelection(); @@ -1892,7 +1893,7 @@ public class SystemView extends TreeViewer implements ISystemTree, for (int idx=0; idx 0) { @@ -2099,7 +2100,7 @@ public class SystemView extends TreeViewer implements ISystemTree, //break; case EVENT_REFRESH: if (debug) - logDebugMsg("SV event: EVENT_REFRESH "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REFRESH "); //if (src != null) // refresh(src); // ONLY VALID WHEN USER TRULY WANTS TO REQUERY CHILDREN FROM HOST //else @@ -2117,7 +2118,7 @@ public class SystemView extends TreeViewer implements ISystemTree, // todo: intelligently re-select previous selections case EVENT_REFRESH_SELECTED_PARENT: if (debug) - logDebugMsg("SV event: EVENT_REFRESH_SELECTED_PARENT "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REFRESH_SELECTED_PARENT "); TreeItem[] items = getTree().getSelection(); if ((items != null) && (items.length > 0) && (items[0] != null)) { @@ -2136,7 +2137,7 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_REFRESH_SELECTED: if (debug) - logDebugMsg("SV event: EVENT_REFRESH_SELECTED "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REFRESH_SELECTED "); IStructuredSelection selected = (IStructuredSelection)getSelection(); Iterator i = selected.iterator(); // the following is a tweak. Refresh only re-queries the children. If the selected item has no @@ -2199,7 +2200,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (doTimings) { timer.setEndTime(); - System.out.println("Time to refresh selected: " + timer); //$NON-NLS-1$ + System.out.println("Time to refresh selected: " + timer); } //else //{ @@ -2212,7 +2213,7 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_REFRESH_SELECTED_FILTER: if (debug) - logDebugMsg("SV event: EVENT_REFRESH_SELECTED_FILTER "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REFRESH_SELECTED_FILTER "); IStructuredSelection selectedItems= (IStructuredSelection)getSelection(); Iterator j = selectedItems.iterator(); // We climb up the tree here until we find a SystemFilterReference data member in the tree. @@ -2270,19 +2271,19 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_REFRESH_REMOTE: if (debug) - logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = "+src); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = "+src); refreshRemoteObject(src, parent, originatedHere); break; case EVENT_SELECT_REMOTE: if (debug) - logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = "+src); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = "+src); //remoteItemsToSkip = null; // reset selectRemoteObjects(src, (ISubSystem)null, parent); break; case EVENT_MOVE_MANY: if (debug) - logDebugMsg("SV event: EVENT_MOVE_MANY "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_MOVE_MANY "); multiSource = _event.getMultiSource(); if ((multiSource == null) || (multiSource.length == 0)) return Status.OK_STATUS; @@ -2300,7 +2301,7 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_PROPERTY_CHANGE: if (debug) - logDebugMsg("SV event: EVENT_PROPERTY_CHANGE "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_PROPERTY_CHANGE "); String[] allProps = {IBasicPropertyConstants.P_TEXT,IBasicPropertyConstants.P_IMAGE}; ISystemRemoteElementAdapter ra = getRemoteAdapter(src); if (ra != null) @@ -2313,38 +2314,38 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_PROPERTYSHEET_UPDATE: if (debug) - logDebugMsg("SV event: EVENT_PROPERTYSHEET_UPDATE "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_PROPERTYSHEET_UPDATE "); updatePropertySheet(); break; case EVENT_MUST_COLLAPSE: if (debug) - logDebugMsg("SV event: EVENT_MUST_COLLAPSE "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_MUST_COLLAPSE "); collapseNode(src, true); // collapse and flush gui widgets from memory break; case EVENT_COLLAPSE_ALL: if (debug) - logDebugMsg("SV event: EVENT_COLLAPSE_ALL "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_COLLAPSE_ALL "); collapseAll(); // collapse all - if ((src!=null) && (src instanceof String) && ((String)src).equals("false")) // defect 41203 //$NON-NLS-1$ + if ((src!=null) && (src instanceof String) && ((String)src).equals("false")) // defect 41203 {} else refresh(); // flush gui widgets from memory break; case EVENT_COLLAPSE_SELECTED: // defect 41203 if (debug) - logDebugMsg("SV event: EVENT_COLLAPSE_SELECTED "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_COLLAPSE_SELECTED "); collapseSelected(); break; case EVENT_EXPAND_SELECTED: // defect 41203 if (debug) - logDebugMsg("SV event: EVENT_EXPAND_SELECTED "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_EXPAND_SELECTED "); expandSelected(); break; case EVENT_REVEAL_AND_SELECT: if (debug) - logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT "); parentItem = findItem(parent); if (parentItem == null) return Status.OK_STATUS; @@ -2378,7 +2379,7 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_SELECT: if (debug) - logDebugMsg("SV event: EVENT_SELECT "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_SELECT "); item = findItem(src); if (item == null) // if not showing item, this is a no-op return Status.OK_STATUS; @@ -2386,7 +2387,7 @@ public class SystemView extends TreeViewer implements ISystemTree, break; case EVENT_SELECT_EXPAND: if (debug) - logDebugMsg("SV event: EVENT_SELECT_EXPAND "); //$NON-NLS-1$ + logDebugMsg("SV event: EVENT_SELECT_EXPAND "); item = findItem(src); if (item == null) // if not showing item, this is a no-op return Status.OK_STATUS; @@ -2830,11 +2831,11 @@ public class SystemView extends TreeViewer implements ISystemTree, protected String printTreeItem(Item item) { if (item == null) - return ""; //$NON-NLS-1$ + return ""; else if (item instanceof TreeItem) { TreeItem ti = (TreeItem)item; - return printTreeItem(ti.getParentItem()) + "/" + ti.getText(); //$NON-NLS-1$ + return printTreeItem(ti.getParentItem()) + "/" + ti.getText(); } else return item.toString(); @@ -3188,8 +3189,8 @@ public class SystemView extends TreeViewer implements ISystemTree, { if (debug) { - logDebugMsg("in doOurInternalRefresh on " + getAdapter(element).getName(element)); //$NON-NLS-1$ - logDebugMsg("...current selection is " + getFirstSelectionName(getSelection())); //$NON-NLS-1$ + logDebugMsg("in doOurInternalRefresh on " + getAdapter(element).getName(element)); + logDebugMsg("...current selection is " + getFirstSelectionName(getSelection())); } SystemElapsedTimer timer = null; if (doTimings) @@ -3203,7 +3204,7 @@ public class SystemView extends TreeViewer implements ISystemTree, updateItem(widget, element); if (doTimings) { - System.out.println("doOurInternalRefresh timer 1: time to updatePlus and updateItem:" + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("doOurInternalRefresh timer 1: time to updatePlus and updateItem:" + timer.setEndTime()); timer.setStartTime(); } } @@ -3217,7 +3218,7 @@ public class SystemView extends TreeViewer implements ISystemTree, // newChildren = getRawChildren(widget); if (doTimings) { - System.out.println("doOurInternalRefresh timer 2: time to getRawChildren:" + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("doOurInternalRefresh timer 2: time to getRawChildren:" + timer.setEndTime()); timer.setStartTime(); } } @@ -3230,7 +3231,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (doTimings) { - System.out.println("doOurInternalRefresh timer 3: time to updateChildren:" + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("doOurInternalRefresh timer 3: time to updateChildren:" + timer.setEndTime()); timer.setStartTime(); } } @@ -3263,7 +3264,7 @@ public class SystemView extends TreeViewer implements ISystemTree, } if (doTimings) { - System.out.println("doOurInternalRefresh timer 4: time to recurse children:" + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("doOurInternalRefresh timer 4: time to recurse children:" + timer.setEndTime()); timer.setStartTime(); } } @@ -3582,7 +3583,7 @@ public class SystemView extends TreeViewer implements ISystemTree, gatherExpandedChildren((fullRefresh ? null : currItem), currItem, expandedChildren); wasExpanded[idx] = true; if (doTimings) - System.out.println("Refresh Timer 1: time to gatherExpandedChildren: " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 1: time to gatherExpandedChildren: " + timer.setEndTime()); } else wasExpanded[idx] = false; @@ -3610,13 +3611,13 @@ public class SystemView extends TreeViewer implements ISystemTree, setExpanded(currItem, false); // collapse node if (doTimings) { - System.out.println("Refresh Timer 2: time to setExpanded(false): " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 2: time to setExpanded(false): " + timer.setEndTime()); timer.setStartTime(); } ourInternalRefresh(currItem, currItem.getData(), true, true, doTimings); // dispose of children, update plus if (doTimings) { - System.out.println("Refresh Timer 3: time to do ourInternalRefresh(...): " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 3: time to do ourInternalRefresh(...): " + timer.setEndTime()); timer.setStartTime(); } if (wasExpanded[idx]) @@ -3624,13 +3625,13 @@ public class SystemView extends TreeViewer implements ISystemTree, createChildren(currItem); // re-expand if (doTimings) { - System.out.println("Refresh Timer 4: time to createChildren(...): " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 4: time to createChildren(...): " + timer.setEndTime()); timer.setStartTime(); } currItem.setExpanded(true); if (doTimings) { - System.out.println("Refresh Timer 5: time to setExpanded(true): " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 5: time to setExpanded(true): " + timer.setEndTime()); timer.setStartTime(); } } @@ -3660,27 +3661,27 @@ public class SystemView extends TreeViewer implements ISystemTree, createChildren(item); ((TreeItem)item).setExpanded(true); if (debug) - System.out.println("Re-Expanded RemoteItem: " + itemToExpand.remoteName); //$NON-NLS-1$ + System.out.println("Re-Expanded RemoteItem: " + itemToExpand.remoteName); } else if (debug) - System.out.println("Re-Expand of RemoteItem '" + itemToExpand.remoteName + "' failed. Not found"); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Re-Expand of RemoteItem '" + itemToExpand.remoteName + "' failed. Not found"); } else { setExpandedState(itemToExpand.data, true); if (debug) - System.out.println("Re-Expanded non-remote Item: " + itemToExpand.data); //$NON-NLS-1$ + System.out.println("Re-Expanded non-remote Item: " + itemToExpand.data); } } if (doTimings) { - System.out.println("Refresh Timer 6: time to reExpanded expanded subnodes: " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 6: time to reExpanded expanded subnodes: " + timer.setEndTime()); timer.setStartTime(); } getControl().setRedraw(true); if (doTimings) { - System.out.println("Refresh Timer 7: time to setRedraw(true): " + timer.setEndTime()); //$NON-NLS-1$ + System.out.println("Refresh Timer 7: time to setRedraw(true): " + timer.setEndTime()); timer.setStartTime(); } } @@ -3801,13 +3802,13 @@ public class SystemView extends TreeViewer implements ISystemTree, subsystem = remoteAdapter.getSubSystem(data); areAnyRemote = true; if (debug) - System.out.println("ExpandedRemoteItem added. remoteName = " + remoteName); //$NON-NLS-1$ + System.out.println("ExpandedRemoteItem added. remoteName = " + remoteName); } else if (debug) - System.out.println("ExpandedItem added. Data = " + data); //$NON-NLS-1$ + System.out.println("ExpandedItem added. Data = " + data); } else if (debug) - System.out.println("ExpandedItem added. Data = null"); //$NON-NLS-1$ + System.out.println("ExpandedItem added. Data = null"); } boolean isRemote() { @@ -3901,7 +3902,7 @@ public class SystemView extends TreeViewer implements ISystemTree, eventType = "EVENT_CHANGE_FILTER_REFERENCE"; break; } - logDebugMsg("SV event: "+eventType); //$NON-NLS-1$ + logDebugMsg("SV event: "+eventType); } // STEP 1. ARE WE EVEN SHOWING THE GIVEN SUBSYSTEM? @@ -3921,7 +3922,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (widget != c && widget instanceof Item) { if (debug) - logDebugMsg("...Found ss " + ss); //$NON-NLS-1$ + logDebugMsg("...Found ss " + ss); item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE); } @@ -3929,13 +3930,13 @@ public class SystemView extends TreeViewer implements ISystemTree, else if (widget == c) { if (debug) - logDebugMsg("...Din not find ss " + ss); //$NON-NLS-1$ + logDebugMsg("...Din not find ss " + ss); item = internalFindReferencedItem(widget, filter, SEARCH_INFINITE); } if (item == null) - logDebugMsg("......didn't find renamed/updated filter's reference!"); //$NON-NLS-1$ + logDebugMsg("......didn't find renamed/updated filter's reference!"); else { // STEP 3: UPDATE THAT FILTER... @@ -3972,11 +3973,11 @@ public class SystemView extends TreeViewer implements ISystemTree, { Item ssItem = (Item)item; if (debug) - logDebugMsg("...Found ss "+ss); //$NON-NLS-1$ + logDebugMsg("...Found ss "+ss); // STEP 2: ARE WE SHOWING A REFERENCE TO THE UPDATED FILTER STRING? item = internalFindReferencedItem(ssItem, filterString, SEARCH_INFINITE); if (item == null) - logDebugMsg("......didn't find updated filter string's reference!"); //$NON-NLS-1$ + logDebugMsg("......didn't find updated filter string's reference!"); else { // STEP 3: UPDATE THAT FILTER STRING... @@ -4076,7 +4077,7 @@ public class SystemView extends TreeViewer implements ISystemTree, } if (debug) - logDebugMsg("SV event: "+eventType); //$NON-NLS-1$ + logDebugMsg("SV event: "+eventType); //} //clearSelection(); @@ -4096,7 +4097,7 @@ public class SystemView extends TreeViewer implements ISystemTree, refresh(); if (debug) - logDebugMsg("...Did not find ss "+ss.getName()); //$NON-NLS-1$ + logDebugMsg("...Did not find ss "+ss.getName()); return; } Item ssItem = (Item)item; @@ -4107,7 +4108,7 @@ public class SystemView extends TreeViewer implements ISystemTree, Object parent = event.getParent(); if (debug) - logDebugMsg("...Found ss "+ss); //$NON-NLS-1$ + logDebugMsg("...Found ss "+ss); // STEP 2: ARE WE SHOWING A REFERENCE TO THE FILTER's PARENT POOL? Item parentRefItem = null; @@ -4132,7 +4133,7 @@ public class SystemView extends TreeViewer implements ISystemTree, if (parentRefItem != null) { if (debug) - logDebugMsg("......We are showing reference to parent"); //$NON-NLS-1$ + logDebugMsg("......We are showing reference to parent"); // STEP 3... YES, SO REFRESH PARENT... IT WILL RE-GEN THE FILTER REFERENCES FOR EACH CHILD FILTER // ... actually, call off the whole show if that parent is currently not expanded!! // HMMM... WE NEED TO REFRESH EVEN IF NOT EXPANDED IF ADDING FIRST CHILD @@ -4218,18 +4219,18 @@ public class SystemView extends TreeViewer implements ISystemTree, if (add && isSelected(parentRefItem.getData(),oldSelections)) { if (debug) - logDebugMsg(".........that parent was previously selected"); //$NON-NLS-1$ + logDebugMsg(".........that parent was previously selected"); // .... YES, SO SELECT NEW FILTER'S REFERENCE Item filterItem = (Item)internalFindReferencedItem(parentRefItem, afilterstring?(Object)filterstring:(Object)filter, 1); // start at filter's parent, search for filter if (filterItem == null) { if (debug) - logDebugMsg("Hmm, didn't find new filter's reference!"); //$NON-NLS-1$ + logDebugMsg("Hmm, didn't find new filter's reference!"); } else { if (debug) - logDebugMsg(".........Trying to set selection to " + filterItem.getData()); //$NON-NLS-1$ + logDebugMsg(".........Trying to set selection to " + filterItem.getData()); setSelection(new StructuredSelection(filterItem.getData()),true); } } @@ -4270,7 +4271,7 @@ public class SystemView extends TreeViewer implements ISystemTree, } else if (debug) - logDebugMsg("Did not find parent ref " + parent); //$NON-NLS-1$ + logDebugMsg("Did not find parent ref " + parent); } /** * Move existing items a given number of positions within the same node. @@ -4440,7 +4441,7 @@ public class SystemView extends TreeViewer implements ISystemTree, //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, null, subsystem, matches); match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, null, subsystem); if (debugRemote) - System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2,3)"); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2,3)"); } //if (matches.size() > 0) // return (Item)matches.elementAt(0); @@ -4472,7 +4473,7 @@ public class SystemView extends TreeViewer implements ISystemTree, //recursiveFindAllRemoteItemReferences(parentItem, remoteObjectName, remoteObject, subsystem, matches); match = recursiveFindFirstRemoteItemReference(parentItem, remoteObjectName, remoteObject, subsystem); if (debugRemote) - System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2)"); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("Returning " + match + " from findFirstRemoteItemReference(1,2)"); } //if (matches.size() > 0) @@ -4567,19 +4568,19 @@ public class SystemView extends TreeViewer implements ISystemTree, Item match = null; if (debugRemote) { - System.out.println("Inside internalFindFirstRemoteItemReference for searchString: "+searchString+", subsystem null? " + (subsystem==null) + ", nbr roots = " + roots.length); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + System.out.println("Inside internalFindFirstRemoteItemReference for searchString: "+searchString+", subsystem null? " + (subsystem==null) + ", nbr roots = " + roots.length); } for (int idx=0; (match==null) && (idx + * To enable filters themselves to be automous and sharable, it is decided + * that no data will be persisted in the filter pool itself. Rather, all + * attributes other than the list of filters are transient and as such it is + * the responsibility of the programmer using a filter pool to set these + * attributes after creating or restoring a filter pool. Typically, this is + * what a filter pool manager (SystemFilterPoolManager) will do for you. + */ +/** + * @lastgen class SystemFilterPoolImpl extends SystemPersistableReferencedObjectImpl implements SystemFilterPool, SystemFilterSavePolicies, SystemFilterConstants, SystemFilterContainer, IAdaptable + */ +public class SystemFilterPool extends SystemPersistableReferencedObject + implements ISystemFilterPool, ISystemFilterSavePolicies, ISystemFilterConstants, ISystemFilterContainer, IAdaptable +{ + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + private String name; + /** + * The default value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected static final String TYPE_EDEFAULT = null; + + private int savePolicy; + private IRSEFilterNamingPolicy namingPolicy = null; + private ISystemFilterPoolManager mgr; + private SystemFilterContainerCommonMethods helpers = null; + private Object filterPoolData = null; + private boolean initialized = false; + protected boolean specialCaseNoDataRestored = false; + private boolean debug = false; + protected static final String DELIMITER = SystemFilterPoolReference.DELIMITER; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected String type = TYPE_EDEFAULT; + /** + * The default value of the '{@link #isSupportsNestedFilters() Supports Nested Filters}' attribute. + * + * + * @see #isSupportsNestedFilters() + * @generated + * @ordered + */ + protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean supportsNestedFilters = SUPPORTS_NESTED_FILTERS_EDEFAULT; + /** + * The default value of the '{@link #isDeletable() Deletable}' attribute. + * + * + * @see #isDeletable() + * @generated + * @ordered + */ + protected static final boolean DELETABLE_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean deletable = DELETABLE_EDEFAULT; + /** + * The default value of the '{@link #isDefault() Default}' attribute. + * + * + * @see #isDefault() + * @generated + * @ordered + */ + protected static final boolean DEFAULT_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean default_ = DEFAULT_EDEFAULT; + /** + * The default value of the '{@link #isStringsCaseSensitive() Strings Case Sensitive}' attribute. + * + * + * @see #isStringsCaseSensitive() + * @generated + * @ordered + */ + protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean stringsCaseSensitive = STRINGS_CASE_SENSITIVE_EDEFAULT; + /** + * This is true if the Strings Case Sensitive attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean stringsCaseSensitiveESet = false; + + /** + * The default value of the '{@link #isSupportsDuplicateFilterStrings() Supports Duplicate Filter Strings}' attribute. + * + * + * @see #isSupportsDuplicateFilterStrings() + * @generated + * @ordered + */ + protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT = false; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected boolean supportsDuplicateFilterStrings = SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT; + /** + * The default value of the '{@link #getRelease() Release}' attribute. + * + * + * @see #getRelease() + * @generated + * @ordered + */ + protected static final int RELEASE_EDEFAULT = 0; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected int release = RELEASE_EDEFAULT; + /** + * The default value of the '{@link #isSingleFilterStringOnly() Single Filter String Only}' attribute. + * + * + * @see #isSingleFilterStringOnly() + * @generated + * @ordered + */ + protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT = false; + + /** + * The cached value of the '{@link #isSingleFilterStringOnly() Single Filter String Only}' attribute. + * + * + * @see #isSingleFilterStringOnly() + * @generated + * @ordered + */ + protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT; + + /** + * This is true if the Single Filter String Only attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean singleFilterStringOnlyESet = false; + + /** + * The default value of the '{@link #getOwningParentName() Owning Parent Name}' attribute. + * + * + * @see #getOwningParentName() + * @generated + * @ordered + */ + protected static final String OWNING_PARENT_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOwningParentName() Owning Parent Name}' attribute. + * + * + * @see #getOwningParentName() + * @generated + * @ordered + */ + protected String owningParentName = OWNING_PARENT_NAME_EDEFAULT; + + /** + * The default value of the '{@link #isNonRenamable() Non Renamable}' attribute. + * + * + * @see #isNonRenamable() + * @generated + * @ordered + */ + protected static final boolean NON_RENAMABLE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isNonRenamable() Non Renamable}' attribute. + * + * + * @see #isNonRenamable() + * @generated + * @ordered + */ + protected boolean nonRenamable = NON_RENAMABLE_EDEFAULT; + + /** + * @generated This field/method will be replaced during code generation. + */ + protected java.util.List filters = null; + private static SystemFilterPool _instance; +/** + * Default constructor + */ + protected SystemFilterPool() + { + super(); + helpers = new SystemFilterContainerCommonMethods(); + } + + public static SystemFilterPool getDefault() + { + if (_instance == null) + { + _instance = new SystemFilterPool(); + } + return _instance; + } + + /** + * Static factory method for creating a new filter pool. Will + * first try to restore it, and if that fails will create a new instance and + * return it. + *

+ * Use this method only if you are not using a SystemFilterPoolManager, else + * use the createSystemFilterPool method in that class. + * + * @param mofHelpers SystemMOFHelpers object with helper methods for saving and restoring via mof + * @param poolFolder the folder that will hold the filter pool. + * This folder will be created if it does not already exist. + * @param name the name of the filter pool. Typically this is also the name + * of the given folder, but this is not required. For the save policy of one file + * per pool, the name of the file is derived from this. + * @param allowNestedFilters true if filters inside this filter pool are + * to allow nested filters. + * @param isDeletable true if this filter pool is allowed to be deleted by users. + * @param tryToRestore true to attempt a restore first, false if a pure create operation. + * @param savePolicy The save policy for the filter pool and filters. One of the + * following constants from the SystemFilterConstants interface: + *

    + *
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool + *
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder + *
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool + *
+ * @param namingPolicy The names to use for file and folders when persisting to disk. Pass + * null to just use the defaults. + */ + public ISystemFilterPool createSystemFilterPool( + String name, + boolean allowNestedFilters, + boolean isDeletable, + boolean tryToRestore) + { + + + SystemFilterPool pool = null; + if (tryToRestore) + { + try + { + pool = (SystemFilterPool)RSEUIPlugin.getThePersistenceManager().restoreFilterPool(name); + } + catch (Exception exc) // real error trying to restore, versus simply not found. + { + // todo: something? Log the exception somewhere? + } + } + if (pool == null) // not found or some serious error. + { + pool = createPool(); + } + if (pool != null) + { + pool.initialize(name, allowNestedFilters, isDeletable); + } + return pool; + } + + // temporary! + //public boolean isSharable() {return isSharable; } + //public void setIsSharable(boolean is) { isSharable = is; } + + /* + * Private helper method. + * Uses MOF to create an instance of this class. + */ + protected static SystemFilterPool createPool() + { + ISystemFilterPool pool = new SystemFilterPool(); + // FIXME SystemFilterImpl.initMOF().createSystemFilterPool(); + pool.setRelease(SystemResources.CURRENT_RELEASE); + return (SystemFilterPool)pool; + } + + /* + * Private helper method to initialize attributes + */ + protected void initialize(String name, + boolean allowNestedFilters, + boolean isDeletable) + { + if (!initialized) + initialize(name, savePolicy, namingPolicy); + setDeletable(isDeletable); // mof attribute + //System.out.println("In initialize() for filter pool " + getName() + ". isDeletable= " + isDeletable); + setSupportsNestedFilters(allowNestedFilters); // cascades to each filter + } + + /* + * Private helper method to core initialization, from either createXXX or restore. + */ + protected void initialize(String name, + int savePolicy, IRSEFilterNamingPolicy namingPolicy) + { + setName(name); // mof attribute + setSavePolicy(savePolicy); + setNamingPolicy(namingPolicy); + + initialized = true; + } + + + //protected Vector internalGetFilters() + protected java.util.List internalGetFilters() + { + //return filters; + return getFilters(); // mof-supplied in parent class + } + + /** + * Return the caller which instantiated the filter pool manager overseeing this filter framework instance + */ + public ISystemFilterPoolManagerProvider getProvider() + { + ISystemFilterPoolManager mgr = getSystemFilterPoolManager(); + if (mgr != null) + return mgr.getProvider(); + else + return null; + } + + /** + * Set the save file policy. See constants in {@link org.eclipse.rse.core.filters.ISystemFilterConstants SystemFilterConstants}. + * One of: + *
    + *
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool + *
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder + *
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool + *
+ * This method is called by the SystemFilterPoolManager. + */ + public void setSavePolicy(int policy) + { + if (this.savePolicy != policy) + { + this.savePolicy = policy; + setDirty(true); + } + } + + /** + * Set the naming policy used when saving data to disk. + * @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy + */ + public void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy) + { + if (this.namingPolicy != namingPolicy) + { + this.namingPolicy = namingPolicy; + setDirty(true); + } + } + + /** + * Get the naming policy currently used when saving data to disk. + * @see org.eclipse.rse.core.filters.IRSEFilterNamingPolicy + */ + public IRSEFilterNamingPolicy getNamingPolicy() + { + return namingPolicy; + } + + /** + * Set whether filters in this pool support nested filters. + * Important to note this is stored in every filter as well as this filter pool. + */ + public void setSupportsNestedFilters(boolean supports) + { + this.setSupportsNestedFiltersGen(supports); + ISystemFilter[] filters = getSystemFilters(); + if (filters != null) + for (int idx=0; idx + * + * @generated + */ + public void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters) + { + supportsNestedFilters = newSupportsNestedFilters; + } + + /** + * Set whether filters in this pool support duplicate filter strings. + * Important to note this is stored in every filter as well as this filter pool. + */ + public void setSupportsDuplicateFilterStrings(boolean supports) + { + setSupportsDuplicateFilterStringsGen(supports); + ISystemFilter[] filters = getSystemFilters(); + if (filters != null) + for (int idx=0; idx + * + * @generated + */ + public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings) + { + supportsDuplicateFilterStrings = newSupportsDuplicateFilterStrings; + setDirty(true); + } + + /** + * Set whether filters in this pool support case-sensitive filter strings. + * Important to note this is stored in every filter as well as this filter pool. + */ + public void setStringsCaseSensitive(boolean supports) + { + this.setStringsCaseSensitiveGen(supports); + ISystemFilter[] filters = getSystemFilters(); + if (filters != null) + for (int idx=0; idx + * + * @generated + */ + public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive) + { + stringsCaseSensitive = newStringsCaseSensitive; + stringsCaseSensitiveESet = true; + setDirty(true); + } + + /** + * Set the filter pool manager. Called by SystemFilterPoolManager + */ + public void setSystemFilterPoolManager(ISystemFilterPoolManager mgr) + { + this.mgr = mgr; + } + /** + * Return the filter pool manager managing this collection of filter pools and their filters. + */ + public ISystemFilterPoolManager getSystemFilterPoolManager() + { + return mgr; + } + + /** + * While setData is for global data to set in all objects in the filter framework, + * this is to set transient data that only the filter pool holds. + */ + public void setSystemFilterPoolData(Object data) + { + this.filterPoolData = data; + } + + /** + * Return transient data set via setFilterPoolData. + */ + public Object getSystemFilterPoolData() + { + return filterPoolData; + } + + public String getId() + { + return getProvider().getId(); + } + + /** + * @see ISystemFilterPool#getName() + */ + public String getName() + { + return name; + } + + public String getDescription() + { + return SystemResources.RESID_MODELOBJECTS_FILTERPOOL_DESCRIPTION; + } + + /** + * Set the name of this filter pool. + */ + public void setName(String name) + { + if (this.name == null || !this.name.equals(name) ) + { + this.name = name; + setDirty(true); + } + } + + /** + * Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null + * Allows tools to have typed filter pools + */ + public String getType() + { + String type = this.getTypeGen(); + if (type == null) + return ISystemFilterConstants.DEFAULT_TYPE; + else + return type; + } + /** + * @generated This field/method will be replaced during code generation + * Allows tools to have typed filter pools + */ + public String getTypeGen() + { + return type; + } + + /** + * + * + * @generated + */ + public boolean isDeletable() + { + return deletable; + } + + /** + * + * + * @generated + */ + public void setDeletable(boolean newDeletable) + { + deletable = newDeletable; + setDirty(true); + } + + /** + * + * + * @generated + */ + public boolean isDefault() + { + return default_; + } + + /** + * + * + * @generated + */ + public void setDefault(boolean newDefault) + { + default_ = newDefault; + } + + /** + * Does this support nested filters? Calls mof-generated isSupportsNestedFilters. + */ + public boolean supportsNestedFilters() + { + return isSupportsNestedFilters(); + } + /** + * Does this support duplicate filter strings? Calls mof-generated isSupportsDuplicateFilterStrings. + */ + public boolean supportsDuplicateFilterStrings() + { + return isSupportsDuplicateFilterStrings(); + } + /** + * @return The value of the StringsCaseSensitive attribute + * Are filter strings in this filter case sensitive? + * If not set locally, queries the parent filter pool manager's atttribute. + */ + public boolean isStringsCaseSensitive() + { + if (!isSetStringsCaseSensitive()) + return getSystemFilterPoolManager().isStringsCaseSensitive(); + else + return stringsCaseSensitive; + } + /** + * Same as isStringsCaseSensitive() + * @return The value of the StringsCaseSensitive attribute + */ + public boolean areStringsCaseSensitive() + { + return isStringsCaseSensitive(); + } + /** + * Clone this filter pools' attributes and filters into another filter pool. + * Assumes the core attributes were already set when filter pool was created: + *
    + *
  • Name + *
  • Deletable + *
  • Supports nested filters + *
  • Manager + *
+ * Attributes we clone: + *
    + *
  • Data + *
  • Type + *
  • Default + *
  • Case sensitive + *
  • Supports duplicate filter strings + *
  • Release + *
+ */ + public void cloneSystemFilterPool(ISystemFilterPool targetPool) + throws Exception + { + //System.out.println("In SystemFilterPoolImpl#cloneSystemFilterPool. targetPool null? " + (targetPool == null)); + if (filterPoolData != null) + targetPool.setSystemFilterPoolData(filterPoolData); + + //String ourType = getTypeGen(); + //if (ourType != null) + // targetPool.setType(ourType); + targetPool.setType(getType()); + + targetPool.setDeletable(isDeletable()); + targetPool.setSupportsNestedFilters(isSupportsNestedFilters()); + + //Boolean ourDefault = getDefault(); + //if (ourDefault != null) + // targetPool.setDefault(ourDefault); + targetPool.setDefault(isDefault()); + + targetPool.setSupportsDuplicateFilterStrings(supportsDuplicateFilterStrings()); + targetPool.setRelease(getRelease()); + //targetPool.setNonDeletable(isNonDeletable()); + targetPool.setNonRenamable(isNonRenamable()); + targetPool.setOwningParentName(getOwningParentName()); + if (isSetSingleFilterStringOnly()) + targetPool.setSingleFilterStringOnly(isSingleFilterStringOnly()); + if (isSetStringsCaseSensitive()) + targetPool.setStringsCaseSensitive(isStringsCaseSensitive()); + + + ISystemFilter[] filters = getSystemFilters(); + if ((filters!=null) && (filters.length>0)) + { + for (int idx=0; idx + *
  • supportsNestedFilters + *
  • supportsDuplicateFilterStrings + *
  • stringsCaseSensitive + * + * @param aliasName The name to give the new filter. Must be unique for this pool. + * @param filterStrings The list of String objects that represent the filter strings. + */ + public ISystemFilter createSystemFilter(String aliasName, Vector filterStrings) + { + ISystemFilter newFilter = helpers.createSystemFilter(internalGetFilters(), this, aliasName, filterStrings); + newFilter.setSupportsNestedFilters(supportsNestedFilters()); + newFilter.setStringsCaseSensitive(areStringsCaseSensitive()); + newFilter.setSupportsDuplicateFilterStrings(supportsDuplicateFilterStrings()); + setDirty(true); + return newFilter; + } + + /** + * Return Vector of String objects: the names of existing filters in this container. + * Needed by name validators for New and Rename actions to verify new name is unique. + */ + public Vector getSystemFilterNames() + { + return helpers.getSystemFilterNames(internalGetFilters()); + } + + /** + * Return the nested filters as a Vector + */ + public Vector getSystemFiltersVector() + { + return helpers.getSystemFiltersVector(internalGetFilters()); + } + /** + * Return how many filters are defined in this filter container + */ + public int getSystemFilterCount() + { + return helpers.getSystemFilterCount(internalGetFilters()); + } + /** + * Return a filter object, given its aliasname. + * Can be used to test if an aliasname is already used (non-null return). + * @param aliasName unique aliasName (case insensitive) to search on. + * @return SystemFilter object with unique aliasName, or null if + * no filter object with this name exists. + */ + public ISystemFilter getSystemFilter(String aliasName) + { + return helpers.getSystemFilter(internalGetFilters(), aliasName); + } + /** + * Adds given filter to the list. + *

    PLEASE NOTE: + *

      + *
    • createSystemFilter calls this method for you! + *
    • this is a no-op if a filter with the same aliasname already exists + *
    + * @param filter SystemFilter object to add + * @return true if added, false if filter with this aliasname already existed. + */ + public boolean addSystemFilter(ISystemFilter filter) + { + boolean result = helpers.addSystemFilter(internalGetFilters(),filter); + if (result) setDirty(true); + return result; + } + /** + * Removes a given filter from the list. + * @param filter SystemFilter object to remove + */ + public void deleteSystemFilter(ISystemFilter filter) + { + helpers.deleteSystemFilter(internalGetFilters(),filter); + setDirty(true); + } + + /** + * Rename a given filter in the list. + * @param filter SystemFilter object to remove + */ + public void renameSystemFilter(ISystemFilter filter, String newName) + { + helpers.renameSystemFilter(internalGetFilters(),filter, newName); + setDirty(true); + } + + /** + * Updates a given filter in the list. + * @param filter SystemFilter object to update + * @param newName New name to assign it. Assumes unique checking already done. + * @param newStrings New strings to assign it. Replaces current strings. + */ + public void updateSystemFilter(ISystemFilter filter, String newName, String[] newStrings) + { + helpers.updateSystemFilter(internalGetFilters(), filter, newName, newStrings); + setDirty(true); + } + + /** + * Duplicates a given filter in the list. + * @param filter SystemFilter object to clone + * @param alias New, unique, alias name to give this filter. Clone will fail if this is not unique. + */ + public ISystemFilter cloneSystemFilter(ISystemFilter filter, String aliasName) + { + ISystemFilter result = helpers.cloneSystemFilter(internalGetFilters(), filter, aliasName); + setDirty(true); + return result; + } + + /** + * Return a given filter's zero-based location + */ + public int getSystemFilterPosition(ISystemFilter filter) + { + return helpers.getSystemFilterPosition(internalGetFilters(),filter); + } + + /** + * Move a given filter to a given zero-based location + */ + public void moveSystemFilter(int pos, ISystemFilter filter) + { + helpers.moveSystemFilter(internalGetFilters(),pos,filter); + setDirty(true); + } + + /** + * 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. + */ + public Object getAdapter(Class adapterType) + { + return Platform.getAdapterManager().getAdapter(this, adapterType); + } + + /** + * Private helper method to deduce filter names from disk files. + * Will populate and return a list. + * Only makes sense to use if the save policy is one file per filter. + */ + protected static Vector deduceFilterNames(IFolder folder, IRSEFilterNamingPolicy namingPolicy) + { + Vector filterNames = SystemResourceHelpers.getResourceHelpers().convertToVectorAndStrip( + SystemResourceHelpers.getResourceHelpers().listFiles(folder, + namingPolicy.getFilterSaveFileNamePrefix(), + SAVEFILE_SUFFIX), + namingPolicy.getFilterSaveFileNamePrefix(), SAVEFILE_SUFFIX); + return filterNames; + } + + + + /** + * Order filters according to user preferences. + *

    + * While the framework has all the code necessary to arrange filters and save/restore + * that arrangement, you may choose to use preferences instead of this support. + * In this case, call this method and pass in the saved and sorted filter name list. + *

    + * Called by someone after restore. + */ + public void orderSystemFilters(String[] names) + { + java.util.List filterList = internalGetFilters(); + ISystemFilter[] filters = new ISystemFilter[names.length]; + for (int idx=0; idx + *

  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool + *
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder + *
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool + * + * @param namingPolicy The names to use for file and folders when persisting to disk. Pass + * null to just use the defaults. + * @return SystemFilterPool object if restored ok, null if error encountered. If null, call getLastException(). + * @see org.eclipse.rse.core.filters.ISystemFilterConstants + */ + protected static ISystemFilterPool restore(String name, int savePolicy, + IRSEFilterNamingPolicy namingPolicy) + throws Exception + { + if (namingPolicy == null) + namingPolicy = SystemFilterNamingPolicy.getNamingPolicy(); + + // FIXME SystemFilterImpl.initMOF(); // to be safe + + ISystemFilterPool pool = null; + SystemFilterPool poolImpl = null; + /* FIXME + switch(savePolicy) + { + case SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL: + pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, true); + poolImpl = (SystemFilterPoolImpl)pool; + break; + + case SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER: + pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, true); + poolImpl = (SystemFilterPoolImpl)pool; + break; + + case SAVE_POLICY_ONE_FILE_PER_FILTER: + pool = restoreFromOneFile(mofHelpers, folder, name, namingPolicy, false); // restore data part + poolImpl = (SystemFilterPoolImpl)pool; + //pool = createPool(); + + poolImpl.setFolder(folder); // SystemFilter's restore will query it + pool.setNamingPolicy(namingPolicy); // SystemFilter's restore will query it + Vector filterNames = deduceFilterNames(folder, namingPolicy); + if (filterNames != null) + { + Exception lastException = null; + for (int idx=0; idx + * As required by the {@link org.eclipse.rse.core.references.IRSEBasePersistableReferencedObject IRSEPersistableReferencedObject} + * interface. + */ + public String getReferenceName() + { + return getSystemFilterPoolManager().getName()+DELIMITER+getName(); + } + + // ----------------------- + // HOUSEKEEPING METHODS... + // ----------------------- + /* */ + public String toString() + { + return getName(); + } + /** + * @generated This field/method will be replaced during code generation. + */ + public void setType(String newType) + { + type = newType; + setDirty(true); + } + + /** + * @generated This field/method will be replaced during code generation + */ + public boolean isSupportsNestedFilters() + { + return supportsNestedFilters; + } + + /** + * @generated This field/method will be replaced during code generation. + */ + public void unsetStringsCaseSensitive() + { + stringsCaseSensitive = STRINGS_CASE_SENSITIVE_EDEFAULT; + stringsCaseSensitiveESet = false; + setDirty(true); + } + + /** + * @generated This field/method will be replaced during code generation. + */ + public boolean isSetStringsCaseSensitive() + { + return stringsCaseSensitiveESet; + } + + /** + * @generated This field/method will be replaced during code generation + */ + public java.util.List getFilters() + { + if (filters == null) + { + filters = new ArrayList(); + //FIXME new EObjectContainmenteList(SystemFilter.class, this, FiltersPackage.SYSTEM_FILTER_POOL__FILTERS); + } + return filters; + } + + /** + * @generated This field/method will be replaced during code generation + */ + public boolean isSupportsDuplicateFilterStrings() + { + return supportsDuplicateFilterStrings; + } + + /** + * @generated This field/method will be replaced during code generation + * In what release was this created? Typically, will be the version and release + * times 10, as in 40 or 51. + */ + public int getRelease() + { + return release; + } + + /** + * @generated This field/method will be replaced during code generation. + */ + public void setRelease(int newRelease) + { + release = newRelease; + setDirty(true); + } + + /** + * Returns true if this filter is limited to a single filter string. If not set here, + * it is queried from the parent manager. + */ + public boolean isSingleFilterStringOnly() + { + if (isSetSingleFilterStringOnly()) + return singleFilterStringOnly; + else + return getSystemFilterPoolManager().isSingleFilterStringOnly(); + } + /** + * + * + * @generated + */ + public boolean isSingleFilterStringOnlyGen() + { + return singleFilterStringOnly; + } + + /** + * + * + * @generated + */ + public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly) + { + singleFilterStringOnly = newSingleFilterStringOnly; + singleFilterStringOnlyESet = true; + setDirty(true); + } + + /** + * + * + * @generated + */ + public void unsetSingleFilterStringOnly() + { + singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT; + singleFilterStringOnlyESet = false; + setDirty(true); + } + + /** + * + * + * @generated + */ + public boolean isSetSingleFilterStringOnly() + { + return singleFilterStringOnlyESet; + } + + /** + * + * + * @generated + */ + public String getOwningParentName() + { + return owningParentName; + } + + /** + * + * + * @generated + */ + public void setOwningParentName(String newOwningParentName) + { + if (newOwningParentName != owningParentName) + { + owningParentName = newOwningParentName; + setDirty(true); + } + } + + /** + * + * + * @generated + */ + public boolean isNonRenamable() + { + return nonRenamable; + } + + /** + * + * + * @generated + */ + public void setNonRenamable(boolean newNonRenamable) + { + boolean oldNonRenamable = nonRenamable; + if (oldNonRenamable!= newNonRenamable) + { + nonRenamable = newNonRenamable; + setDirty(true); + } + } + + public boolean commit() + { + return RSEUIPlugin.getThePersistenceManager().commit(this); + } + +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/SystemFilterPoolReferenceManager.java b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/SystemFilterPoolReferenceManager.java new file mode 100644 index 00000000000..37e05073012 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/SystemFilterPoolReferenceManager.java @@ -0,0 +1,1129 @@ +/******************************************************************************** + * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Initial Contributors: + * The following IBM employees contributed to the Remote System Explorer + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. + * + * Contributors: + * {Name} (company) - description of contribution. + ********************************************************************************/ + +package org.eclipse.rse.filters; +import java.util.Vector; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.rse.core.SystemResourceHelpers; +import org.eclipse.rse.core.filters.IRSEFilterNamingPolicy; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterConstants; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterSavePolicies; +import org.eclipse.rse.core.filters.SystemFilterNamingPolicy; +import org.eclipse.rse.core.references.IRSEBasePersistableReferencingObject; +import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.internal.filters.SystemFilter; +import org.eclipse.rse.internal.filters.SystemFilterPoolReference; +import org.eclipse.rse.internal.references.SystemPersistableReferenceManager; + + +/** + * This class manages a persistable list of objects each of which reference + * a filter pool. This class builds on the parent class SystemPersistableReferenceManager, + * offering convenience versions of the parent methods that are typed to the + * classes in the filters framework. + */ +/** + * @lastgen class SystemFilterPoolReferenceManagerImpl extends SystemPersistableReferenceManagerImpl implements SystemFilterPoolReferenceManager, SystemPersistableReferenceManager {} + */ +public class SystemFilterPoolReferenceManager extends SystemPersistableReferenceManager implements ISystemFilterPoolReferenceManager +{ + //private SystemFilterPoolManager[] poolMgrs = null; + private ISystemFilterPoolManagerProvider poolMgrProvider = null; + private ISystemFilterPoolManager defaultPoolMgr = null; + private ISystemFilterPoolReferenceManagerProvider caller = null; + private IRSEFilterNamingPolicy namingPolicy = null; + private int savePolicy = ISystemFilterSavePolicies.SAVE_POLICY_NONE; + private Object mgrData = null; + private IFolder mgrFolder = null; + private boolean initialized = false; + private boolean noSave; + private boolean noEvents; + private boolean fireEvents = true; + private ISystemFilterPoolReference[] fpRefsArray = null; + private static final ISystemFilterPoolReference[] emptyFilterPoolRefArray = new ISystemFilterPoolReference[0]; + +/** + * Default constructor. Typically called by MOF factory methods. + */ + public SystemFilterPoolReferenceManager() + { + super(); + } + /** + * Create a SystemFilterPoolReferenceManager instance. + * @param caller Objects which instantiate this class should implement the + * SystemFilterPoolReferenceManagerProvider interface, and pass "this" for this parameter. + * Given any filter framework object, it is possible to retrieve the caller's + * object via the getProvider method call. + * @param relatedPoolManagers The managers that owns the master list of filter pools that + * this manager will contain references to. + * @param mgrFolder the folder that will hold the persisted file. This is used when + * the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER. For SAVE_POLICY_NONE, this + * is not used. If it is used, it is created if it does not already exist. + * @param name the name of the filter pool reference manager. This is used when + * the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER, to deduce the file name. + * @param savePolicy The save policy for the filter pool references list. One of the + * following from the {@link org.eclipse.rse.core.filters.ISystemFilterConstants SystemFilterConstants} + * interface: + *
      + *
    • SAVE_POLICY_NONE - no files, all save/restore handled elsewhere + *
    • SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi + *
    + * @param namingPolicy The names to use for file and folders when persisting to disk. Pass + * null to just use the defaults, or if using SAVE_POLICY_NONE. + */ + public static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager( + ISystemFilterPoolReferenceManagerProvider caller, + ISystemFilterPoolManagerProvider relatedPoolManagerProvider, + IFolder mgrFolder, + String name, + int savePolicy, + IRSEFilterNamingPolicy namingPolicy) + { + SystemFilterPoolReferenceManager mgr = null; + + if (mgrFolder != null) + SystemResourceHelpers.getResourceHelpers().ensureFolderExists(mgrFolder); + if (namingPolicy == null) + namingPolicy = SystemFilterNamingPolicy.getNamingPolicy(); + try + { + if (savePolicy != ISystemFilterSavePolicies.SAVE_POLICY_NONE) + mgr = (SystemFilterPoolReferenceManager)restore(caller, mgrFolder, name, namingPolicy); + } + catch (Exception exc) // real error trying to restore, versus simply not found. + { + // todo: something. Log the exception somewhere? + } + if (mgr == null) // not found or some serious error. + { + mgr = createManager(); + } + if (mgr != null) + { + mgr.initialize(caller, mgrFolder, name, savePolicy, namingPolicy, relatedPoolManagerProvider); + } + + return mgr; + } + + /* + * Private helper method. + * Uses MOF to create an instance of this class. + */ + protected static SystemFilterPoolReferenceManager createManager() + { + ISystemFilterPoolReferenceManager mgr = new SystemFilterPoolReferenceManager(); + // FIXME SystemFilterImpl.initMOF().createSystemFilterPoolReferenceManager(); + return (SystemFilterPoolReferenceManager)mgr; + } + + + + /* + * Private helper method to initialize state + */ + protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, + IFolder folder, + String name, + int savePolicy, + IRSEFilterNamingPolicy namingPolicy, + ISystemFilterPoolManagerProvider relatedPoolManagerProvider) + { + if (!initialized) + initialize(caller, folder, name, savePolicy, namingPolicy); // core data + //setSystemFilterPoolManagers(relatedPoolManagers); + setSystemFilterPoolManagerProvider(relatedPoolManagerProvider); + } + + /* + * Private helper method to do core initialization. + * Might be called from either the static factory method or the static restore method. + */ + protected void initialize(ISystemFilterPoolReferenceManagerProvider caller, + IFolder folder, + String name, + int savePolicy, + IRSEFilterNamingPolicy namingPolicy) + { + this.mgrFolder = folder; + setProvider(caller); + setName(name); + this.savePolicy = savePolicy; + setNamingPolicy(namingPolicy); + initialized = true; + } + + private void invalidateFilterPoolReferencesCache() + { + fpRefsArray = null; + invalidateCache(); + } + + // ------------------------------------------------------------ + // Methods for setting and querying attributes + // ------------------------------------------------------------ + /** + * Set the associated master pool manager provider. Note the provider + * typically manages multiple pool managers and we manage references + * across those. + */ + public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider) + { + this.poolMgrProvider = poolMgrProvider; + } + /** + * Get the associated master pool manager provider. Note the provider + * typically manages multiple pool managers and we manage references + * across those. + */ + public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider() + { + return poolMgrProvider; + } + /* + * Set the managers of the master list of filter pools, from which + * objects in this list reference. + * + public void setSystemFilterPoolManagers(SystemFilterPoolManager[] mgrs) + { + this.poolMgrs = mgrs; + }*/ + + /** + * Get the managers of the master list of filter pools, from which + * objects in this list reference. + */ + public ISystemFilterPoolManager[] getSystemFilterPoolManagers() + { + //return poolMgrs; + return poolMgrProvider.getSystemFilterPoolManagers(); + } + /** + * Get the managers of the master list of filter pools, from which + * objects in this list reference, but which are not in the list of + * managers our pool manager supplier gives us. That is, these are + * references to filter pools outside the expected list. + */ + public ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers() + { + ISystemFilterPoolManager[] poolMgrs = getSystemFilterPoolManagers(); + Vector v = new Vector(); + + ISystemFilterPoolReference[] fpRefs = getSystemFilterPoolReferences(); + for (int idx=0; idx 0) + { + additionalMgrs = new ISystemFilterPoolManager[v.size()]; + for (int idx=0; idxCalls back to inform provider + * @param array of filter pool reference objects to set the list to. + * @param deReference true to first de-reference all objects in the existing list. + */ + public void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences, + boolean deReference) + { + super.setReferencingObjects(filterPoolReferences, deReference); + invalidateFilterPoolReferencesCache(); + // callback to provider so they can fire events in their GUI + if (fireEvents && (caller != null)) + caller.filterEventFilterPoolReferencesReset(); + quietSave(); + } + + /** + * Create a filter pool reference. This creates a raw reference that must be added to the managed + * lists by the caller. + */ + private ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPool filterPool) { + ISystemFilterPoolReference filterPoolReference = new SystemFilterPoolReference(filterPool); + invalidateFilterPoolReferencesCache(); + return filterPoolReference; + } + + /** + * Create a filter pool reference. This creates an unresolved raw reference that + * must be added to the managed lists by the caller. + * That will be attempted to be resolved on first use. + */ + // DWD working + private ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPoolManager filterPoolManager, String filterPoolName) { + ISystemFilterPoolReference filterPoolReference = new SystemFilterPoolReference(filterPoolManager, filterPoolName); + invalidateFilterPoolReferencesCache(); + return filterPoolReference; + } + + /** + * Add a filter pool referencing object to the list. + * @return the new count of referencing objects + */ + public int addSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference) + { + int count = addReferencingObject(filterPoolReference); + filterPoolReference.setParentReferenceManager(this); // DWD - should be done in the addReferencingObject method + invalidateFilterPoolReferencesCache(); + quietSave(); + return count; + } + + /** + * Reset the filter pool a reference points to. Called on a move-filter-pool operation + */ + public void resetSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, ISystemFilterPool newPool) + { + filterPoolReference.removeReference(); + filterPoolReference.setReferencedObject(newPool); + if (fireEvents && (caller != null)) + caller.filterEventFilterPoolReferenceReset(filterPoolReference); + quietSave(); + // don't think we need to invalidate the cache + } + /** + * Remove a filter pool referencing object from the list. + * @param filterPool Reference the reference to remove + * @param deReference true if we want to dereference the referenced object (call removeReference on it) + * @return the new count of referencing objects + */ + public int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, + boolean deReference) + { + int count = 0; + if (!deReference) + count = super.removeReferencingObject(filterPoolReference); + else + count = super.removeAndDeReferenceReferencingObject(filterPoolReference); + filterPoolReference.setParentReferenceManager(null); // DWD should be done in remove + invalidateFilterPoolReferencesCache(); + // callback to provider so they can fire events in their GUI + if (fireEvents && (caller != null)) + caller.filterEventFilterPoolReferenceDeleted(filterPoolReference); + quietSave(); + return count; + } + /** + * Return count of referenced filter pools + */ + public int getSystemFilterPoolReferenceCount() + { + return super.getReferencingObjectCount(); + } + + /** + * Return the zero-based position of a SystemFilterPoolReference object within this list + */ + public int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef) + { + return super.getReferencingObjectPosition(filterPoolRef); + } + + /** + * Move a given filter pool reference to a given zero-based location + * Calls back to inform provider of the event + */ + public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos) + { + int oldPos = super.getReferencingObjectPosition(filterPoolRef); + super.moveReferencingObjectPosition(pos, filterPoolRef); + invalidateFilterPoolReferencesCache(); + // callback to provider so they can fire events in their GUI + if (!noSave) + quietSave(); + if (fireEvents && (caller != null) && !noEvents) + { + ISystemFilterPoolReference[] refs = new ISystemFilterPoolReference[1]; + refs[0] = filterPoolRef; + caller.filterEventFilterPoolReferencesRePositioned(refs, pos-oldPos); + } + } + /** + * Move existing filter pool references a given number of positions. + * 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.

    + *

    + * Calls back to inform provider + * @param filterPoolRefs Array of SystemFilterPoolReferences to move. + * @param newPosition new zero-based position for the filter pool references. + */ + public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta) + { + int[] oldPositions = new int[filterPoolRefs.length]; + noEvents = noSave = true; + for (int idx=0; idx 0) // moving down, process backwards + for (int idx=filterPoolRefs.length-1; idx>=0; idx--) + moveSystemFilterPoolReference(filterPoolRefs[idx], oldPositions[idx]+delta); + else + for (int idx=0; idx Calls back to inform provider + */ + public void renameReferenceToSystemFilterPool(ISystemFilterPool pool) + { + ISystemFilterPoolReference poolRef = null; + IRSEBasePersistableReferencingObject[] refs = getReferencingObjects(); + for (int idx=0; (poolRef==null) && (idx + * This method is called after restore and for each restored object in the list must: + *

      + *
    1. Do what is necessary to find the referenced object, and set the internal reference pointer. + *
    2. Call addReference(this) on that object so it can maintain it's in-memory list + * of all referencing objects. + *
    3. Set the important transient variables + *
    + * @param relatedManagers the filter pool managers that hold filter pools we reference + * @param provider the host of this reference manager, so you can later call getProvider + * @return A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all + * were resolved. + */ + public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, + ISystemFilterPoolReferenceManagerProvider provider) + { + setSystemFilterPoolManagerProvider(relatedPoolMgrProvider); // sets poolMgrs = relatedManagers + setProvider(provider); + ISystemFilterPoolManager[] relatedManagers = getSystemFilterPoolManagers(); + if (relatedManagers != null) + { + Vector badRefs = new Vector(); + ISystemFilterPoolReference[] poolRefs = getSystemFilterPoolReferences(); + if (poolRefs != null) + { + for (int idx=0; idx + * @param mgrs The list of filter pool managers to scan for the given filter pool. + * @param mgrName The name of the manager to restrict the search to + * @param poolReferenceName The name of the filter pool as stored on disk. It may be qualified somehow + * to incorporate the manager name too. + */ + public static ISystemFilterPool getFilterPool(ISystemFilterPoolManager[] mgrs, String mgrName, String poolName) + { + ISystemFilterPoolManager mgr = getFilterPoolManager(mgrs, mgrName); + if (mgr == null) + return null; + return mgr.getSystemFilterPool(poolName); + } + /** + * Utility method to scan across all filter pool managers for a match on a give name. + *

    + * @param mgrs The list of filter pool managers to scan for the given name + * @param mgrName The name of the manager to restrict the search to + */ + public static ISystemFilterPoolManager getFilterPoolManager(ISystemFilterPoolManager[] mgrs, String mgrName) + { + ISystemFilterPoolManager mgr = null; + for (int idx=0; (mgr==null)&&(idx */ public class SystemFilterStartHere - implements ISystemFilterConstants + implements ISystemFilterConstants, ISystemFilterStartHere { + private static SystemFilterStartHere _instance; + public SystemFilterStartHere() + { + } + + public static SystemFilterStartHere getDefault() + { + if (_instance == null) + { + _instance = new SystemFilterStartHere(); + } + return _instance; + } + /** * Factory method to return an instance populated with defaults. * You can then simply override whatever is desired via setXXX methods. */ - public static IRSEFilterNamingPolicy createSystemFilterNamingPolicy() + public IRSEFilterNamingPolicy createSystemFilterNamingPolicy() { return SystemFilterNamingPolicy.getNamingPolicy(); } @@ -70,7 +89,7 @@ public class SystemFilterStartHere * to allow nested filters. This is the default, but can be overridden at the * individual filter pool level. */ - public static ISystemFilterPoolManager + public ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger, ISystemFilterPoolManagerProvider caller, @@ -97,7 +116,7 @@ public class SystemFilterStartHere * used, but you may find a use for it. * @param namingPolicy the naming policy object which will return the name of that one file. */ - public static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager( + public ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager( ISystemFilterPoolReferenceManagerProvider caller, ISystemFilterPoolManagerProvider relatedPoolMgrProvider, String name, IRSEFilterNamingPolicy namingPolicy) diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java index aaf665112b2..d040b17c5c7 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java @@ -23,12 +23,13 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.rse.core.ISystemUserIdConstants; import org.eclipse.rse.core.PasswordPersistenceManager; import org.eclipse.rse.core.SystemBasePlugin; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.RSEModelObject; +import org.eclipse.rse.core.model.SystemSignonInformation; +import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter; import org.eclipse.rse.logging.Logger; import org.eclipse.rse.logging.LoggerFactory; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; -import org.eclipse.rse.model.SystemSignonInformation; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; @@ -740,7 +741,10 @@ public abstract class AbstractConnectorService extends RSEModelObject implements */ public ISystemValidator getUserIdValidator() { - return getPrimarySubSystem().getSubSystemConfiguration().getUserIdValidator(); + ISubSystemConfiguration ssFactory = getPrimarySubSystem().getSubSystemConfiguration(); + ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class); + + return adapter.getUserIdValidator(ssFactory); } /** @@ -752,7 +756,10 @@ public abstract class AbstractConnectorService extends RSEModelObject implements */ public ISystemValidator getPasswordValidator() { - return getPrimarySubSystem().getSubSystemConfiguration().getPasswordValidator(); + ISubSystemConfiguration ssFactory = getPrimarySubSystem().getSubSystemConfiguration(); + ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)ssFactory.getAdapter(ISubSystemConfigurationAdapter.class); + + return adapter.getPasswordValidator(ssFactory); } /** * Optionally overridable, not implemented by default.
    diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java index 1c384afe36d..3eb4df8e2c1 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java @@ -18,9 +18,9 @@ package org.eclipse.rse.core.subsystems; import java.util.Hashtable; import java.util.Set; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.model.DummyHost; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.swt.widgets.Shell; diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index 7e89c2b50fd..8c0827536a1 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -32,20 +32,20 @@ import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemPreferencesManager; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IPropertySet; import org.eclipse.rse.core.model.ISystemModelChangeEvents; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.RSEModelObject; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; -import org.eclipse.rse.filters.ISystemFilterPoolReference; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManager; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManagerProvider; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.filters.ISystemFilterString; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemProfile; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.services.clientserver.messages.SystemMessage; @@ -107,7 +107,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS { - protected static final String SUBSYSTEM_FILE_NAME = "subsystem"; //$NON-NLS-1$ + protected static final String SUBSYSTEM_FILE_NAME = "subsystem"; //protected transient SubSystemConfiguration parentFactory = null; protected static final int OPERATION_RESOLVE_ABSOLUTE = 0; @@ -399,7 +399,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * user preferences, so that such things are not shared among the team on a synchronize operation. * This is transparent to callers of this method however, as this method resolves from the preferences. * - * @see org.eclipse.rse.model.IHost#getDefaultUserId() + * @see org.eclipse.rse.core.model.IHost#getDefaultUserId() * @see #setUserId(String) * @see #getLocalUserId() * @see #clearLocalUserId() @@ -438,7 +438,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS */ protected String getPreferencesKey(String profileName, String connectionName) { - String key = profileName + "." + connectionName + "." + getName(); //$NON-NLS-1$ //$NON-NLS-2$ + String key = profileName + "." + connectionName + "." + getName(); //System.out.println("in SubSystemImpl.getPreferencesKey(): Subsystem key name: " + key); return key; } @@ -467,7 +467,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * To set the local user Id, simply call setUserId(String id). To clear it, call * {@link #clearLocalUserId()}. *

    - * @see org.eclipse.rse.model.IHost#getDefaultUserId() + * @see org.eclipse.rse.core.model.IHost#getDefaultUserId() * @see #clearLocalUserId() * @see #getUserId() * @see #setUserId(String) @@ -482,7 +482,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * return the parent connection's default user Id. Sets the user Id attribute for this * subsystem to null. *

    - * @see org.eclipse.rse.model.IHost#getDefaultUserId() + * @see org.eclipse.rse.core.model.IHost#getDefaultUserId() * @see #getUserId() * @see #getLocalUserId() * @see #setUserId(String) @@ -672,7 +672,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * since it names a team sharable resource. Not qualified by the profile * name since that is implicit by being in a profile. */ - String name = "CN-" + connectionName; //$NON-NLS-1$ + String name = "CN-" + connectionName; // $NON-NLS-1$ return name; } @@ -746,7 +746,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS { for (int idx=0; !would && (idx *

    * @param filterString filter pattern for objects to return. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ public Object[] resolveFilterString(String filterString, Shell shell) throws Exception @@ -2030,7 +2030,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * returning them. * * @param filterStrings array of filter patterns for objects to return. - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Array of objects that are the result of resolving all the filter strings */ public Object[] resolveFilterStrings(String[] filterStrings, Shell shell) @@ -2288,7 +2288,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS *

    * @param parent Object that is being expanded. * @param filterString filter pattern for children of parent. Typically just "*". - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ public Object[] resolveFilterString(Object parent, String filterString, Shell shell) throws Exception @@ -2345,7 +2345,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * @param subject Identifies which object to get the properties of * @param key Identifies property to set * @param value Value to set property to - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Object interpretable by subsystem. Might be a Boolean, or the might be new value for confirmation. */ public Object setProperty(Object subject, String key, String value, Shell shell) @@ -2384,7 +2384,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * true for supportsProperties(). * @param subject Identifies which object to get the properties of * @param key Identifies property to get value of - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return String The value of the requested key. */ public String getProperty(Object subject, String key, Shell shell) @@ -2423,9 +2423,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * a number of remote environment variables. This is only applicable if the subsystem factory reports * true for supportsProperties(). * @param subject Identifies which object to get the properties of - * @param keys Identifies properties to set - * @param values Values to set properties to. One to one mapping to keys by index number - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param key Identifies property to set + * @param value Values to set properties to. One to one mapping to keys by index number + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @return Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation. */ public Object setProperties(Object subject, String[] keys, String[] values, Shell shell) @@ -2472,7 +2472,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS *

    * Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor). * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ public void connect(Shell shell) throws Exception { @@ -2512,7 +2512,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS *

    * Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor). * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @param forcePrompt Forces the signon prompt to be displayed even if a valid password in cached in memory * or saved on disk. */ @@ -2556,7 +2556,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS /** * A convenience method, fully equivalent to promptForPassword(shell, false). - * @param shell parent shell used to show any error messages. + * @param Shell parent shell used to show any error messages. */ public boolean promptForPassword(Shell shell) throws Exception { @@ -2568,7 +2568,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * but we have detected the user is not connected so we prompt for password outside * of the progress monitor, then set a flag to do the connection within the progress * monitor. - * @param shell parent shell used to show error messages. + * @param Shell parent shell used to show error messages. * @param force true if the prompting should be forced, false if prompting can be skipped if credentials have been stored. * @return true if the credentials are obtained */ @@ -2614,7 +2614,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS *

    * Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor). * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. */ public void disconnect(Shell shell) throws Exception { @@ -2628,7 +2628,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS *

    * Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor). * - * @param shell parent shell used to show error message. Null means you will handle showing the error message. + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. * @param collapseTree collapse the tree in the system view */ public void disconnect(Shell shell, boolean collapseTree) throws Exception @@ -2672,9 +2672,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS * a remote environment variable. This is only applicable if the subsystem factory reports * true for supportsProperties(). * @param subject Identifies which object to get the properties of - * @param keys Identifies properties to get value of - * @param shell parent shell used to show error message. Null means you will handle showing the error message. - * @return String[] The values of the requested keys. + * @param key Identifies property to get value of + * @param Shell parent shell used to show error message. Null means you will handle showing the error message. + * @return Object The values of the requested keys. */ public String[] getProperties(Object subject, String[] keys, Shell shell) throws Exception @@ -2979,7 +2979,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS */ protected String getFirstParentFilterString(Object parent) { - return "*"; //$NON-NLS-1$ + return "*"; } diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index 32a29210964..1a1dca020d3 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -32,33 +32,35 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemPreferencesManager; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterContainer; +import org.eclipse.rse.core.filters.ISystemFilterContainerReference; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager; +import org.eclipse.rse.core.filters.ISystemFilterSavePolicies; +import org.eclipse.rse.core.filters.ISystemFilterString; +import org.eclipse.rse.core.filters.SystemFilterPoolManager; import org.eclipse.rse.core.internal.subsystems.RemoteServerLauncherConstants; -import org.eclipse.rse.core.internal.subsystems.SubSystemFilterNamingPolicy; +import org.eclipse.rse.core.internal.subsystems.SubSystemConfigurationProxy; +import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.ISystemModelChangeEvents; +import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage; +import org.eclipse.rse.core.model.ISystemProfile; +import org.eclipse.rse.core.model.ISystemProfileManager; +import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.references.IRSEBaseReferencingObject; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterContainer; -import org.eclipse.rse.filters.ISystemFilterContainerReference; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; -import org.eclipse.rse.filters.ISystemFilterPoolReference; -import org.eclipse.rse.filters.ISystemFilterPoolReferenceManager; -import org.eclipse.rse.filters.ISystemFilterSavePolicies; -import org.eclipse.rse.filters.ISystemFilterString; import org.eclipse.rse.filters.SystemFilterPoolWrapperInformation; import org.eclipse.rse.filters.SystemFilterStartHere; -import org.eclipse.rse.internal.filters.SystemFilterPoolManager; import org.eclipse.rse.internal.model.SystemProfileManager; -import org.eclipse.rse.model.IHost; -import org.eclipse.rse.model.ISystemProfile; -import org.eclipse.rse.model.ISystemProfileManager; -import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.SystemResourceChangeEvent; import org.eclipse.rse.model.SystemStartHere; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; +import org.eclipse.rse.ui.SystemMenuManager; import org.eclipse.rse.ui.SystemPropertyResources; import org.eclipse.rse.ui.SystemResources; import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction; @@ -73,7 +75,6 @@ import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter; import org.eclipse.rse.ui.widgets.IServerLauncherForm; import org.eclipse.rse.ui.widgets.RemoteServerLauncherForm; import org.eclipse.rse.ui.wizards.ISubSystemPropertiesWizardPage; -import org.eclipse.rse.ui.wizards.ISystemNewConnectionWizardPage; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.dialogs.PropertyPage; @@ -164,7 +165,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration { super(); //initSubSystems(); - SystemBasePlugin.logDebugMessage(this.getClass().getName(), "STARTED SSFACTORY"); //$NON-NLS-1$ + SystemBasePlugin.logDebugMessage(this.getClass().getName(), "STARTED SSFACTORY"); } @@ -497,13 +498,13 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration // Get configured property page extenders IConfigurationElement[] propertyPageExtensions = - registry.getConfigurationElementsFor("org.eclipse.ui", "propertyPages"); //$NON-NLS-1$ //$NON-NLS-2$ + registry.getConfigurationElementsFor("org.eclipse.ui", "propertyPages"); for (int i = 0; i < propertyPageExtensions.length; i++) { IConfigurationElement configurationElement = propertyPageExtensions[i]; - String objectClass = configurationElement.getAttribute("objectClass"); //$NON-NLS-1$ - String name = configurationElement.getAttribute("name"); //$NON-NLS-1$ + String objectClass = configurationElement.getAttribute("objectClass"); + String name = configurationElement.getAttribute("name"); Class objCls = null; try { @@ -519,7 +520,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration { try { - PropertyPage page = (PropertyPage) configurationElement.createExecutableExtension("class"); //$NON-NLS-1$ + PropertyPage page = (PropertyPage) configurationElement.createExecutableExtension("class"); page.setTitle(name); propertyPages.add(page); } @@ -674,7 +675,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration */ public ImageDescriptor getImage() { - return proxy.getImage(); + return ((SubSystemConfigurationProxy)proxy).getImage(); } /** * Return actual graphics Image of this factory. @@ -707,7 +708,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration */ public ImageDescriptor getLiveImage() { - return proxy.getLiveImage(); + return ((SubSystemConfigurationProxy)proxy).getLiveImage(); } /** @@ -826,31 +827,14 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration { ISystemValidator userIdValidator = new ValidatorSpecialChar( - "=;", //$NON-NLS-1$ + "=;", false, RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_NOTVALID), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_USERID_EMPTY)); // false => allow empty? No. return userIdValidator; } - /** - * Return the validator for the password which is prompted for at runtime. - * Returns null by default. - */ - public ISystemValidator getPasswordValidator() - { - return null; - } - /** - * Return the validator for the port. - * A default is supplied. - * This must be castable to ICellEditorValidator for the property sheet support. - */ - public ISystemValidator getPortValidator() - { - ISystemValidator portValidator = new ValidatorPortInput(); - return portValidator; - } + /** * Called by SystemRegistry's renameSystemProfile method to ensure we update our @@ -1163,7 +1147,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration *

      *
    • calls {@link #createSubSystemInternal(IHost)} to create the subsystem *
    • does initialization of common attributes - *
    • if {@link #supportsFilters()}, creates a {@link org.eclipse.rse.filters.ISystemFilterPoolReferenceManager} for the + *
    • if {@link #supportsFilters()}, creates a {@link org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager} for the * subsystem to manage references to filter pools *
    • if (@link #supportsServerLaunchProperties()}, calls {@link #createServerLauncher(IConnectorService)}, to create * the server launcher instance to associate with this subsystem. This can be subsequently @@ -1200,7 +1184,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration // that are stored with a subsystem. //SystemFilterPoolManager[] relatedFilterPoolManagers = // getReferencableFilterPoolManagers(conn.getSystemProfile()); - ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); + ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getDefault().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); subsys.setFilterPoolReferenceManager(fprMgr); ISystemFilterPoolManager defaultFilterPoolManager = getFilterPoolManager(conn.getSystemProfile()); fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); @@ -1291,7 +1275,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration // that are stored with a subsystem. //SystemFilterPoolManager[] relatedFilterPoolManagers = // getReferencableFilterPoolManagers(newConnection.getSystemProfile()); - ISystemFilterPoolReferenceManager newRefMgr = SystemFilterStartHere.createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); + ISystemFilterPoolReferenceManager newRefMgr = SystemFilterStartHere.getDefault().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); ISystemFilterPoolManager defaultFilterPoolManager = null; if (copyProfileOperation) defaultFilterPoolManager = getFilterPoolManager(newConnection.getSystemProfile()); @@ -1779,7 +1763,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration //return name.equalsIgnoreCase("private"); ISystemProfile profile = getSystemProfile(mgr); //System.out.println("Testing for user private profile for mgr " + mgr.getName() + ": " + profile.isDefaultPrivate());; - return profile.isDefaultPrivate() || mgr.getName().equalsIgnoreCase("private"); //$NON-NLS-1$ + return profile.isDefaultPrivate() || mgr.getName().equalsIgnoreCase("private"); } /** @@ -2021,10 +2005,10 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration if (ss.getSystemProfile() != profile) // if restoring subsystem's profile != found pool's profile { IHost conn = ss.getHost(); - String connectionName = conn.getSystemProfileName() + "." + conn.getAliasName(); //$NON-NLS-1$ + String connectionName = conn.getSystemProfileName() + "." + conn.getAliasName(); SystemMessage sysMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED); sysMsg.makeSubstitution(missingPoolMgrName, connectionName); - SystemBasePlugin.logWarning(sysMsg.getFullMessageID() + ": " + sysMsg.getLevelOneText()); //$NON-NLS-1$ + SystemBasePlugin.logWarning(sysMsg.getFullMessageID() + ": " + sysMsg.getLevelOneText()); if (brokenReferenceWarningsIssued.get(missingPoolMgrName) == null) { SystemMessageDialog msgDlg = new SystemMessageDialog(null, sysMsg); @@ -2815,7 +2799,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration // that are stored with a subsystem. //SystemFilterPoolManager[] relatedFilterPoolManagers = // getReferencableFilterPoolManagers(conn.getSystemProfile()); - ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); + ISystemFilterPoolReferenceManager fprMgr = SystemFilterStartHere.getDefault().createSystemFilterPoolReferenceManager(subsys, this, subsys.getName(), filterNamingPolicy); subsys.setFilterPoolReferenceManager(fprMgr); ISystemFilterPoolManager defaultFilterPoolManager = getFilterPoolManager(conn.getSystemProfile()); fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); @@ -2936,7 +2920,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration { StringBuffer nameBuf = new StringBuffer(); nameBuf.append(profileName); - nameBuf.append(":"); //$NON-NLS-1$ + nameBuf.append(":"); nameBuf.append(factoryId); /* String name = SystemResources.RESID_DEFAULT_FILTERPOOL; diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemHelpers.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemHelpers.java index f47606ed543..b0d7bfed353 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemHelpers.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemHelpers.java @@ -16,13 +16,13 @@ package org.eclipse.rse.core.subsystems; -import org.eclipse.rse.filters.ISystemFilter; -import org.eclipse.rse.filters.ISystemFilterContainer; -import org.eclipse.rse.filters.ISystemFilterPool; -import org.eclipse.rse.filters.ISystemFilterPoolManager; -import org.eclipse.rse.filters.ISystemFilterPoolReference; -import org.eclipse.rse.filters.ISystemFilterReference; -import org.eclipse.rse.model.ISystemProfile; +import org.eclipse.rse.core.filters.ISystemFilter; +import org.eclipse.rse.core.filters.ISystemFilterContainer; +import org.eclipse.rse.core.filters.ISystemFilterPool; +import org.eclipse.rse.core.filters.ISystemFilterPoolManager; +import org.eclipse.rse.core.filters.ISystemFilterPoolReference; +import org.eclipse.rse.core.filters.ISystemFilterReference; +import org.eclipse.rse.core.model.ISystemProfile; /** * Static helper methods