Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'rse/plugins/org.eclipse.rse.connectorservice.dstore')
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/.classpath11
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/.cvsignore1
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/.project34
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/.settings/org.eclipse.jdt.core.prefs71
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/META-INF/MANIFEST.MF24
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/about.html28
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/build.properties18
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.properties20
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.xml25
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java1495
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java114
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreConstants.java88
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreMessages.java60
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreSubSystem.java26
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalSubSystemConfiguration.java26
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java284
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnostic.java80
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnosticFactory.java29
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java494
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitorFactory.java78
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java108
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java76
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties76
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.java49
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.properties37
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IConnectorServiceMessageIds.java59
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IDStoreDefaultPreferenceConstants.java23
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java1218
-rw-r--r--rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ui/propertypages/DStorePreferencePage.java333
29 files changed, 0 insertions, 4985 deletions
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.classpath b/rse/plugins/org.eclipse.rse.connectorservice.dstore/.classpath
deleted file mode 100644
index 089217cde..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/dstore/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.cvsignore b/rse/plugins/org.eclipse.rse.connectorservice.dstore/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.project b/rse/plugins/org.eclipse.rse.connectorservice.dstore/.project
deleted file mode 100644
index 1e7ae5944..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.rse.connectorservice.dstore</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.settings/org.eclipse.jdt.core.prefs b/rse/plugins/org.eclipse.rse.connectorservice.dstore/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 381fc6eb0..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,71 +0,0 @@
-#Fri Mar 28 14:14:24 CET 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.connectorservice.dstore/META-INF/MANIFEST.MF
deleted file mode 100644
index 650c68e79..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.rse.connectorservice.dstore;singleton:=true
-Bundle-Version: 3.0.0.qualifier
-Bundle-Activator: org.eclipse.rse.internal.connectorservice.dstore.Activator
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.rse.services;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.rse.services.dstore;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.dstore.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.dstore.extra;bundle-version="[2.1.0,3.0.0)",
- org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Eclipse-LazyStart: true
-Export-Package:
- org.eclipse.rse.connectorservice.dstore,
- org.eclipse.rse.connectorservice.dstore.util,
- org.eclipse.rse.internal.connectorservice.dstore;x-internal:=true,
- org.eclipse.rse.internal.connectorservice.dstore.ui.propertypages;x-internal:=true
-Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/about.html b/rse/plugins/org.eclipse.rse.connectorservice.dstore/about.html
deleted file mode 100644
index d4cc693f9..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/build.properties b/rse/plugins/org.eclipse.rse.connectorservice.dstore/build.properties
deleted file mode 100644
index 7911f574b..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
-# 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
-###############################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties,\
- plugin.xml
-source.. = src/
-output.. = bin/
-src.includes = about.html
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.properties b/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.properties
deleted file mode 100644
index faff66f5a..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2008 IBM Corporation and others.
-# 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
-###############################################################################
-
-# NLS_MESSAGEFORMAT_NONE
-# NLS_ENCODING=UTF-8
-
-pluginName = RSE DStore Connector Service
-providerName = Eclipse.org
-
-# START NON-TRANSLATABLE
-PreferencePage.Datastore = DataStore
-# END NON-TRANSLATABLE
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.xml b/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.xml
deleted file mode 100644
index 219eb8b28..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/plugin.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2008 IBM Corporation and others. 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
-
-Contributors:
--->
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="%PreferencePage.Datastore"
- category="org.eclipse.rse.ui.preferences.RemoteSystemsPreferencePage"
- class="org.eclipse.rse.internal.connectorservice.dstore.ui.propertypages.DStorePreferencePage"
- id="org.eclipse.rse.connectorservice.DStorePreferences">
- </page>
- </extension>
-</plugin>
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
deleted file mode 100644
index 09f42c1de..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java
+++ /dev/null
@@ -1,1495 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * 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:
- * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
- * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
- * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
- * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes
- * David McKnight (IBM) - [202822] need to enable spiriting on the server side
- * David McKnight (IBM) - [199565] taking out synchronize for internalConnect
- * David McKnight (IBM) - [205986] attempt SSL before non-SSL for daemon connect
- * David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
- * David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup
- * David McKnight (IBM) - [216596] dstore preferences (timeout, and others)
- * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
- * David McKnight (IBM) - [218685] [api][breaking][dstore] Unable to connect when using SSL.
- * David McKnight (IBM) - [220123][dstore] Configurable timeout on irresponsiveness
- * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
- * David McKnight (IBM) - [220123] [api][dstore] Configurable timeout on irresponsiveness
- * David McKnight (IBM) - [223204] [cleanup] fix broken nls strings in files.ui and others
- * David Dykstal (IBM) - [225089][ssh][shells][api] Canceling connection leads to exception
- * David McKnight (IBM) - [227406] [dstore] DStoreFileService must listen to buffer size preference changes
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- *******************************************************************************/
-
-package org.eclipse.rse.connectorservice.dstore;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.security.cert.X509Certificate;
-import java.util.List;
-
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.dstore.core.client.ClientConnection;
-import org.eclipse.dstore.core.client.ConnectionStatus;
-import org.eclipse.dstore.core.java.IRemoteClassInstance;
-import org.eclipse.dstore.core.java.RemoteClassLoader;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.IDataStoreConstants;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.dstore.core.model.ISSLProperties;
-import org.eclipse.dstore.internal.core.client.ClientSSLProperties;
-import org.eclipse.dstore.internal.core.util.XMLparser;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener;
-import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor;
-import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory;
-import org.eclipse.rse.core.RSECorePlugin;
-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.CommunicationsEvent;
-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.core.subsystems.ISubSystem;
-import org.eclipse.rse.core.subsystems.ServerLaunchType;
-import org.eclipse.rse.core.subsystems.SubSystem;
-import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
-import org.eclipse.rse.internal.connectorservice.dstore.Activator;
-import org.eclipse.rse.internal.connectorservice.dstore.ConnectorServiceResources;
-import org.eclipse.rse.internal.connectorservice.dstore.IConnectorServiceMessageIds;
-import org.eclipse.rse.internal.connectorservice.dstore.RexecDstoreServer;
-import org.eclipse.rse.internal.ui.SystemPropertyResources;
-import org.eclipse.rse.services.clientserver.messages.CommonMessages;
-import org.eclipse.rse.services.clientserver.messages.ICommonMessageIds;
-import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBasePlugin;
-import org.eclipse.rse.ui.actions.DisplayHidableSystemMessageAction;
-import org.eclipse.rse.ui.actions.DisplaySystemMessageAction;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.rse.ui.subsystems.StandardConnectorService;
-import org.eclipse.swt.widgets.Display;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Version;
-
-/**
- * System class required by the remote systems framework.
- * This represents the live connection at tool runtime.
- * <p>
- * The universal subsystems are based on datastore technology so we use that
- * to do the connection.
- */
-public class DStoreConnectorService extends StandardConnectorService implements IDataStoreProvider
-{
- private class StartSpiritThread extends Thread
- {
- private DataStore _dataStore;
- public StartSpiritThread(DataStore dataStore)
- {
- _dataStore = dataStore;
- }
-
- public void run()
- {
- if (_dataStore.isDoSpirit()) _dataStore.queryServerSpiritState();
- }
- }
-
- private ClientConnection clientConnection = null;
- private ConnectionStatusListener _connectionStatusListener = null;
- private IServerLauncher starter = null;
- private IServerLauncherProperties _remoteServerLauncherProperties = null;
- private boolean _isConnecting = false;
-
- // Shortcut to sysInfo to save time
- private transient DataElement sysInfo = null;
- private transient DataElement installInfo = null;
- private transient DataElement clientIP = null;
- private static String DSTORE_PACKAGE = "org.eclipse.dstore.core"; //$NON-NLS-1$
-
- private Exception connectException;
- private class ShowConnectMessage implements Runnable
- {
- private SystemMessage _msg;
- public ShowConnectMessage(SystemMessage msg)
- {
- _msg = msg;
- }
-
- public void run()
- {
- SystemMessageDialog dlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), _msg);
- dlg.open();
- }
- }
-
- /**
- * Constructor when we don't have a subsystem yet.
- * Call setSubSystem after.
- */
- public DStoreConnectorService(String name, String description, IHost host)
- {
- super(name, description, host, 0);
- }
-
-
-
- /*
- * Set the subsystem, when its not known at constructor time
- *
- public void setSubSystem(SubSystem ss)
- {
- super.setSubSystem(ss);
- setDaemonLaunchEnabled((SubSystemImpl)ss, false);
- }*/
-
-
- public int getServerVersion()
- {
- return clientConnection.getServerVersion();
- }
-
- public int getServerMinor()
- {
- return clientConnection.getServerMinor();
- }
-
- /**
- * Retrieve the value of a property which is contained in the environment miners
- * system info child. Currently supported properties:
- * <ul>
- * <li>os.name
- * <li>os.version
- * <li>user.home
- * <li>temp.dir
- * </ul>
- * @return The String value of the property or "" if the property was not found.
- */
- private String getSystemInfoProperty(String propertyName)
- {
- // System properties require a connection
- if (!isConnected())
- {
- try
- {
- ISubSystem ss = getPrimarySubSystem();
- if (ss != null)
- {
- if (Display.getCurrent() == null) {
- ss.connect(new NullProgressMonitor(), false);
- } else {
- ss.connect(false, null);
- }
- }
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError("UniversalSystem.getSystemInfoProperty: error during connect", e); //$NON-NLS-1$
- return ""; //$NON-NLS-1$
- }
- }
-
- String propertyValue = null;
- DataElement envMinerData = null;
- DataStore ds = getDataStore();
-
- // Check if we have sysInfo cached already
- if (sysInfo == null)
- {
- envMinerData = ds.findMinerInformation(IUniversalDataStoreConstants.UNIVERSAL_ENVIRONMENT_MINER_ID);
- if (envMinerData != null)
- {
- sysInfo = ds.find(envMinerData, DE.A_NAME, "systemInfo", 1); //$NON-NLS-1$
- }
- }
-
- if (sysInfo != null)
- {
- DataElement propertyNode = ds.find(sysInfo, DE.A_NAME, propertyName, 1);
- if (propertyNode != null)
- {
- propertyValue = propertyNode.getSource();
- }
- else
- propertyValue = ""; //$NON-NLS-1$
- }
- else
- {
- // at connect time, the info node is not guaranteed to be present, so this gets logged a lot
- // it doesn't cause any functional problems, so I'm commenting this out
- //SystemBasePlugin.logError("UniversalSystem.getSystemInfoNode: sysInfo node not found", null); //$NON-NLS-1$
- //SystemBasePlugin.logError("UniversalSystem.getSystemInfoNode: miner data = " + envMinerData, null); //$NON-NLS-1$
- propertyValue = ""; //$NON-NLS-1$
- }
-
- return propertyValue;
- }
-
- /**
- * Return the version, release, modification of the remote system
- */
- public String getVersionReleaseModification()
- {
- if (!isConnected())
- return SystemPropertyResources.RESID_TERM_NOTAVAILABLE;
-
- StringBuffer buffer = new StringBuffer(getSystemInfoProperty("os.name")); //$NON-NLS-1$
- buffer.append(" "); //$NON-NLS-1$
- buffer.append(getSystemInfoProperty("os.version")); //$NON-NLS-1$
-
- return buffer.toString();
- }
-
- /**
- * Return the home directory of the remote system for the current user, if available.
- */
- public String getHomeDirectory()
- {
- return getSystemInfoProperty("user.home"); //$NON-NLS-1$
- }
-
- public boolean runClassInstanceRemotely(IRemoteClassInstance instance)
- {
- DataStore dataStore = getDataStore();
- dataStore.registerLocalClassLoader(instance.getClass().getClassLoader());
- dataStore.runRemoteClassInstance(instance);
- return true;
- }
-
- /**
- * Return the location where the RSE server is installed
- * @return the server install location
- */
- public String getServerInstallPath()
- {
- if (clientConnection != null)
- {
- if (installInfo == null)
- {
- DataStore ds = clientConnection.getDataStore();
- installInfo = ds.queryInstall();
- }
- return installInfo.getAttribute(DE.A_SOURCE);
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return the Client IP that the RSE server is connected to. When connected,
- * the client IP is obtained from the server-side. When not-connected,
- * the fall back is to get the IP locally (note that the IP obtained locally
- * may be not be what you want when using VPN).
- * @return the client ip
- */
- public String getClientIP()
- {
- if (clientConnection != null && clientConnection.isConnected())
- {
- if (clientIP == null)
- {
- DataStore ds = clientConnection.getDataStore();
- clientIP = ds.queryClientIP();
- }
- return clientIP.getAttribute(DE.A_SOURCE);
- }
-
- // fall back to getting local machine ip address
- // this may be incorrect for the server in certain cases
- // like over VPN
- return RSECorePlugin.getLocalMachineIPAddress();
- }
-
- /**
- * Return the temp directory of the remote system for the current user, if available.
- */
- public String getTempDirectory()
- {
- return getSystemInfoProperty("temp.dir"); //$NON-NLS-1$
- }
-
- protected int getSocketTimeOutValue()
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- return store.getInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT);
- }
-
- /**
- * @see org.eclipse.rse.core.subsystems.IConnectorService#disconnect(IProgressMonitor)
- */
- protected void internalDisconnect(IProgressMonitor monitor) throws Exception
- {
- try
- {
- if (clientConnection != null)
- {
- // Is disconnect being called because the network (connection) went down?
- if (_connectionStatusListener != null && _connectionStatusListener.isConnectionDown())
- {
- notifyError();
- }
- else
- {
- // Fire comm event to signal state about to change
- fireCommunicationsEvent(CommunicationsEvent.BEFORE_DISCONNECT);
- }
-
- DataStore dataStore = getDataStore();
- if (dataStore != null && _connectionStatusListener != null)
- {
- dataStore.getDomainNotifier().removeDomainListener(_connectionStatusListener);
- }
- if (clientConnection != null)
- {
- clientConnection.disconnect();
- }
-
-// Fire comm event to signal state changed
- notifyDisconnection();
-
- clientConnection = null;
- // DKM - no need to clear uid cache
- clearPassword(false, true); // clear in-memory password
- //clearUserIdCache(); // Clear any cached local user IDs
- sysInfo = null;
- installInfo = null;
- clientIP = null;
-
-
- }
- }
- catch (Exception exc)
- {
- throw new java.lang.reflect.InvocationTargetException(exc);
- }
- }
-
- private IRemoteServerLauncher getDStoreServerLauncher()
- {
- IServerLauncherProperties sl = getRemoteServerLauncherProperties();
- //System.out.println("in UniversalSystem#getServerLauncher: sl = "+sl);
- if (sl != null && sl instanceof IRemoteServerLauncher)
- {
- return (IRemoteServerLauncher)sl;
- }
- else
- //return ((SubSystemConfigurationImpl)ss.getParentSubSystemConfiguration()).getDefaultIBMServerLauncher(ss);
- return null; // should never happen!
- }
-
- protected void setPluginPathProperty()
- {
- Bundle bundle = RSEUIPlugin.getDefault().getBundle();
- URL pluginsURL = bundle.getEntry("/"); //$NON-NLS-1$
-
- try
- {
- String path = FileLocator.resolve(pluginsURL).getPath();
- File systemsPluginDir = new File(path);
- path = systemsPluginDir.getParentFile().getAbsolutePath();
- String version = (String)(bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION));
- Version v = new Version(version);
- String versionString = v.toString();
- String dstorePath = getDStorePath(path, versionString);
- System.setProperty("A_PLUGIN_PATH", dstorePath); //$NON-NLS-1$
- }
- catch (IOException e)
- {
- }
- }
-
- private String getDStorePath(String pluginDir, String version)
- {
- File dstorePath = new File(pluginDir + "/" + DSTORE_PACKAGE + "_" + version); //$NON-NLS-1$ //$NON-NLS-2$
- if (!dstorePath.exists())
- {
- // might be in workspace
- dstorePath = new File(pluginDir + "/" + DSTORE_PACKAGE); //$NON-NLS-1$
- }
-
- return dstorePath.getAbsolutePath();
- }
-
-// /**
-// * Specify if you support connecting to a running daemon
-// * @deprecated use {@link #enableServerLaunchType(ISubSystem, ServerLaunchType, boolean)}
-// * or your subsystem factory should override {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
-// */
-// public void setDaemonLaunchEnabled(SubSystem subsystemImpl, boolean enable) {
-// enableServerLaunchType(subsystemImpl, ServerLaunchType.DAEMON_LITERAL, enable);
-// }
-
-// /**
-// * Return if you support connecting to a running daemon
-// * @deprecated Use instead {@link #isEnabledServerLaunchType(ISubSystem, ServerLaunchType)}
-// * or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
-// */
-// public boolean getDaemonLaunchEnabled(SubSystem subsystemImpl) {
-// return isEnabledServerLaunchType(subsystemImpl, ServerLaunchType.DAEMON_LITERAL);
-// }
-
-// /**
-// * Specify if you support remotely launching a server script
-// * @deprecated use {@link #enableServerLaunchType(ISubSystem, ServerLaunchType, boolean)}
-// * or your subsystem factory should override {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
-// */
-// public void setRexecLaunchEnabled(SubSystem subsystemImpl, boolean enable) {
-// enableServerLaunchType(subsystemImpl, ServerLaunchType.REXEC_LITERAL, enable);
-// }
-
- /**
- * Return if you support remotely launching a server script
- * @deprecated Use instead {@link #isServerLaunchTypeEnabled(ISubSystem, ServerLaunchType)}
- * or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
- */
- public boolean getRexecLaunchEnabled(SubSystem subsystemImpl) {
- return isServerLaunchTypeEnabled(subsystemImpl, ServerLaunchType.REXEC_LITERAL);
- }
-
-// /**
-// * Specify if you support connecting to a server already running
-// * @deprecated use {@link #enableServerLaunchType(ISubSystem, ServerLaunchType, boolean)}
-// * or your subsystem factory should override {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
-// */
-// public void setNoLaunchEnabled(SubSystem subsystemImpl, boolean enable) {
-// enableServerLaunchType(subsystemImpl, ServerLaunchType.RUNNING_LITERAL, enable);
-// }
-
- /**
- * Return if you support connecting to a server already running
- * @deprecated Use instead {@link #isServerLaunchTypeEnabled(ISubSystem, ServerLaunchType)}
- * or {@link org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchType(ServerLaunchType)}
- */
- public boolean getNoLaunchEnabled(SubSystem subsystemImpl) {
- return isServerLaunchTypeEnabled(subsystemImpl, ServerLaunchType.RUNNING_LITERAL);
- }
-
- /**
- * Return the remote server launcher, which implements IServerLauncher.
- * This is called by the default implementation of connect, if
- * subsystem.getParentSubSystemConfiguration().supportsServerLaunchProperties returns true.
- */
- public IServerLauncher getRemoteServerLauncher()
- {
-
- if (starter == null)
- starter = new RexecDstoreServer();
- ((RexecDstoreServer)starter).setClientConnection(clientConnection);
- ((RexecDstoreServer)starter).setSocketTimeoutValue(getSocketTimeOutValue());
- return starter;
- }
-
- public IServerLauncherProperties getRemoteServerLauncherProperties() {
- return _remoteServerLauncherProperties;
- }
-
- public void setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher) {
- if (_remoteServerLauncherProperties != newRemoteServerLauncher)
- {
- _remoteServerLauncherProperties = newRemoteServerLauncher;
- setDirty(true);
- }
- }
-
- /**
- * @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor)
- */
- protected void internalConnect(IProgressMonitor monitor) throws Exception
- {
- if (isConnected() || _isConnecting) {
- return;
- }
-
- _isConnecting = true;
-
- // set A_PLUGIN_PATH so that dstore picks up the property
- setPluginPathProperty();
-
- // Fire comm event to signal state about to change
- fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT);
-
- ConnectionStatus connectStatus = null;
- ConnectionStatus launchStatus = null;
-
- clientConnection = new ClientConnection(getPrimarySubSystem().getHost().getAliasName());
-
- clientConnection.setHost(getHostName());
- clientConnection.setPort(Integer.toString(getPort()));
-
-// ISubSystem ss = getPrimarySubSystem();
- getPrimarySubSystem();
- IRemoteServerLauncher serverLauncher = getDStoreServerLauncher();
-
- ServerLaunchType serverLauncherType = null;
- boolean autoDetectSSL = true;
- if (serverLauncher != null)
- {
- serverLauncherType = serverLauncher.getServerLaunchType();
- autoDetectSSL = serverLauncher.getAutoDetectSSL();
- }
- else
- {
- // System.out.println("server launcher is null");
- }
-
- //long t1 = System.currentTimeMillis();
- SystemMessage msg = null;
- boolean launchFailed = false;
-
- // get Socket Timeout Value Preference
- int timeout = getSocketTimeOutValue();
-
- if (serverLauncherType == ServerLaunchType.REXEC_LITERAL)
- {
- if (monitor != null)
- {
- String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_REXEC;
- monitor.subTask(cmsg);
- }
-
- SystemSignonInformation info = getSignonInformation();
-
- // GC: - if failed to get a connection in another way, try
- // starting the datastore server with rexec
- IServerLauncher starter = getRemoteServerLauncher();
- starter.setSignonInformation(info);
- starter.setServerLauncherProperties(serverLauncher);
- if (autoDetectSSL) timeout = 3000;
- else setSSLProperties(isUsingSSL());
-
- int iServerPort = launchUsingRexec(info, serverLauncher, monitor);
-
- if(iServerPort != 0)
- {
- clientConnection.setPort("" + iServerPort); //$NON-NLS-1$
-
- if (monitor != null)
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort());
- monitor.subTask(cmsg);
- }
-
- // connect to launched server
- connectStatus = clientConnection.connect(null, timeout);
- if (!connectStatus.isConnected() && connectStatus.getMessage().startsWith(ClientConnection.CANNOT_CONNECT) && autoDetectSSL)
- {
- if (setSSLProperties(true))
- {
- iServerPort = launchUsingRexec(info, serverLauncher, monitor);
- if (iServerPort != 0)
- {
- clientConnection.setPort("" + iServerPort); //$NON-NLS-1$
- connectStatus = clientConnection.connect(null, timeout);
- }
- }
- }
- }
- else
- {
- launchFailed = true;
- connectStatus = new ConnectionStatus(false);
- msg = starter.getErrorMessage();
- String errorMsg = null;
- if (msg == null)
- {
- errorMsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName());
- }
- else
- {
- errorMsg = msg.getLevelTwoText();
- }
- connectStatus.setMessage(errorMsg);
- }
- }
- // Start the server via the daemon
- else if (serverLauncherType == ServerLaunchType.DAEMON_LITERAL)
- {
- if (monitor != null)
- {
- String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_DAEMON;
- monitor.subTask(cmsg);
- }
-
- // DY: getLocalUserId() may return null for Windows connections because
- // we no longer prompt for userid / pwd. But for other connections the userid
- // should be the same as the one stored in the password info (and for Windows
- // this will be the temp remoteuser userid.
- //launchStatus = clientConnection.launchServer(getLocalUserId(), getPassword(getPasswordInformation()));
- SystemSignonInformation info = getSignonInformation();
- if (info == null)
- {
- SystemBasePlugin.logError("password info = null!"); //$NON-NLS-1$
- }
-
- int daemonPort = 0;
- if (serverLauncher != null)
- daemonPort = serverLauncher.getDaemonPort();
-
- /* String daemonPortStr = getSubSystem().getVendorAttribute("Remote", "DAEMON_PORT");
- if (daemonPortStr != null && daemonPortStr.length() > 0)
- {
- daemonPort = Integer.parseInt(daemonPortStr);
- }*/
-
- // 205986] FIRST TRY SSL, THEN NON-SECURE!
- boolean usedSSL = true;
- setSSLProperties(true);
-
- launchStatus = launchServer(clientConnection, info, daemonPort, monitor, timeout);
- if (!launchStatus.isConnected() && !clientConnection.isKnownStatus(launchStatus.getMessage()))
- {
- Throwable conE = launchStatus.getException();
- if (conE instanceof SSLHandshakeException)
- {
- List certs = launchStatus.getUntrustedCertificates();
- if (certs != null && certs.size() > 0)
- {
- ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
- if (provider != null)
- {
- _isConnecting = false;
- if (provider.importCertificates(certs, getHostName()))
- {
- connect(monitor);
- return;
- }
- else
- {
- throw new InterruptedException();
- }
- }
- }
-
- }
-
- if (setSSLProperties(false))
- {
- usedSSL = false;
- launchStatus = launchServer(clientConnection, info, daemonPort, monitor, timeout);
- }
- }
-
- if (!launchStatus.isConnected())
- {
- String launchMsg = launchStatus.getMessage();
- // If password has expired and must be changed
- if (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg)))
- {
- SystemSignonInformation oldCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials();
- SystemSignonInformation newCredentials = null;
- while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg)))
- {
- String pmsg = null;
- String pmsgDetails = null;
- String msgId = null;
- boolean expired = isPasswordExpired(launchMsg);
- if (expired){
- pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED;
- pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS;
- msgId = IConnectorServiceMessageIds.MSG_VALIDATE_PASSWORD_EXPIRED;
- }
- else {
- pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID;
- pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS;
- msgId = IConnectorServiceMessageIds.MSG_VALIDATE_PASSWORD_INVALID;
- }
-
- SystemMessage message = createSystemMessage(msgId,IStatus.ERROR, pmsg, pmsgDetails);
- getCredentialsProvider().repairCredentials(message);
- newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials();
- launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword());
- launchMsg = launchStatus.getMessage();
- }
- if (newCredentials != null)
- {
- info = newCredentials;
- }
- if (launchMsg != null && launchMsg.equals(IDataStoreConstants.ATTEMPT_RECONNECT))
- {
- _isConnecting = false;
- internalConnect(monitor);
- return;
- }
- }
- else if (launchMsg != null && isPortOutOfRange(launchMsg))
- {
- _isConnecting = false;
- launchFailed = true;
-
-
- int colonIndex = launchMsg.indexOf(':');
- String portRange = launchMsg.substring(colonIndex + 1);
-
- String pmsg =NLS.bind(ConnectorServiceResources.MSG_PORT_OUT_RANGE, portRange);
- SystemMessage message = createSystemMessage(IConnectorServiceMessageIds.MSG_PORT_OUT_RANGE, IStatus.ERROR, pmsg);
-
- ShowConnectMessage msgAction = new ShowConnectMessage(message);
- Display.getDefault().asyncExec(msgAction);
- return;
- }
- else
- {
- launchFailed = true;
- SystemBasePlugin.logError("Error launching server: " + launchStatus.getMessage(), null); //$NON-NLS-1$
- }
- }
- if (launchStatus.isConnected())
- {
- if (monitor != null)
- {
- if (clientConnection == null){
- SystemBasePlugin.logError("client connection is null!"); //$NON-NLS-1$
- }
- String pmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort());
- monitor.subTask(pmsg);
- }
- // connect to launched server
- connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout);
- Throwable conE = connectStatus.getException();
- if (!connectStatus.isConnected() &&
- (connectStatus.getMessage().startsWith(ClientConnection.CANNOT_CONNECT) ||
- conE instanceof SSLException
- )
- )
- {
- _isConnecting = false;
- if (conE instanceof SSLHandshakeException)
- {
- List certs = connectStatus.getUntrustedCertificates();
- if (certs != null && certs.size() > 0)
- {
- ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
- if (provider != null)
- {
-
- if (provider.importCertificates(certs, getHostName()))
- {
- connect(monitor);
- return;
- }
- else
- {
- throw new InterruptedException();
- }
- }
- }
-
- }
- launchStatus = launchServer(clientConnection, info, daemonPort, monitor);
- if (!launchStatus.isConnected())
- {
- launchFailed = true;
- }
- else
- {
- if (setSSLProperties(!usedSSL))
- {
- connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout);
- }
- }
- }
- if (!connectStatus.isConnected() && connectStatus.isSLLProblem())
- {
- _isConnecting = false;
- importCertsAndReconnect(connectStatus, monitor);
- return;
- }
-
- /*
- if (connectStatus != null && connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_UPDATE))
- {
- // offer to update it
- clientConnection.getDataStore().queryInstall();
- }
- */
- }
- else
- {
- connectStatus = new ConnectionStatus(false);
-
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName());
- connectStatus.setMessage(cmsg);
- }
- }
- else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL)
- {
- if (monitor != null)
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort());
- monitor.subTask(cmsg);
- }
- // connection directly
- boolean useSSL = isUsingSSL();
- setSSLProperties(useSSL);
- connectStatus = clientConnection.connect(null, timeout);
- }
- // server launcher type is unknown
- else
- {
- SystemSignonInformation info = getSignonInformation();
- connectStatus = launchServer(clientConnection, info, serverLauncher, monitor);
- if (!connectStatus.isConnected() && !clientConnection.isKnownStatus(connectStatus.getMessage()))
- {
- if (setSSLProperties(true))
- {
- connectStatus = launchServer(clientConnection, info, serverLauncher, monitor);
- if (!connectStatus.isConnected() && connectStatus.isSLLProblem())
- {
- _isConnecting = false;
- importCertsAndReconnect(connectStatus, monitor);
- return;
- }
- }
- }
-
- }
-
- // if connected
- if (connectStatus != null && connectStatus.isConnected())
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- if (clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_SSL))
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_USING_SSL, getHostName());
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_USING_SSL, IStatus.INFO, cmsg);
-
- DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_SSL);
- Display.getDefault().syncExec(msgAction);
- if (msgAction.getReturnCode() != IDialogConstants.YES_ID)
- {
- internalDisconnect(monitor);
- _isConnecting = false;
- throw new InterruptedException();
- }
- }
- else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL))
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName());
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_NOT_USING_SSL, IStatus.INFO, cmsg);
-
- DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_NONSSL);
- Display.getDefault().syncExec(msgAction);
- if (msgAction.getReturnCode() != IDialogConstants.YES_ID)
- {
- internalDisconnect(monitor);
- _isConnecting = false;
- throw new InterruptedException();
- }
- }
-
- DataStore dataStore = clientConnection.getDataStore();
-
- _connectionStatusListener = new ConnectionStatusListener(dataStore.getStatus(), this);
- dataStore.getDomainNotifier().addDomainListener(_connectionStatusListener);
-
-
-
- // DKM: dataStore needs a miners location
- // for now, I'll use dstore.miners as default location
- // (I've inserted the universal miner in it's minerFile.dat file)
-
- // DY: defect 46811 The minerFile.dat does not exist in this directory which causes a
- // java.io.FileNotFoundException to be printed to the console (not very
- // encouraging for the end user.) So I'm setting it to the current directory (.)
- // which should be where the code is run from
- //dataStore.addMinersLocation("org.eclipse.dstore.miners");
-
-
- StatusMonitor statusMonitor = StatusMonitorFactory.getInstance().getStatusMonitorFor(this, dataStore);
-
- if (launchStatus != null && launchStatus.isConnected())
- {
- //dataStore.showTicket(launchStatus.getTicket()); // send security token to server, this must be done first
- DataElement ticket = dataStore.createTicket(launchStatus.getTicket());
- dataStore.queryShowTicket(ticket);
- //statusMonitor.waitForUpdate(ticketStatus);
- }
- else
- {
- dataStore.showTicket(null);
- }
-
- // if (dataStore.isDoSpirit()) dataStore.queryServerSpiritState();
- StartSpiritThread thread = new StartSpiritThread(dataStore);
- thread.start();
-
- // Fire comm event to signal state changed
- fireCommunicationsEvent(CommunicationsEvent.AFTER_CONNECT);
-
- // is there a warning message?
- String message = connectStatus.getMessage();
- if (message != null)
- {
- if (message.startsWith(ClientConnection.CLIENT_OLDER))
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING, getHostName());
- String cmsgDetail = ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING_DETAILS;
-
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_CLIENT_OLDER_WARNING, IStatus.WARNING, cmsg, cmsgDetail);
-
- }
- else if (message.startsWith(ClientConnection.SERVER_OLDER))
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING, getHostName());
- String cmsgDetail = ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING_DETAILS;
-
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_SERVER_OLDER_WARNING, IStatus.WARNING, cmsg, cmsgDetail);
- }
-
- if (store.getBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)){
- DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, false);
- Display.getDefault().syncExec(msgAction);
- }
- }
-
- // register the classloader for this plugin with the datastore
- dataStore.registerLocalClassLoader(getClass().getClassLoader());
-
- int serverVersion = getServerVersion();
- if (serverVersion >= 8 || (serverVersion == 7 && getServerMinor() >= 1))
- {
- // register the preference for remote class caching with the datastore
- boolean cacheRemoteClasses = store.getBoolean(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES);
-
- // this preference is set on the server side
- dataStore.setPreference(RemoteClassLoader.CACHING_PREFERENCE, cacheRemoteClasses ? "true" : "false", true); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (serverVersion >= 8){ // keepalive preferences
- boolean doKeepalive = store.getBoolean(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE);
-
- int keepaliveResponseTimeout = store.getInt(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
- if (keepaliveResponseTimeout == 0){ // use the default
- keepaliveResponseTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
- }
-
- int socketTimeout = store.getInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT);
- if (socketTimeout == 0){ // use the default
- socketTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT);
- }
-
- // these preferences are only for the client
- dataStore.setPreference(XMLparser.KEEPALIVE_ENABLED_PREFERENCE, doKeepalive ? "true" : "false", false); //$NON-NLS-1$//$NON-NLS-2$
- dataStore.setPreference(XMLparser.KEEPALIVE_RESPONSE_TIMEOUT_PREFERENCE, ""+ keepaliveResponseTimeout, false); //$NON-NLS-1$
- dataStore.setPreference(XMLparser.IO_SOCKET_READ_TIMEOUT_PREFERENCE, ""+socketTimeout, false); //$NON-NLS-1$
- }
- }
- else
- {
- dataStore.addMinersLocation("."); //$NON-NLS-1$
- // older servers initialized in one shot
- dataStore.getSchema();
-
- // Initialzie the miners
- if (monitor != null)
- {
- String imsg = ConnectorServiceResources.MSG_INITIALIZING_SERVER;
- monitor.subTask(imsg);
- }
- DataElement initStatus = dataStore.initMiners();
- statusMonitor.waitForUpdate(initStatus);
- }
- //long t2 = System.currentTimeMillis();
- //System.out.println("connect time = "+(t2 - t1));
- }
- else
- {
- // if daemon launch failed because of an SSL problem
- if (launchFailed && launchStatus != null && launchStatus.isSLLProblem())
- {
- if (launchStatus.isSLLProblem())
- {
- launchStatus.getException();
-
- List certs = launchStatus.getUntrustedCertificates();
- if (certs.size() > 0)
- {
- ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
- if (provider != null)
- {
- if (provider.importCertificates(certs, getHostName()))
- {
- _isConnecting = false;
- internalConnect(monitor);
- return;
- }
- }
- }
- else
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_SSL_EXCEPTION, launchStatus.getMessage());
- String cmsgDetails = ConnectorServiceResources.MSG_CONNECT_SSL_EXCEPTION_DETAILS;
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_CONNECT_SSL_EXCEPTION, IStatus.ERROR, cmsg, cmsgDetails);
- }
- }
- }
-
- // if daemon launch failed (SSL or otherwise)
- if (launchFailed && launchStatus != null)
- {
- String launchMsg = launchStatus.getMessage();
- if (launchStatus.getException() != null && serverLauncher != null)
- {
- Throwable exception = launchStatus.getException();
- String fmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED_EXCEPTION, getHostName(), ""+serverLauncher.getDaemonPort()); //$NON-NLS-1$
-
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_CONNECT_DAEMON_FAILED_EXCEPTION, IStatus.ERROR, fmsg, exception);
- }
- else if (launchMsg != null && launchMsg.indexOf(IDataStoreConstants.AUTHENTICATION_FAILED) != -1)
- {
- _isConnecting = false;
- if (launchFailed)
- {
- clearPassword(true, true);
- }
-
- // Display error message
- String msgTxt = CommonMessages.MSG_COMM_AUTH_FAILED;
- String msgDetails = NLS.bind(CommonMessages.MSG_COMM_AUTH_FAILED_DETAILS, getHostName());
-
- msg = createSystemMessage(ICommonMessageIds.MSG_COMM_AUTH_FAILED, IStatus.ERROR, msgTxt, msgDetails);
-
- DisplaySystemMessageAction msgAction = new DisplaySystemMessageAction(msg);
- Display.getDefault().syncExec(msgAction);
-
- // Re-prompt for password
- connectException = null;
- Display.getDefault().syncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- acquireCredentials(true);
- }
- catch (OperationCanceledException e)
- {
- connectException = e;
- }
- }
- });
-
- // Check if the user cancelled the prompt
- if (connectException instanceof OperationCanceledException)
- {
- throw connectException;
- }
-
-
- // Try to connect again. This is a recursive call, but will only
- // call if the user presses OK on the password prompt dialog, otherwise
- // it will continue and return
- internalConnect(monitor);
-
- // Since we got here we must be connected so skip error checking below
- return;
- }
- // If password has expired and must be changed
- else if (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg)))
- {
- _isConnecting = false;
- SystemSignonInformation oldCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials();
- SystemSignonInformation newCredentials = null;
- while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg)))
- {
- String msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID;
- String msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS;
- String msgId = IConnectorServiceMessageIds.MSG_VALIDATE_PASSWORD_INVALID;
- if (isPasswordExpired(launchMsg)){
- msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED;
- msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS;
- msgId = IConnectorServiceMessageIds.MSG_VALIDATE_PASSWORD_EXPIRED;
- }
-
- SystemMessage message = createSystemMessage(msgId, IStatus.ERROR, msgTxt, msgDetails);
-
- getCredentialsProvider().repairCredentials(message);
- newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials();
- launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword());
- launchMsg = launchStatus.getMessage();
- }
- if (launchMsg != null && launchMsg.equals(IDataStoreConstants.ATTEMPT_RECONNECT))
- {
- internalConnect(monitor);
- return;
- }
-// NewPasswordInfo newPasswordInfo = null;
-// while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg)))
-// {
-// newPasswordInfo = promptForNewPassword(isPasswordExpired(launchMsg) ? RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PASSWORD_EXPIRED) : RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PASSWORD_INVALID));
-// launchStatus = changePassword(clientConnection, getPasswordInformation(), serverLauncher, monitor, newPasswordInfo.newPassword);
-// launchMsg = launchStatus.getMessage();
-// }
-// if (newPasswordInfo != null)
-// {
-// setPassword(getPasswordInformation().getUserid(), newPasswordInfo.newPassword, newPasswordInfo.savePassword);
-// }
-// if (launchMsg != null && launchMsg.equals(IDataStoreConstants.ATTEMPT_RECONNECT))
-// {
-// internalConnect(monitor);
-// return;
-// }
- }
- else if (launchMsg != null)
- {
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED, getHostName(), clientConnection.getPort());
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_CONNECT_DAEMON_FAILED, IStatus.ERROR, msgTxt, launchMsg);
- }
- }
-
- // if connection failed for known reason
- else if (connectStatus != null && !connectStatus.isConnected())
- {
- if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_SERVER_UPDATE))
- {
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE, getHostName());
- String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS;
-
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_INCOMPATIBLE_UPDATE, IStatus.ERROR, msgTxt, msgDetails);
- }
- else if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_PROTOCOL))
- {
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL, getHostName());
- String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS;
-
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_INCOMPATIBLE_PROTOCOL, IStatus.ERROR, msgTxt, msgDetails);
- }
- else
- {
- Throwable exception = connectStatus.getException();
- if (exception != null)
- {
- String msgTxt = NLS.bind(CommonMessages.MSG_CONNECT_FAILED, getHostName());
- msg = createSystemMessage(ICommonMessageIds.MSG_CONNECT_FAILED, IStatus.ERROR, msgTxt, exception);
- }
- }
- }
-
- // if connect failed for unknown reason
- else if (connectStatus == null)
- {
- SystemBasePlugin.logError("Failed to connect to remote system", null); //$NON-NLS-1$
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName());
- String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName());
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_CONNECT_FAILED, IStatus.ERROR, msgTxt, msgDetails);
- }
-
- // if, for some reason, we don't have a message
- if (msg == null && connectStatus != null)
- {
- SystemBasePlugin.logError("Failed to connect to remote system" + connectStatus.getMessage(), null); //$NON-NLS-1$
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName());
- String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName());
- msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_CONNECT_FAILED, IStatus.ERROR, msgTxt, msgDetails);
- }
-
- clientConnection.disconnect();
- clientConnection = null;
-
- // yantzi: artemis 6.0, check for invalid login (user ID / pwd) and reprompt for signon information
- if (msg != null &&
- // tODO use ID or something instead of string
- msg.getLevelOneText().startsWith(NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, getHostName())))
- {
- if (launchFailed)
- {
- clearPassword(true, true);
- }
-
- DisplaySystemMessageAction msgAction = new DisplaySystemMessageAction(msg);
- Display.getDefault().syncExec(msgAction);
-
- // Re-prompt for password
- connectException = null;
- Display.getDefault().syncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- acquireCredentials(true);
- }
- catch (OperationCanceledException e)
- {
- connectException = e;
- }
- }
- });
-
- _isConnecting = false;
-
- // Check if the user cancelled the prompt
- if (connectException instanceof OperationCanceledException)
- {
- throw connectException;
- }
-
-
- // Try to connect again. This is a recursive call, but will only
- // call if the user presses OK on the password prompt dialog, otherwise
- // it will continue and return
- internalConnect(monitor);
-
- // we are connected from recursive so continue
- return;
- }
-
- _isConnecting = false;
- throw new SystemMessageException(msg);
- }
- _isConnecting = false;
- }
-
- protected boolean isPortOutOfRange(String message)
- {
- return message.indexOf(IDataStoreConstants.PORT_OUT_RANGE) != -1;
- }
-
- protected boolean isPasswordExpired(String message)
- {
- return message.indexOf(IDataStoreConstants.PASSWORD_EXPIRED) != -1;
- }
-
- protected boolean isNewPasswordInvalid(String message)
- {
- return message.indexOf(IDataStoreConstants.NEW_PASSWORD_INVALID) != -1;
- }
-
- protected void importCertsAndReconnect(ConnectionStatus connectStatus, IProgressMonitor monitor) throws Exception
- {
- List certs = connectStatus.getUntrustedCertificates();
- if (certs != null && certs.size() > 0)
- {
- ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
- if (provider != null)
- {
- if (provider.importCertificates(certs, getHostName()))
- {
- internalConnect(monitor);
- return;
- }
- else
- {
- throw new InterruptedException();
- }
- }
- }
- }
-
- protected int launchUsingRexec(SystemSignonInformation info, IServerLauncherProperties serverLauncherProperties, IProgressMonitor monitor) throws Exception
- {
- IServerLauncher starter = getRemoteServerLauncher();
- starter.setSignonInformation(info);
- starter.setServerLauncherProperties(serverLauncherProperties);
-
- String serverPort = (String)starter.launch(monitor);
- if (monitor.isCanceled())
- {
- SystemMessage msg = createSystemMessage(ICommonMessageIds.MSG_OPERATION_CANCELLED, IStatus.CANCEL, CommonMessages.MSG_OPERATION_CANCELLED);
- throw new SystemMessageException(msg);
- }
-
- int iServerPort = 0;
- if (serverPort != null)
- {
- iServerPort = Integer.parseInt(serverPort);
- }
- return iServerPort;
- }
-
- protected boolean setSSLProperties(boolean enable)
- {
- ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
- if (provider != null)
- {
- String keyStore = provider.getKeyStorePath();
- String password = provider.getKeyStorePassword();
-
- ISSLProperties properties = new ClientSSLProperties(enable, keyStore, password);
- clientConnection.setSSLProperties(properties);
- return true;
- }
- else return false;
- }
-
-
-
- protected boolean promptForTrusting( X509Certificate cert)
- {
- return true;
- }
-
-
- /*
- * Launch a DataStore server using a daemon. This method can be overridden if a custom implementation is required.
- * The default implementation uses the daemon client that is built into ClientConnection.
- */
- protected ConnectionStatus launchServer(ClientConnection clientConnection, SystemSignonInformation info, int daemonPort, IProgressMonitor monitor)
- {
- return launchServer(clientConnection, info, daemonPort, monitor, 0);
- }
-
-
- /*
- * Launch a DataStore server using a daemon. This method can be overridden if a custom implementation is required.
- * The default implementation uses the daemon client that is built into ClientConnection.
- */
- protected ConnectionStatus launchServer(ClientConnection clientConnection, SystemSignonInformation info, int daemonPort, IProgressMonitor monitor, int timeout)
- {
- return clientConnection.launchServer(info.getUserId(), info.getPassword(), daemonPort, timeout);
- }
-
- /*
- * Launch a DataStore server using a specified server launcher. By default, this method does nothing since UniversalSystem does
- * not know how to handle this particular launch type. This method should be overridden to provide a custom implementation
- * of the launch.
- */
- protected ConnectionStatus launchServer(ClientConnection clientConnection, SystemSignonInformation info, IServerLauncherProperties launcher, IProgressMonitor monitor)
- {
- return null;
- }
-
- /**
- * Change the password on a remote system and optionally remain connected to it. Subclasses must implement this
- * method if they wish to
- * @param clientConnection The connection on which the password must be changed
- * @param info The old SystemSignonInformation, including the old password.
- * @param serverLauncherProperties The properties of the server launcher used to connect to the server. Use this object to get the type of serverlauncher, if your implementation varies depending on the type.
- * @param monitor a progress monitor
- * @param newPassword the new password to which the old one will be changed.
- * @return the status of the password change and optionally the connection. If the new password is rejected by the remote
- * system, return new ConnectionStatus(false, IDataStoreConstants.NEW_PASSWORD_INVALID).
- * If the system is now connected, and the server is ready to be connected, construct a new ConnectionStatus(true) and if using the RSE daemon, set the ticket on it
- * to the ticket number of the server. If you wish to just have the UniversalSystem attempt a reconnect from the beginning after changing the password,
- * return new ConnectionStatus(true, IDataStoreConstants.ATTEMPT_RECONNECT).
- */
- protected ConnectionStatus changePassword(ClientConnection clientConnection, SystemSignonInformation info, IServerLauncherProperties serverLauncherProperties, IProgressMonitor monitor, String newPassword)
- {
- return new ConnectionStatus(false, IDataStoreConstants.AUTHENTICATION_FAILED);
- }
-
- /**
- * @see org.eclipse.rse.core.subsystems.IConnectorService#isConnected()
- */
- public boolean isConnected()
- {
- if (clientConnection != null)
- {
- return clientConnection.isConnected();
- }
-
- return false;
- }
-
- /**
- * Shortcut to checking if the network is down
- */
- public boolean isNetworkError()
- {
- if (_connectionStatusListener != null)
- {
- return _connectionStatusListener.isConnectionDown();
- }
-
- return false;
- }
-
-
- /**
- * @return The DataStore currently being used by this connection.
- */
- public DataStore getDataStore()
- {
- if (clientConnection != null)
- {
- return clientConnection.getDataStore();
- }
- else
- {
- return null;
- }
- }
-
- public boolean supportsRemoteServerLaunching()
- {
- return true;
- }
-
- public boolean supportsServerLaunchProperties()
- {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.subsystems.AbstractConnectorService#supportsPassword()
- */
- public boolean supportsPassword() {
- boolean result = super.supportsPassword();
- IHost host = getHost();
- if (host.getSystemType().isWindows()) {
- result = false;
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.core.subsystems.AbstractConnectorService#supportsUserid()
- */
- public boolean supportsUserId() {
- boolean result = super.supportsUserId();
- if (getHost().getSystemType().isWindows()) {
- result = false;
- }
- return result;
- }
-
-
- /**
- * @since org.eclipse.rse.connectorservice.dstore 3.0
- */
- protected SystemMessage createSystemMessage(String msgId, int severity, String msg) {
- return createSystemMessage(msgId, severity, msg, (String)null);
- }
-
- /**
- * @since org.eclipse.rse.connectorservice.dstore 3.0
- */
- protected SystemMessage createSystemMessage(String msgId, int severity, String msg, Throwable e) {
- return new SimpleSystemMessage(Activator.PLUGIN_ID, msgId, severity, msg, e);
- }
-
- /**
- * @since org.eclipse.rse.connectorservice.dstore 3.0
- */
- protected SystemMessage createSystemMessage(String msgId, int severity, String msg, String msgDetails) {
- return new SimpleSystemMessage(Activator.PLUGIN_ID, msgId, severity, msg, msgDetails);
- }
-
-}
-
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
deleted file mode 100644
index 32d5831bb..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorServiceManager.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others. 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:
- * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
- ********************************************************************************/
-
-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.internal.connectorservice.dstore.ConnectorServiceResources;
-
-
-
-/**
- * IConnectorService manager class.
- * There should be only one of these instantiated.
- * Use {@link #getInstance()} to get that singleton.
- * <p>
- * The job of this manager is to manage and return IConnectorService objects.
- * It ensures there is only ever one per unique SystemConnection,
- * so that both the file and command subsystems can share the same system object.
- */
-public class DStoreConnectorServiceManager extends AbstractConnectorServiceManager
-{
- private static DStoreConnectorServiceManager inst = null;
-
- /**
- * Private constructor to ensure not instantiated this way.
- * Use {@link #getInstance()} instead.
- */
- private DStoreConnectorServiceManager()
- {
- }
-
- /**
- * Return singleton instance of this class
- */
- public static DStoreConnectorServiceManager getInstance()
- {
- if (inst == null)
- inst = new DStoreConnectorServiceManager();
- return inst;
- }
-
- /**
- * Return true if the singleton has been created.
- * This saves creating it at shutdown just to test for isConnected.
- */
- public static boolean isInstantiated()
- {
- return (inst != null);
- }
-
- // -------------------------------------
- // ABSTRACT METHODS FROM PARENT CLASS...
- // -------------------------------------
-
- /**
- * Return the actual IConnectorService object. We return an instance of UniversalSystem.
- */
- public IConnectorService createConnectorService(IHost host)
- {
- IConnectorService service = new DStoreConnectorService(ConnectorServiceResources.DStore_ConnectorService_Label, ConnectorServiceResources.DStore_ConnectorService_Description, host);
- return service;
- }
-
- /**
- * For all subsystems in a particular SystemConnection, we need to know which
- * ones are to share a single IConnectorService object. To do this, we need a key which
- * is canonical for all subsystems in a given connection. This can be anything,
- * but is typically a unique interface that all subsystems supported a shared
- * IConnectorService object implement.
- * <p>
- * Whatever is returned from here is used as the key into a hashtable to find the
- * singleton IConnectorService object in getSystemObject.
- * <p>
- * @return IUniversalSubSystem.class
- */
- public Class getSubSystemCommonInterface(ISubSystem subsystem)
- {
- return IUniversalDStoreSubSystem.class;
- }
- /**
- * Given another subsystem, return true if that subsystem shares a single IConnectorService object
- * with this one. You must override this to return true if you recognize that subsystem
- * as one of your own. You are guaranteed the other subsystem will be from the same
- * SystemConnection as this one.
- * <p>
- * You can't assume a SystemConnection will you only have subsystems of that you created,
- * so you should only return true if it implements your interface or you know it is an
- * instance of your subsystem class.
- * <p>
- * This should simply return (otherSubSystem instanceof interface) where interface is
- * the same one returned from getSubSystemCommonInterface
- *
- * @return true if otherSubSystem instanceof IUniversalSubSystem
- */
- public boolean sharesSystem(ISubSystem otherSubSystem)
- {
- return (otherSubSystem instanceof IUniversalDStoreSubSystem);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreConstants.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreConstants.java
deleted file mode 100644
index dc4ac6672..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreConstants.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * 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.
- * David McKnight (IBM) - [216596] dstore preferences (timeout, and others)
- * David McKnight (IBM) - [218685] [api][breaking][dstore] Unable to connect when using SSL.
- * David McKnight (IBM) - [220123][dstore] Configurable timeout on irresponsiveness
- * David McKnight (IBM) - [221747] Default Connection Timeout is too high
- * David McKnight (IBM) - [228334] [dstore] Default DataStore connection timeout is too short
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- *******************************************************************************/
-
-package org.eclipse.rse.connectorservice.dstore;
-/**
- * Constants used throughout the UniversalSystem plugin
- */
-public interface IUniversalDStoreConstants
-{
-
-
- public static final String PLUGIN_ID ="org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$
-
- public static final String PREFIX = PLUGIN_ID + "."; //$NON-NLS-1$
-
- // prefix for context sensitive help
- public static final String HELP_PREFIX = PREFIX;
-
- // Resource Bundle ids
- public static final String RESID_PREFIX = PREFIX + "ui."; //$NON-NLS-1$
-
- // Icons
- public static final String ICON_DIR = "icons"; //$NON-NLS-1$
- public static final String ICON_PATH = java.io.File.separator + ICON_DIR + java.io.File.separator;
- public static final String ICON_SUFFIX = "Icon"; //$NON-NLS-1$
- public static final String ICON_EXT = ".gif"; //$NON-NLS-1$
-
- // -------------------------
- // Action prefixes.
- // SYstemBaseAction class adds "label" to get text and "tooltip" and "description" to get hover help
- // -------------------------
- // action ids
- public static final String ACTION_PREFIX = RESID_PREFIX + "action."; //$NON-NLS-1$
- public static final String RESID_RUN_REMOTECMD_PREFIX = ACTION_PREFIX+"RunRemoteCommand"; //$NON-NLS-1$
-
-
- // -------------------------
- // Preferences...
- // -------------------------
- public static final String RESID_PREF_PREFIX = RESID_PREFIX+"preferences."; //$NON-NLS-1$
- public static final String RESID_PREF_ROOT_TITLE = RESID_PREF_PREFIX+"root.title"; //$NON-NLS-1$
-
- // RemoteClassLoader caching preferences
- public static final String RESID_PREF_CACHE_REMOTE_CLASSES = RESID_PREF_PREFIX + "cacheremoteclasses"; //$NON-NLS-1$
-
- // Socket timeout preference
- public static final String RESID_PREF_SOCKET_TIMEOUT = RESID_PREF_PREFIX + "sockettimeout"; //$NON-NLS-1$
-
- public static final String RESID_PREF_DO_KEEPALIVE = RESID_PREF_PREFIX + "dokeepalive"; //$NON-NLS-1$
-
- /**
- * @since 3.0
- */
- public static final String RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT = RESID_PREF_PREFIX + "keepalivetimeout"; //$NON-NLS-1$
-
- /**
- * @since 3.0
- */
- public static final String RESID_PREF_SOCKET_READ_TIMEOUT = RESID_PREF_PREFIX + "socketreadtimeout"; //$NON-NLS-1$
-
-
-
- /**
- * @since 3.0
- */
- public static final String ALERT_MISMATCHED_SERVER = RESID_PREFIX + "alert.mismatched.server"; //$NON-NLS-1$
-
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreMessages.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreMessages.java
deleted file mode 100644
index 8bf2b731d..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreMessages.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 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.connectorservice.dstore;
-
-/**
- * Message IDs
- */
-public interface IUniversalDStoreMessages
-{
-
-
- public static final String PLUGIN_ID ="org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$
- public static final String PREFIX = PLUGIN_ID+"."; //$NON-NLS-1$
- // Resource Bundle ids
- public static final String RESID_PREFIX = PREFIX+"ui."; //$NON-NLS-1$
- // Messages prefixes
- public static final String MSG_PREFIX = RESID_PREFIX+"msg."; //$NON-NLS-1$
- public static final String MSG_TITLE = MSG_PREFIX + "Title"; //$NON-NLS-1$
-
- // Messages
- public static final String MSG_CONNECTION_PREFIX = MSG_PREFIX + "Connection."; //$NON-NLS-1$
- public static final String MSG_CONNECTION_FAILED = MSG_CONNECTION_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECTION_UNKNOWN_HOST = MSG_CONNECTION_PREFIX + "UnknownHost"; //$NON-NLS-1$
- public static final String MSG_CONNECTION_VERIFY = MSG_CONNECTION_PREFIX + "Verify"; //$NON-NLS-1$
- public static final String MSG_CONNECTION_COMMPROPERTIES = MSG_CONNECTION_PREFIX + "CommProperties"; //$NON-NLS-1$
-
- // RSE Server Connection Messages
- public static final String MSG_SIGNON_PREFIX = MSG_PREFIX + "Signon."; //$NON-NLS-1$
- public static final String MSG_SIGNON_PASSWORD_ERROR = MSG_SIGNON_PREFIX + "PasswordError"; //$NON-NLS-1$
- public static final String MSG_SIGNON_PASSWORD_INCORRECT = MSG_SIGNON_PREFIX + "PasswordIncorrect"; //$NON-NLS-1$
- public static final String MSG_SIGNON_PASSWORD_INCORRECT_USER_DISABLED= MSG_SIGNON_PREFIX + "PasswordIncorrectUserDisabled"; //$NON-NLS-1$
- public static final String MSG_SIGNON_PASSWORD_EXPIRED = MSG_SIGNON_PREFIX + "PasswordExpired"; //$NON-NLS-1$
- public static final String MSG_SIGNON_USERID_INVALID = MSG_SIGNON_PREFIX + "UserIDInvalid"; //$NON-NLS-1$
- public static final String MSG_SIGNON_USERID_DISABLED = MSG_SIGNON_PREFIX + "UserIDDisabled"; //$NON-NLS-1$
- public static final String MSG_SIGNON_USERID_ERROR = MSG_SIGNON_PREFIX + "UserIDError"; //$NON-NLS-1$
-
- public static final String MSG_DATASTORE_PREFIX = MSG_PREFIX + "DataStore."; //$NON-NLS-1$
- public static final String MSG_DATASTORE_STARTSERVER = MSG_DATASTORE_PREFIX + "StartServer"; //$NON-NLS-1$
- public static final String MSG_DATASTORE_CONNECTSERVER = MSG_DATASTORE_PREFIX + "ConnectServer"; //$NON-NLS-1$
- public static final String MSG_DATASTORE_INITIALIZESERVER = MSG_DATASTORE_PREFIX + "InitializeServer"; //$NON-NLS-1$
- public static final String MSG_DATASTORE_INITIALIZECODESERVER = MSG_DATASTORE_PREFIX + "InitializeCODEServer"; //$NON-NLS-1$
-
- public static final String MSG_CMD_PREFIX = MSG_PREFIX + "Command."; //$NON-NLS-1$
- public static final String MSG_CMDNAME_EMPTY = MSG_CMD_PREFIX + "Required"; //$NON-NLS-1$
- public static final String MSG_CMDNAME_NOTVALID = MSG_CMD_PREFIX + "NotValid"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreSubSystem.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreSubSystem.java
deleted file mode 100644
index f291564a1..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalDStoreSubSystem.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * 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.connectorservice.dstore;
-/**
- * Simply a tag to indicate this factory is one our universal subsystems.
- */
-public interface IUniversalDStoreSubSystem
-{
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalSubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalSubSystemConfiguration.java
deleted file mode 100644
index 95e52a035..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/IUniversalSubSystemConfiguration.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * 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.connectorservice.dstore;
-/**
- * Simply a tag to indicate this factory is one our universal subsystem factories.
- */
-public interface IUniversalSubSystemConfiguration
-{
-
-
-
-} \ No newline at end of file
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
deleted file mode 100644
index bbc8a5e5f..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ConnectionStatusListener.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * 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:
- * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
- * David McKnight (IBM) - [216252] SystemMessages using RSEStatus
- * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
- * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
- *******************************************************************************/
-
-package org.eclipse.rse.connectorservice.dstore.util;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.extra.DomainEvent;
-import org.eclipse.dstore.extra.IDomainListener;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.rse.core.RSECorePlugin;
-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.internal.connectorservice.dstore.Activator;
-import org.eclipse.rse.services.clientserver.messages.CommonMessages;
-import org.eclipse.rse.services.clientserver.messages.ICommonMessageIds;
-import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBasePlugin;
-import org.eclipse.rse.ui.messages.SystemMessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-public class ConnectionStatusListener implements IDomainListener, IRunnableWithProgress
-{
-
-
- protected DataElement _dataStoreStatus;
- protected IConnectorService _connection;
- protected boolean _connectionDown = false;
-
- /**
- * @param status The status element for the DataStore handling this connection.
- */
- public ConnectionStatusListener(DataElement status, IConnectorService connection)
- {
- _dataStoreStatus = status;
- _connection = connection;
- }
-
- protected Shell internalGetShell()
- {
- Shell activeShell = SystemBasePlugin.getActiveWorkbenchShell();
- if (activeShell != null)
- {
- return activeShell;
- }
-
- IWorkbenchWindow window = null;
- try
- {
- window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- }
- catch (Exception e)
- {
- return null;
- }
- if (window == null)
- {
-
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- if (windows != null && windows.length > 0)
- {
- return windows[0].getShell();
- }
-
- }
- else
- {
- return window.getShell();
- }
-
- return null;
- }
-
- /**
- * The handleConnectionDown method is invoked if the network connection between the
- * client and server goes down while connected. Currently this method displays
- * an error to the user and the subsytem is disconnected.
- */
- protected void handleConnectionDown()
- {
- Display.getDefault().asyncExec(new ConnectionDown(this));
- }
-
- class ConnectionDown implements Runnable
- {
- private ConnectionStatusListener _listener;
- public ConnectionDown(ConnectionStatusListener listener)
- {
- _listener = listener;
- }
-
- public void run()
- {
- Shell shell = getShell();
- _connectionDown = true;
-
- String fmsgStr = NLS.bind(CommonMessages.MSG_CONNECT_UNKNOWNHOST, _connection.getPrimarySubSystem().getHost().getAliasName());
-
- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_CONNECT_UNKNOWNHOST, IStatus.ERROR, fmsgStr);
- SystemMessageDialog dialog = new SystemMessageDialog(internalGetShell(), msg);
- dialog.open();
-
- try
- {
- IRunnableContext runnableContext = getRunnableContext(getShell());
- runnableContext.run(false,true,_listener); // inthread, cancellable, IRunnableWithProgress
- _connection.reset();
- ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
- sr.connectedStatusChange(_connection.getPrimarySubSystem(), false, true, true);
- }
- catch (InterruptedException exc) // user cancelled
- {
- if (shell != null)
- showDisconnectCancelledMessage(shell, _connection.getHostName(), _connection.getPort());
- }
- catch (java.lang.reflect.InvocationTargetException invokeExc) // unexpected error
- {
- Exception exc = (Exception)invokeExc.getTargetException();
- if (shell != null)
- showDisconnectErrorMessage(shell, _connection.getHostName(), _connection.getPort(), exc);
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError("ConnectionStatusListener: Error disconnecting", e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * @see IDomainListener#listeningTo(DomainEvent)
- */
- public boolean listeningTo(DomainEvent event)
- {
- if (_dataStoreStatus == event.getParent())
- {
- return true;
- }
- return false;
- }
-
- /**
- * @see IDomainListener#domainChanged(DomainEvent)
- */
- public void domainChanged(DomainEvent event)
- {
- if (!_dataStoreStatus.getName().equals("okay")) //$NON-NLS-1$
- {
- handleConnectionDown();
- }
- }
-
- public Shell getShell()
- {
- return internalGetShell();
- }
-
- /**
- * Callback method for the IConnectorService to determine if the connection is down. This is
- * called by the disconnect method to determine if we can do saves or not.
- */
- public boolean isConnectionDown()
- {
- return _connectionDown;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- {
- String message = null;
- message = SubSystemConfiguration.getDisconnectingMessage(_connection.getHostName(), _connection.getPort());
- monitor.beginTask(message, IProgressMonitor.UNKNOWN);
- try
- {
- _connection.disconnect(monitor);
- }
- catch(Exception exc)
- {
- if (exc instanceof java.lang.reflect.InvocationTargetException)
- throw (java.lang.reflect.InvocationTargetException)exc;
- if (exc instanceof java.lang.InterruptedException)
- throw (java.lang.InterruptedException)exc;
- throw new java.lang.reflect.InvocationTargetException(exc);
- }
- finally
- {
- monitor.done();
- }
- }
- /**
- * Get the progress monitor dialog for this operation. We try to
- * use one for all phases of a single operation, such as connecting
- * and resolving.
- */
- protected IRunnableContext getRunnableContext(Shell rshell)
- {
- Shell shell = getShell();
- // for other cases, use statusbar
- IWorkbenchWindow win = SystemBasePlugin.getActiveWorkbenchWindow();
- if (win != null)
- {
- Shell winShell = RSEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- if (winShell != null && !winShell.isDisposed() && winShell.isVisible())
- {
- SystemBasePlugin.logInfo("Using active workbench window as runnable context"); //$NON-NLS-1$
- shell = winShell;
- return win;
- }
- else
- {
- win = null;
- }
- }
-
- if (shell == null || shell.isDisposed() || !shell.isVisible())
- {
- SystemBasePlugin.logInfo("Using progress monitor dialog with given shell as parent"); //$NON-NLS-1$
- shell = rshell;
- }
-
-
- IRunnableContext dlg = new ProgressMonitorDialog(rshell);
- return dlg;
- }
-
- /**
- * Show an error message when the disconnection fails.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc)
- {
- String dfailedMsg = NLS.bind(CommonMessages.MSG_DISCONNECT_FAILED, hostName);
-
-
- try{
- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_FAILED, IStatus.ERROR, dfailedMsg, exc);
-
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg);
- msgDlg.setException(exc);
- msgDlg.open();
- }
- catch (Exception e){
- }
- }
- /**
- * Show an error message when the user cancels the disconnection.
- * Shows a common message by default.
- * Overridable.
- */
- protected void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
- {
- String msg = NLS.bind(CommonMessages.MSG_DISCONNECT_CANCELLED, hostName);
- SystemMessageDialog msgDlg = new SystemMessageDialog(shell, new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_DISCONNECT_CANCELLED, IStatus.CANCEL, msg));
- msgDlg.open();
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnostic.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnostic.java
deleted file mode 100644
index 8c1854bf6..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnostic.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/********************************************************************************
- * 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.connectorservice.dstore.util;
-
-import org.eclipse.rse.core.subsystems.IConnectorService;
-
-/**
- * An interface for ICommunicationsDiagnostic class
- */
-public interface ICommunicationsDiagnostic extends Runnable {
-
-
-
- public static final int CANCEL_WAIT_REQUESTED = 1;
-
-
- /**
- * Setup for the diagnostic
- *
- * @param id assign an ID for this diagnostic instance
- * @param quiet true if user to be prompted for a dialog
- * @param server the host network name
- * @param system the connection to be investigated
- * @param str1 optional string
- * @param str2 optional string
- * @param str3 optional string
- */
- public void setUp(String id, boolean quiet, String server, IConnectorService system, String str1, String str2, String str3);
-
- /**
- * Log an error in the .log file
- *
- * @param text message text to be logged
- */
- public void logError(String text);
-
- /**
- * Check if network is down
- *
- * @return true or false
- */
- public boolean isNetworkDown();
-
- /**
- * Check if host server is still active
- *
- * @return true or false
- */
- public boolean isServerActive();
-
- /**
- * Dispaly a message dialog
- *
- * @param id message to be displayed.
- */
- public void displayMessage(String id);
-
- /**
- * diagnosticStatus
- *
- * @return status
- */
- public int diagnosticStatus();
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnosticFactory.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnosticFactory.java
deleted file mode 100644
index 3bc4c334c..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/ICommunicationsDiagnosticFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * 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.connectorservice.dstore.util;
-
-/**
- * Factory for creating ICommunicationsDiagnostic instances.
- */
-public interface ICommunicationsDiagnosticFactory
-{
-
- /**
- * Factory method for creating instances
- */
- public ICommunicationsDiagnostic createInstance();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java
deleted file mode 100644
index 101a1bc24..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * 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:
- * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
- * David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server
- * David McKnight (IBM) - [229947] [dstore] interruption to Thread.sleep() should not stop waitForUpdate()
- * David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge
- *******************************************************************************/
-
-package org.eclipse.rse.connectorservice.dstore.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.DataStoreSchema;
-import org.eclipse.dstore.extra.DomainEvent;
-import org.eclipse.dstore.extra.IDomainListener;
-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.ui.SystemBasePlugin;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-
-/*
- * This utility class can be used to monitor the status of one more more status DataElements.
- * Only one instanceof of this class is required per DataStore for use in monitoring statuses.
- * This is intended to be used in place of StatusChangeListeners
- *
- * * <p>
- * The following is one example of the use of the StatusMonitor. The code:
- * <blockquote><pre>
- * DataElement status = dataStore.command(dsCmd, args, deObj);
- *
- * StatusMonitor smon = StatusMonitorFactory.getInstance().getStatusMonitorFor(getSystem(), ds);
- * smon.waitForUpdate(status, monitor);
- * </pre></blockquote>
- */
-public class StatusMonitor implements IDomainListener, ICommunicationsListener
-{
-
- protected Shell _shell;
- protected IConnectorService _system;
-
-
- protected boolean _networkDown = false;
-
- protected List _workingStatuses;
- protected List _cancelledStatuses;
- protected List _doneStatuses;
-
- protected DataStore _dataStore;
-
- protected class FindShell implements Runnable
- {
- private Shell shell;
-
- /**
- * @see Runnable#run()
- */
- public void run()
- {
- try {
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && shell == null; loop++) {
- if (shells[loop].isEnabled()) {
- shell = shells[loop];
- }
- }
- } catch (Exception e) {
- SystemBasePlugin.logError("StatusChangeListener.FindShell exception: ", e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Construct a StatusChangeListener
- *
- * @param system the system associated with this monitor
- * @param dataStore the dataStore associated with this monitor
- * @param factory the diagnostic factory for this monitor
- */
- public StatusMonitor(IConnectorService system, DataStore dataStore, ICommunicationsDiagnosticFactory factory)
- {
- _system = system;
- _dataStore = dataStore;
- reInit();
- }
-
- /**
- * Construct a StatusChangeListener
- *
- * @param system the system associated with this monitor
- * @param dataStore the dataStore associated with this monitor
- */
- public StatusMonitor(IConnectorService system, DataStore dataStore)
- {
- this(system, dataStore, null);
- }
-
- public void reInit()
- {
- _networkDown = false;
- _system.addCommunicationsListener(this);
- _workingStatuses = new ArrayList();
- _doneStatuses = new ArrayList();
- _cancelledStatuses = new ArrayList();
- _dataStore.getDomainNotifier().addDomainListener(this);
- }
-
- public DataStore getDataStore()
- {
- return _dataStore;
- }
-
- public void dispose()
- {
- _system.removeCommunicationsListener(this);
- _workingStatuses.clear();
- _doneStatuses.clear();
- _cancelledStatuses.clear();
- _dataStore.getDomainNotifier().removeDomainListener(this);
- }
-
- /**
- * @see IDomainListener#listeningTo(DomainEvent)
- */
- public boolean listeningTo(DomainEvent event)
- {
- if (_workingStatuses.size() == 0)
- {
- return true;
- }
-
- DataElement parent = (DataElement)event.getParent();
- if (_workingStatuses.contains(parent))
- {
- return determineStatusDone(parent);
- }
-
- return false;
- }
-
-
-
- /**
- * @see IDomainListener#domainChanged(DomainEvent)
- */
- public void domainChanged(DomainEvent event)
- {
- if (_workingStatuses.size() == 0)
- {
- return;
- }
-
- DataElement parent = (DataElement)event.getParent();
- if (_workingStatuses.contains(parent))
- {
- boolean isStatusDone = determineStatusDone(parent);
- if (isStatusDone)
- {
- setDone(parent);
- }
- }
- }
-
-
- /**
- * Determines whether the status is done.
- * @return <code>true</code> if status done, <code>false</code> otherwise.
- */
- protected boolean determineStatusDone(DataElement status)
- {
- return status.getAttribute(DE.A_VALUE).equals("done") || status.getAttribute(DE.A_NAME).equals("done"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @see org.eclipse.rse.core.subsystems.ICommunicationsListener#isPassiveCommunicationsListener()
- */
- public boolean isPassiveCommunicationsListener()
- {
- return false;
- }
-
- /**
- * setDone(boolean)
- */
- public synchronized void setDone(DataElement status)
- {
- _workingStatuses.remove(status);
- _doneStatuses.add(status);
- }
-
-
- public synchronized void setCancelled(DataElement status)
- {
- _workingStatuses.remove(status);
- _cancelledStatuses.add(status);
- }
-
- public synchronized void setWorking(DataElement status)
- {
- _workingStatuses.add(status);
- }
-
-
- public boolean wasCancelled(DataElement status)
- {
- if (_cancelledStatuses.contains(status))
- {
- return true;
- }
- return false;
- }
-
-
-
- /**
- * @see ICommunicationsListener#communicationsStateChange(CommunicationsEvent)
- */
- public void communicationsStateChange(CommunicationsEvent e)
- {
- if (e.getState() == CommunicationsEvent.CONNECTION_ERROR)
- {
- _networkDown = true;
- }
- else if (e.getState() == CommunicationsEvent.AFTER_DISCONNECT)
- {
- _networkDown = true;
- }
- }
-
- /**
- * Test if the StatusChangeListener returned because the network connection to the
- * remote system was broken.
- */
- public boolean isNetworkDown()
- {
- return _networkDown;
- }
-
- public DataElement waitForUpdate(DataElement status) throws InterruptedException
- {
- return waitForUpdate(status, null, 0);
- }
-
- public DataElement waitForUpdate(DataElement status, IProgressMonitor monitor) throws InterruptedException
- {
- return waitForUpdate(status, monitor, 0);
- }
-
- public DataElement waitForUpdate(DataElement status, int wait) throws InterruptedException
- {
- return waitForUpdate(status, null, wait);
- }
-
- public synchronized DataElement waitForUpdate(DataElement status, IProgressMonitor monitor, int wait) throws InterruptedException
- {
- if (_networkDown && status.getDataStore().isConnected())
- {
- reInit();
- }
- if (determineStatusDone(status))
- {
- setDone(status);
- return status;
- }
-
- setWorking(status);
-
- Display display = Display.getCurrent();
-
- // Prevent infinite looping by introducing a threshold for wait
-
- int WaitThreshold = 50;
- if ( wait > 0 )
- WaitThreshold = wait*10; // 1 second means 10 sleep(100ms)
- else if ( wait == -1 ) // force a diagnostic
- WaitThreshold = -1;
-
- int initialWaitThreshold = WaitThreshold;
- int nudges = 0; // nudges used for waking up server with slow connections
- // nudge up to 12 times before giving up
-
- if (display != null)
- {
- // Current thread is UI thread
- while (_workingStatuses.contains(status))
- {
- // while (display.readAndDispatch()) {
- //Process everything on event queue
- // }
-
- if ((monitor != null) && (monitor.isCanceled()))
- {
- setCancelled(status);
- throw new InterruptedException();
- }
-
- boolean statusDone = determineStatusDone(status);
-
- if (statusDone)
- {
- setDone(status);
- }
- else
- {
- try
- {
- Thread.sleep(100);
- }
- catch (InterruptedException e)
- {
- // Continue waiting in case of spurious interrupt.
- // We check the progress monitor to listen for Eclipse Shutdown.
- continue;
- }
- if (WaitThreshold > 0) // update timer count if
- // threshold not reached
- --WaitThreshold; // decrement the timer count
-
- if (WaitThreshold == 0)
- {
- wakeupServer(status);
-
- // no diagnostic factory but there is a timeout
- if (nudges >= 12)
- return status; // returning the undone status object
-
- nudges++;
- WaitThreshold = initialWaitThreshold;
- }
- else if (_networkDown)
- {
- dispose();
- throw new InterruptedException();
- }
- }
- }
-
- }
- else
- {
- // Current thread is not UI thread
- while (_workingStatuses.contains(status))
- {
-
- if ((monitor != null) && (monitor.isCanceled()))
- {
- setCancelled(status);
- throw new InterruptedException();
- }
-
- boolean statusDone = determineStatusDone(status);
-
- if (statusDone)
- {
- setDone(status);
- }
- else
- {
- try
- {
- Thread.sleep(100);
- }
- catch (InterruptedException e)
- {
- // Continue waiting in case of spurious interrupt.
- // We check the progress monitor to listen for Eclipse Shutdown.
- continue;
- }
-
- if (WaitThreshold > 0) // update timer count if
- // threshold not reached
- --WaitThreshold; // decrement the timer count
-
- if (WaitThreshold == 0)
- {
- wakeupServer(status);
-
- // no diagnostic factory but there is a timeout
- if (nudges >= 12)
- return status; // returning the undone status object
-
- nudges++;
- WaitThreshold = initialWaitThreshold;
- }
- else if (_networkDown)
- {
- dispose();
- throw new InterruptedException();
- }
- }
- }
- }
-
-
- return status;
- }
-
- private void wakeupServer(DataElement status)
- {
- if (status != null)
- {
- // token command to wake up update handler
- DataElement cmdDescriptor = _dataStore.findCommandDescriptor(DataStoreSchema.C_NOTIFICATION);
- DataElement subject = status.getParent().get(0);
- if (cmdDescriptor != null)
- {
- _dataStore.command(cmdDescriptor, subject);
- }
- }
- }
-
- /**
- * Start diagnostic
- *
- * @param factory is the an implementation of ICommunicationsDiagnostic
- * @param quiet is the flag to indicate if user should be prompted
- * - true for no prompt
- * @return ICommunciationsDiagnostic class instance
- */
- public ICommunicationsDiagnostic whatIsGoingOn(ICommunicationsDiagnosticFactory factory, boolean quiet, DataElement target) throws InterruptedException //@01
- {
- if (target == null)
- return null;
-
- ICommunicationsDiagnostic d = null;
- try {
- String name = target.getName(); /* Get the current element status name: started/working/done */
- /* Log the current status */
- SystemBasePlugin.logError("StatusChangeListener."+name+": " + "Communications Diagnostic started"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- SystemBasePlugin.logError("StatusChangeListener."+name + //$NON-NLS-1$
- ": done = " + _doneStatuses.contains(target) + //$NON-NLS-1$
- "; cancelled = " + _cancelledStatuses.contains(target)+ //$NON-NLS-1$
- "; _networkDown = " + _networkDown ); //$NON-NLS-1$
-
- DataStore ds = _dataStore;
- /* Log the status in DataStore */
- SystemBasePlugin.logError("StatusChangeListener."+name+"(DataStore): " + " isConnected = " + ds.isConnected() + "; isWaiting = " + ds.isWaiting(target)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- /*Log all nested DataElement's in target's parent*/
- List deList = target.getParent().getNestedData();
- if ( deList != null && !deList.isEmpty() ) {
- int num = deList.size();
- for ( int i = 0; i < num; i++)
- {
- DataElement child = (DataElement) deList.get(i);
- if (child != null) {
- SystemBasePlugin.logError("StatusChangeListener."+name+".child"+i+"(DataElement): " + child.toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DataElement descriptor = child.getDescriptor();
- if (descriptor != null)
- SystemBasePlugin.logError("StatusChangeListener."+name+".child"+i+"(Descriptor): " + descriptor.toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- }
- //Spawn off a diagnostic to check more stuff
- if (factory != null) {
- d = factory.createInstance();
-
- //Initialize the diagnostic instance
- //Set diagnostic id(name), server name(ds.getName()), this connection(system)
- d.setUp(name, quiet, ds.getName(),_system, null ,null, null);
-
- new Thread(d).start();
- }
-
- }
- catch (Exception e)
- {
- SystemBasePlugin.logError("StatusChangeListener.ICommunicationsDiagnostic exception: ", e); //$NON-NLS-1$
- }
-
- return d; // return the created diagnostic class instance
- }
-
-
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitorFactory.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitorFactory.java
deleted file mode 100644
index a132b6e5d..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitorFactory.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2005, 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.connectorservice.dstore.util;
-
-import java.util.HashMap;
-
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-
-/**
- * Factory for finding and creating the StatusMonitor class for a given system
- */
-public class StatusMonitorFactory
-{
- protected HashMap _monitorMap;
- protected static StatusMonitorFactory _instance;
-
- public static StatusMonitorFactory getInstance()
- {
- if (_instance == null)
- {
- _instance = new StatusMonitorFactory();
- }
- return _instance;
- }
-
- public StatusMonitorFactory()
- {
- _monitorMap= new HashMap();
- }
-
- public void removeStatusMonitorFor(IConnectorService system)
- {
- StatusMonitor monitor = (StatusMonitor)_monitorMap.remove(system);
- if (monitor != null)
- {
- monitor.dispose();
- }
- }
-
- public StatusMonitor getStatusMonitorFor(IConnectorService system, DataStore dataStore)
- {
- return getStatusMonitorFor(system, dataStore, null);
- }
-
- public StatusMonitor getStatusMonitorFor(IConnectorService system, DataStore dataStore, ICommunicationsDiagnosticFactory diagnosticFactory)
- {
- StatusMonitor monitor = (StatusMonitor)_monitorMap.get(system);
- if (monitor == null)
- {
- monitor = new StatusMonitor(system, dataStore, diagnosticFactory);
- _monitorMap.put(system, monitor);
- }
- DataStore mDataStore = monitor.getDataStore();
- if (mDataStore != dataStore)
- {
- removeStatusMonitorFor(system);
- monitor = new StatusMonitor(system, dataStore, diagnosticFactory);
- _monitorMap.put(system, monitor);
- }
-
- return monitor;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java
deleted file mode 100644
index 87d1ab458..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * 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:
- * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
- * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
- * David McKnight (IBM) - [220123] [api][dstore] Configurable timeout on irresponsiveness
- * David McKnight (IBM) - [227406] [dstore] DStoreFileService must listen to buffer size preference changes
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- * David McKnight (IBM) - [233160] [dstore] SSL/non-SSL alert are not appropriate
- *******************************************************************************/
-
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants;
-import org.eclipse.rse.ui.ISystemPreferencesConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemBasePlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class Activator extends SystemBasePlugin {
-
- //The shared instance.
- private static Activator plugin;
-
- public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$
-
- /**
- * The constructor.
- */
- public Activator() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
-
- initializeDefaultPreferences();
- }
-
-
- public void initializeDefaultPreferences() {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
- //Preferences store = RSECorePlugin.getDefault().getPluginPreferences();
-
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT);
-
- // do keepalive
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_DO_KEEPALIVE);
-
- // socket read timeout
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_READ_TIMEOUT);
-
- // keepalive response timeout
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
-
- // show mismatched server warning
- store.setDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, IDStoreDefaultPreferenceConstants.DEFAULT_ALERT_MISMATCHED_SERVER);
-
- // cache remote classes
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_CACHE_REMOTE_CLASSES);
-
- // alert defaults
- store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL);
- store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-
-
- protected void initializeImageRegistry()
- {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java
deleted file mode 100644
index 4823906a1..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * 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:
- * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
- * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
- *******************************************************************************/
-
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ConnectorServiceResources extends NLS
-{
- private static String BUNDLE_NAME = "org.eclipse.rse.internal.connectorservice.dstore.ConnectorServiceResources";//$NON-NLS-1$
-
- public static String DStore_ConnectorService_Label;
- public static String DStore_ConnectorService_Description;
-
-
- public static String MSG_CONNECT_SSL_EXCEPTION;
- public static String MSG_CONNECT_SSL_EXCEPTION_DETAILS;
- public static String MSG_STARTING_SERVER_VIA_REXEC;
- public static String MSG_STARTING_SERVER_VIA_DAEMON;
-
- public static String MSG_CONNECTING_TO_SERVER;
- public static String MSG_INITIALIZING_SERVER;
- public static String MSG_PORT_OUT_RANGE;
-
- public static String MSG_COMM_CONNECT_FAILED;
- public static String MSG_COMM_CONNECT_FAILED_DETAILS;
-
- public static String MSG_VALIDATE_PASSWORD_EXPIRED;
- public static String MSG_VALIDATE_PASSWORD_INVALID;
-
- public static String MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS;
- public static String MSG_VALIDATE_PASSWORD_INVALID_DETAILS;
-
- public static String MSG_COMM_USING_SSL;
- public static String MSG_COMM_NOT_USING_SSL;
-
- public static String MSG_COMM_SERVER_OLDER_WARNING;
- public static String MSG_COMM_CLIENT_OLDER_WARNING;
- public static String MSG_COMM_SERVER_OLDER_WARNING_DETAILS;
- public static String MSG_COMM_CLIENT_OLDER_WARNING_DETAILS;
-
- public static String MSG_CONNECT_DAEMON_FAILED;
- public static String MSG_CONNECT_DAEMON_FAILED_EXCEPTION;
-
- public static String MSG_COMM_INCOMPATIBLE_PROTOCOL;
- public static String MSG_COMM_INCOMPATIBLE_UPDATE;
- public static String MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS;
- public static String MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS;
-
- public static String MSG_COMM_INVALID_LOGIN;
- public static String MSG_COMM_INVALID_LOGIN_DETAILS;
-
-
- public static String MSG_COMM_REXEC_NOTSTARTED;
- public static String MSG_COMM_REXEC_NOTSTARTED_DETAILS;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ConnectorServiceResources.class);
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties
deleted file mode 100644
index 7bb8eb424..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ConnectorServiceResources.properties
+++ /dev/null
@@ -1,76 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 IBM Corporation and others.
-# 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:
-# David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
-# David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
-# David McKnight (IBM) - [223204] [cleanup] fix broken nls strings in files.ui and others
-###############################################################################
-
-# NLS_MESSAGEFORMAT_NONE
-# NLS_ENCODING=UTF-8
-
-DStore_ConnectorService_Label=DStore Connector Service
-DStore_ConnectorService_Description=The DStore Connector Service uses RSE's DataStore protocol to connect to the host. You must have a DataStore daemon or server running on the remote machine.
-
-MSG_COMM_CONNECT_FAILED=Connection to {0} could not be established.
-MSG_COMM_CONNECT_FAILED_DETAILS=A socket connection to {0} could not be established. If you are connecting via the communications daemon make sure the daemon is running on the remote system. If you are connecting directly to the communications server make sure the server is started on the remote system. If you are connecting using REXEC, make sure that the server is installed on the remote system and that the REXEC service is running on that system.
-
-
-MSG_CONNECT_SSL_EXCEPTION = Unable to establish a secure connection with the Remote System Explorer host server.
-MSG_CONNECT_SSL_EXCEPTION_DETAILS = Make sure both the client and server are configured to use SSL. The SSL handshake between client and server failed with the following exception: {0}
-
-MSG_STARTING_SERVER_VIA_REXEC = Remote System Explorer host server using REXEC
-
-MSG_STARTING_SERVER_VIA_DAEMON = Starting Remote System Explorer host server using daemon
-
-MSG_CONNECTING_TO_SERVER= Connecting to Remote System Explorer host server on port {0}
-MSG_INITIALIZING_SERVER= Initializing Remote System Explorer host server
-MSG_PORT_OUT_RANGE = The specified server port is out of the allowed range: {0}
-
-MSG_VALIDATE_PASSWORD_EXPIRED=Password has expired
-MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS=Your password has expired, and must be reset before continuing.
-
-MSG_VALIDATE_PASSWORD_INVALID=The new password is invalid.
-MSG_VALIDATE_PASSWORD_INVALID_DETAILS=The remote system indicated that the new password is unacceptable. Please ensure the new password follows all password rules for the remote system.
-
-MSG_COMM_USING_SSL=Communication with the remote system {0} has been secured using SSL. Continue?
-MSG_COMM_NOT_USING_SSL=Connection {0} has not been secured using SSL. Proceed anyway?
-
-MSG_COMM_SERVER_OLDER_WARNING=The host server running on remote system {0} is an older version than the RSE client.
-MSG_COMM_SERVER_OLDER_WARNING_DETAILS=It is recommended that the client and server versions match.
-MSG_COMM_CLIENT_OLDER_WARNING=The host server running on remote system {0} is a newer version than the RSE client.
-MSG_COMM_CLIENT_OLDER_WARNING_DETAILS=It is recommended that the client and server versions match.
-
-
-MSG_CONNECT_DAEMON_FAILED=Daemon failed to launch server on {0} using port {1}
-MSG_CONNECT_DAEMON_FAILED_EXCEPTION=Failed to connect to the daemon on {0} using port {1} with an unexpected exception
-
-
-MSG_COMM_INCOMPATIBLE_PROTOCOL=Incompatible host server running on remote system {0}.
-MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS=The host server is not a Remote System Explorer server.
-
-MSG_COMM_INCOMPATIBLE_UPDATE=Incompatible Remote System Explorer host server running on remote system {0}.
-MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS=The host server needs to be updated to work with the current client.
-
-
-MSG_COMM_INVALID_LOGIN=Invalid password or user ID for {0}.
-MSG_COMM_INVALID_LOGIN_DETAILS=Message from host: {0}
-
-MSG_COMM_REXEC_NOTSTARTED=Unable to connect to REXEC host service on port {0} of host {1}
-MSG_COMM_REXEC_NOTSTARTED_DETAILS=Message from host: {0}
-
-
-
-
-
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.java
deleted file mode 100644
index f05319ec9..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2008 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.
- *
- * Contributors:
- * David McKnight (IBM) - [216596] dstore preferences (timeout, and others)
- * David McKnight (IBM) - [220123][dstore] Configurable timeout on irresponsiveness
- ********************************************************************************/
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DStoreResources extends NLS {
-
- private static String BUNDLE_NAME = "org.eclipse.rse.internal.connectorservice.dstore.DStoreResources"; //$NON-NLS-1$
-
- public static String RESID_PREFERENCE_CONNECTION_TIMEOUT_LABEL;
- public static String RESID_PREFERENCE_CONNECTION_TIMEOUT_TOOLTIP;
-
- public static String RESID_PREFERENCE_DO_KEEPALIVE_LABEL;
- public static String RESID_PREFERENCE_DO_KEEPALIVE_TOOLTIP;
-
- public static String RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_LABEL;
- public static String RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_TOOLTIP;
-
- public static String RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_LABEL;
- public static String RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_TOOLTIP;
-
- public static String RESID_PREFERENCE_CACHE_REMOTE_CLASSES_LABEL;
- public static String RESID_PREFERENCE_CACHE_REMOTE_CLASSES_TOOLTIP;
-
- public static String RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_LABEL;
- public static String RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_TOOLTIP;
-
- public static String RESID_PREFERENCE_KEEPALIVE_LABEL;
-
- static
- {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DStoreResources.class);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.properties b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.properties
deleted file mode 100644
index 05267726a..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/DStoreResources.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-# Copyright (c) 2008 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
-
-# Contributors:
-# David McKnight (IBM) - [216596] dstore preferences (timeout, and others)
-# David McKnight (IBM) - [220123][dstore] Configurable timeout on irresponsiveness
-#################################################################################
-
-# NLS_MESSAGEFORMAT_VAR
-# NLS_ENCODING=UTF-8
-
-RESID_PREFERENCE_CONNECTION_TIMEOUT_LABEL=Connection Timeout (ms)
-RESID_PREFERENCE_CONNECTION_TIMEOUT_TOOLTIP=Time to wait for establishing a Datastore connection.
-
-RESID_PREFERENCE_DO_KEEPALIVE_LABEL=Enable Keepalive
-RESID_PREFERENCE_DO_KEEPALIVE_TOOLTIP=Keep DataStore connections alive when idle.
-
-RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_LABEL=Socket Read Timeout (ms)
-RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_TOOLTIP=Time to wait for input on a socket before initiating a keepalive request
-
-RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_LABEL=Keepalive Response Timeout (ms)
-RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_TOOLTIP=Time to wait for a response to a keepalive request
-
-RESID_PREFERENCE_CACHE_REMOTE_CLASSES_LABEL=Cache Remote Classes
-RESID_PREFERENCE_CACHE_REMOTE_CLASSES_TOOLTIP=Cache remote server classes. This is only useful when all required classes are unavailable on the server side.
-
-RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_LABEL=Show Mismatched Server Warning
-RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_TOOLTIP=Show a warning when the DataStore server is compatible but older or newer then the current client.
-
-RESID_PREFERENCE_KEEPALIVE_LABEL=Keepalive \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IConnectorServiceMessageIds.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IConnectorServiceMessageIds.java
deleted file mode 100644
index e167485f7..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IConnectorServiceMessageIds.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2008 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.
- *
- * Contributors:
- * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
- ********************************************************************************/
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-public interface IConnectorServiceMessageIds {
-
- public static final String MSG_CONNECT_DAEMON_FAILED = "RSEG1242"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECT_DAEMON_FAILED_EXCEPTION = "RSEG1243"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
- public static final String MSG_CONNECT_SSL_EXCEPTION = "RSEC2307"; //MSG_CONNECT_PREFIX + "Failed"; //$NON-NLS-1$
-
- public static final String MSG_STARTING_SERVER_VIA_REXEC = "RSEC2310"; //$NON-NLS-1$
- public static final String MSG_STARTING_SERVER_VIA_DAEMON = "RSEC2311"; //$NON-NLS-1$
- public static final String MSG_CONNECTING_TO_SERVER= "RSEC2312"; //$NON-NLS-1$
- public static final String MSG_INITIALIZING_SERVER= "RSEC2313"; //$NON-NLS-1$
- public static final String MSG_PORT_OUT_RANGE = "RSEC2316"; //$NON-NLS-1$
-
- public static final String MSG_COMM_CONNECT_FAILED = "RSEC1001"; //$NON-NLS-1$
-
- public static final String MSG_COMM_PWD_EXISTS = "RSEC2101"; //$NON-NLS-1$
- public static final String MSG_COMM_PWD_MISMATCH = "RSEC2102"; //$NON-NLS-1$
- public static final String MSG_COMM_PWD_BLANKFIELD = "RSEC2103"; //$NON-NLS-1$
-
- public static final String MSG_COMM_ENVVAR_DUPLICATE = "RSEC2001"; //$NON-NLS-1$
- public static final String MSG_COMM_ENVVAR_NONAME = "RSEC2002"; //$NON-NLS-1$
- public static final String MSG_COMM_ENVVAR_INVALIDCHAR = "RSEC2004"; //$NON-NLS-1$
-
- public static final String MSG_COMM_SERVER_NOTSTARTED = "RSEC2301"; //$NON-NLS-1$
- public static final String MSG_COMM_INVALID_LOGIN = "RSEC2302"; //$NON-NLS-1$
-
- public static final String MSG_COMM_INCOMPATIBLE_PROTOCOL = "RSEC2303"; //$NON-NLS-1$
- public static final String MSG_COMM_INCOMPATIBLE_UPDATE = "RSEC2304"; //$NON-NLS-1$
-
-
- public static final String MSG_COMM_REXEC_NOTSTARTED = "RSEC2305"; //$NON-NLS-1$
-
- public static final String MSG_COMM_PORT_WARNING = "RSEC2306"; //$NON-NLS-1$
-
- public static final String MSG_COMM_SERVER_OLDER_WARNING = "RSEC2308"; //$NON-NLS-1$
- public static final String MSG_COMM_CLIENT_OLDER_WARNING = "RSEC2309"; //$NON-NLS-1$
-
- public static final String MSG_COMM_USING_SSL = "RSEC2314"; //$NON-NLS-1$
- public static final String MSG_COMM_NOT_USING_SSL = "RSEC2315"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_PASSWORD_EMPTY = "RSEG1035"; //MSG_VALIDATE_PREFIX + "PasswordRequired"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PASSWORD_EXPIRED = "RSEG1036"; //MSG_VALIDATE_PREFIX + "PasswordExpired"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_PASSWORD_INVALID = "RSEG1297"; //$NON-NLS-1$
-
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IDStoreDefaultPreferenceConstants.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IDStoreDefaultPreferenceConstants.java
deleted file mode 100644
index bdcdd3760..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/IDStoreDefaultPreferenceConstants.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2008 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.
- *
- * Contributors:
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- ********************************************************************************/
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-public interface IDStoreDefaultPreferenceConstants {
- public static final boolean DEFAULT_PREF_CACHE_REMOTE_CLASSES = true;
- public static final int DEFAULT_PREF_SOCKET_TIMEOUT = 5000;
- public static final boolean DEFAULT_PREF_DO_KEEPALIVE = true;
- public static final int DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT = 60000;
- public static final int DEFAULT_PREF_SOCKET_READ_TIMEOUT = 3600000;
- public static final boolean DEFAULT_ALERT_MISMATCHED_SERVER = true;
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java
deleted file mode 100644
index 85b21f223..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/RexecDstoreServer.java
+++ /dev/null
@@ -1,1218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
- * 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:
- * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
- * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
- * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
- * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
- * David McKnight (IBM) - [221095] [dstore][launcher] Specified REXEC port number is not used
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- *******************************************************************************/
-
-package org.eclipse.rse.internal.connectorservice.dstore;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.EOFException;
-import java.net.Socket;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.dstore.core.client.ClientConnection;
-import org.eclipse.dstore.core.client.ConnectionStatus;
-import org.eclipse.osgi.util.NLS;
-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.services.clientserver.messages.SimpleSystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.SystemBasePlugin;
-
-/**
- * Launch Datastore server on selected host using the rexec
- * protocol
- */
-public class RexecDstoreServer implements IServerLauncher
-{
- private SystemMessage _errorMessage;
- private SystemSignonInformation signonInfo;
- //private String host = null;
- private String cwd = null;
- private String invocation = null;
- //private String userID = null;
- private int rexecPort = 512; // the port where rexecd normally listens
- private String cmd = null;
- //private String pwd = null;
- private static String ASCII_TEST_STRING = "ASCII"; //$NON-NLS-1$
- private static String PORT_LEADING_STRING = "Server Started Successfully"; //$NON-NLS-1$
- private static final String EZYRD11E="EZYRD11E"; //$NON-NLS-1$
- private ClientConnection clientConnection;
- private IServerLauncherProperties propertyInfo;
- private boolean isModeChecked = false;
- private boolean checkPort =true;
- private boolean logInfo = false;
- private int _socketTimeoutValue = IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT;
-
- private static char[] ebcdictounicode =
- {
- 0x0000,
- 0x0001,
- 0x0002,
- 0x0003,
- 0x0000,
- 0x0009,
- 0x0000,
- 0x007F,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x000B,
- 0x000C,
- 0x000D,
- 0x000E,
- 0x000F,
- 0x0010,
- 0x0011,
- 0x0012,
- 0x0013,
- 0x0000,
- 0x000A,
- 0x0008,
- 0x0000,
- 0x0018,
- 0x0019,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x001C,
- 0x0000,
- 0x0000,
- 0x000A,
- 0x0017,
- 0x001B,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0005,
- 0x0006,
- 0x0007,
- 0x0000,
- 0x0000,
- 0x0016,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0004,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0014,
- 0x0015,
- 0x0000,
- 0x001A,
- 0x0020,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x002E,
- 0x003C,
- 0x0028,
- 0x002B,
- 0x007C,
- 0x0026,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0021,
- 0x0024,
- 0x002A,
- 0x0029,
- 0x003B,
- 0x0000,
- 0x002D,
- 0x002F,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x007C,
- 0x002C,
- 0x0025,
- 0x005F,
- 0x003E,
- 0x003F,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0060,
- 0x003A,
- 0x0023,
- 0x0040,
- 0x0027,
- 0x003D,
- 0x0022,
- 0x0000,
- 0x0061,
- 0x0062,
- 0x0063,
- 0x0064,
- 0x0065,
- 0x0066,
- 0x0067,
- 0x0068,
- 0x0069,
- 0x0000,
- 0x007B,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x002B,
- 0x0000,
- 0x006A,
- 0x006B,
- 0x006C,
- 0x006D,
- 0x006E,
- 0x006F,
- 0x0070,
- 0x0071,
- 0x0072,
- 0x0000,
- 0x007D,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0073,
- 0x0074,
- 0x0075,
- 0x0076,
- 0x0077,
- 0x0078,
- 0x0079,
- 0x007A,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x005B,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x005D,
- 0x0000,
- 0x002D,
- 0x007D,
- 0x0041,
- 0x0042,
- 0x0043,
- 0x0044,
- 0x0045,
- 0x0046,
- 0x0047,
- 0x0048,
- 0x0049,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x007D,
- 0x004A,
- 0x004B,
- 0x004C,
- 0x004D,
- 0x004E,
- 0x004F,
- 0x0050,
- 0x0051,
- 0x0052,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x005C,
- 0x0000,
- 0x0053,
- 0x0054,
- 0x0055,
- 0x0056,
- 0x0057,
- 0x0058,
- 0x0059,
- 0x005A,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0030,
- 0x0031,
- 0x0032,
- 0x0033,
- 0x0034,
- 0x0035,
- 0x0036,
- 0x0037,
- 0x0038,
- 0x0039,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000 };
-
- /**
- * Constructor
- */
- public RexecDstoreServer()
- {
- super();
- }
-
- /**
- * Set the datastore client connection. This is reset for each connect()
- */
- public void setClientConnection(ClientConnection clientConnection)
- {
- this.clientConnection = clientConnection;
- }
-
- /**
- * Set the remote system signon information
- */
- public void setSignonInformation(SystemSignonInformation info)
- {
- this.signonInfo = info;
- }
-
- /**
- * Get the remote system signon information, as set in
- * {@link #setSignonInformation(SystemSignonInformation)}
- */
- public SystemSignonInformation getSignonInformation()
- {
- return signonInfo;
- }
-
- /**
- * Set the object which contains the user-specified properties that
- * are used by this launcher
- */
- public void setServerLauncherProperties(IServerLauncherProperties propertyInfo)
- {
- this.propertyInfo = propertyInfo;
-
- // set path...
- this.cwd = ((IRemoteServerLauncher)propertyInfo).getServerPath();
- char separatorChar = signonInfo.getSystemType().isWindows() ? '\\' : '/';
- if (cwd.length() > 0 && cwd.charAt(cwd.length() - 1) != separatorChar)
- cwd += separatorChar;
- // set script...
- this.invocation = ((IRemoteServerLauncher)propertyInfo).getServerScript();
-
- // set port
- this.rexecPort = ((IRemoteServerLauncher)propertyInfo).getRexecPort();
-
- }
-
- /**
- * Get the object which contians the user-specified properties that are
- * used by this launcher. As set in {@link #setServerLauncherProperties(IServerLauncherProperties)}.
- */
- public IServerLauncherProperties getServerLauncherProperties()
- {
- return propertyInfo;
- }
-
- /**
- * Determine if the remote server needs to be launched or not.
- * Generally is always false.
- */
- public boolean isLaunched()
- {
- return false;
- }
-
- /**
- * Send a command to the host via rexec to launch the datastore server
- * under the specified user ID/pwd. the datastore server will emit
- * messages that include the port number on which the server is listening
- * for client connections
- *
- * @return port number as String
- */
- /*
- * There used to be a problem in Communications Server for z/OS and
- * the message from the REXEC daemon was in EBCDIC. see APAR PQ76782.
- * Since this problem was fixed in Communication Server, there is no need to convert EBCDIC to ASCII
- */
- // updated method
- public Object launch(IProgressMonitor monitor) throws Exception
- {
-
- boolean isEBCDICTest=false;
- isModeChecked= false;
- checkPort=true;
- _errorMessage = null;
- String port = new String("0"); // default no port //$NON-NLS-1$
- //String hostResponse = ""; //buffer to hold all the messages, so that it can be printed out later
- String originalHostResponse=""; //$NON-NLS-1$
- String convertedHostResponse=""; //$NON-NLS-1$
- String debugOptions = System.getProperty("REXEC_DEBUG"); //$NON-NLS-1$
- if (debugOptions!= null){
- if (debugOptions.toUpperCase().indexOf("LOG") > -1) //$NON-NLS-1$
- logInfo = true;
- if (debugOptions.toUpperCase().indexOf("EBCDIC") > -1) //$NON-NLS-1$
- isEBCDICTest=true;
- }
- boolean isEBCDIC = false;
- try
- {
-
- // establish socket for rexec connection
- Socket rexecCall = new Socket(signonInfo.getHostname(), rexecPort); // rexec listens here - 512
-
- // set socket timeout value
- rexecCall.setSoTimeout(_socketTimeoutValue);
-
- // set up data streams on rexec socket
- DataOutputStream rxOut = new DataOutputStream(rexecCall.getOutputStream());
- DataInputStream rxIn = new DataInputStream(rexecCall.getInputStream());
-
- // we're not opening a socket for stderr to circumvent problems that
- // may arise if the client is behind a firewall with respect to the
- // host, in which case the rexec daemon may have trouble connecting
- // to the client error port.
- // Not sending a port number at this point indicates to the daemon
- // that there is no error socket to establish.
- rxOut.writeByte(0); // send null terminator
- rxOut.flush();
-
- // send userid and password on rexec socket
- rxOut.writeBytes(signonInfo.getUserId());
- rxOut.writeByte(0); // send null terminator
- rxOut.writeBytes(signonInfo.getPassword());
- rxOut.writeByte(0); // send null terminator
- rxOut.flush();
-
- // send the command on rexec socket to start datastore daemon listening
- // on any port
- // TODO - assumes a particular script and location to start the server,
- // this should be stored in some resource bundle later
- //cmd = new String ("echo USSTEST;cd ~/dstore;start_anyport");
- //cmd = new String("echo " + ASCII_TEST_STRING + ";cd ~/rseserver;start_anyport");
- cmd = new String("echo " + ASCII_TEST_STRING + ";cd " + this.cwd + ";" + this.invocation); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- //cmd = new String("echo " + ASCII_TEST_STRING + ";cd " + this.cwd + ";" + this.invocation + " " + System.getProperty("user.name"));
- logMessage("The command is " + cmd); //$NON-NLS-1$
- SystemBasePlugin.logInfo("RexecDstoreServer :"); //$NON-NLS-1$
-
- rxOut.writeBytes(cmd);
- rxOut.writeByte(0); // send null terminator
- rxOut.flush();
-
- int inBytes = rxIn.available(); // any data available?
-
- int timeout = 600; // 60 second to connect
-
- while (inBytes == 0 && timeout > 0)
- {
- if (monitor.isCanceled()) // Cancel button pressed?
- return "0"; //$NON-NLS-1$
-
- // try for more input
- Thread.sleep(100);
- inBytes = rxIn.available();
- timeout--;
- }
-
- if (timeout == 0) {
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, signonInfo.getHostname());
- String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, ""); //$NON-NLS-1$
-
- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IConnectorServiceMessageIds.MSG_COMM_INVALID_LOGIN, IStatus.ERROR, msgTxt, msgDetails);
- _errorMessage = msg;
- return port;
- }
-
- // get command output on socket, one byte at a time until
- // got the datastore port number or EOF is reached for this input
- String maybePort=null;
- while (true ){
- if (monitor.isCanceled())
- return "0"; //$NON-NLS-1$
- byte aByte = rxIn.readByte();
- if (isEBCDICTest)
- aByte = convertFromASCIIToEBCDIC(aByte); // for EBCDIC Test
- if (aByte == 0) // drop the null
- continue;
- originalHostResponse += (char)aByte;
- logMessage("Host response is " + originalHostResponse); //$NON-NLS-1$
- if (!isModeChecked)
- {
- convertedHostResponse += convertFromEBCDICToASCII(aByte);
- logMessage("Host response is converted to " + convertedHostResponse); //$NON-NLS-1$
- if (originalHostResponse.indexOf(ASCII_TEST_STRING) > -1)
- { // It's ASCII mode
- isModeChecked = true;
- logMessage("This is the ASCII mode. "); //$NON-NLS-1$
- }
- else if (convertedHostResponse.indexOf(ASCII_TEST_STRING) > -1)
- { // It's EBCDIC mode
- logMessage("This is the EBCDIC mode. "); //$NON-NLS-1$
- isModeChecked = true;
- isEBCDIC = true;
- }
- }
- else
- {
- if (isEBCDIC)
- {
- convertedHostResponse += convertFromEBCDICToASCII(aByte);
- logMessage("Host response is converted to " + convertedHostResponse); //$NON-NLS-1$
- if(checkPort)
- { // It's EBCDIC mode
- maybePort = extractPortNumber (convertedHostResponse);
- }
- }
- else if (checkPort)
- { // it's ASCII
- maybePort = extractPortNumber (originalHostResponse);
- }
- if (maybePort == null)
- continue ;
- port = maybePort;
- break;
- }
- }
- // -----------------------------------------------------------------
- // Close input/output streams and socket
- // -----------------------------------------------------------------
- rxIn.close();
- rxOut.close();
- rexecCall.close();
- logMessage("Going to return port " + port); //$NON-NLS-1$
- return port;
- }
- catch (EOFException e)
- {
- // do nothing
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- // if no port is found, create error message
- String hostMessage = originalHostResponse;
- if (isEBCDIC) // pick up the right messages
- hostMessage = convertedHostResponse;
- int index = hostMessage.indexOf(ASCII_TEST_STRING);
- if (index > -1) // remove the embedded ASCII_TEST_STRING
- hostMessage = hostMessage.substring(0,index) + hostMessage.substring(index+1+ASCII_TEST_STRING.length());
- if (hostMessage.indexOf(EZYRD11E) >0 ){
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, signonInfo.getHostname());
- String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN_DETAILS, hostMessage);
-
- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IConnectorServiceMessageIds.MSG_COMM_INVALID_LOGIN, IStatus.ERROR, msgTxt, msgDetails);
- _errorMessage = msg;
- } else {
- String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED, ""+rexecPort, signonInfo.getHostname()); //$NON-NLS-1$
- String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_REXEC_NOTSTARTED_DETAILS, hostMessage);
-
- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IConnectorServiceMessageIds.MSG_COMM_REXEC_NOTSTARTED, IStatus.ERROR, msgTxt, msgDetails);
- _errorMessage = msg;
-
- }
-
- return port;
- }
- /**
- * @param newLine
- * @return
- */
- /*
- private String checkCodePage(String newLine) {
- // check in which mode the host is sending the message back
- if (isModeChecked)
- return newLine;
- if (newLine.indexOf(ASCII_TEST_STRING) > -1){ // It's ASCII mode
- isASCIIMode = true;
- isModeChecked = true;
- } else { // Check whether it's EBCDIC mode
- String convertedNewLine = convertFromEBCDICToASCII(newLine.toCharArray());
- if (convertedNewLine.indexOf(ASCII_TEST_STRING) > -1){
- isASCIIMode = false;
- isModeChecked = true;
- }
- }
- return newLine;
- }
- */
- /* wait until host responds with some data - at least should send null byte */
-/* char cChar;
- int inBytes = rxIn.available(); // any data available?
- StringBuffer buf = new StringBuffer();
- String chunk = null;
-
- while (inBytes == 0)
- {
- if (monitor.isCanceled())
- return "0";
-
- // try for more input
- Thread.sleep(100);
-
- inBytes = rxIn.available();
- }
-
- // get command output on socket, one byte at a time until
- // got the datastore port number or EOF is reached for this input
- byte[] bDSPort = new byte[4];
- byte[] byteBuf = new byte[8];
- int index;
- if (inBytes > 0)
- {
- byte aByte = rxIn.readByte();
- cChar = (char)aByte; // discard first null byte
-
-// port = getPortASCII(rxIn);
- // should have at least 8 bytes plus newline from the "echo USSTEST" command. This is
- // used to test if the data being returned is ASCII or EBCDIC
- for (index = 0; index < ASCII_TEST_STRING.length(); index++)
- { // include newline too
- aByte = rxIn.readByte();
- cChar = (char)aByte;
- buf.append(cChar);
- byteBuf[index] = aByte;
- }
- chunk = new String(buf);
-
- if (chunk.indexOf(ASCII_TEST_STRING) >= 0)
- {
- // returned data is ASCII
- port = getPortASCII(rxIn);
- }
- else
- {
-
- chunk = convertFromEBCDICToASCII(byteBuf);
- if (chunk.indexOf(ASCII_TEST_STRING) >= 0)
- {
-
- // returned data is EBCDIC
- port = getPortEBCDIC(rxIn);
- }
- else
- {
- // rexec error!
- // there's an error
- while (cChar != '\n')
- {
- cChar = (char) rxIn.readByte();
- buf.append(cChar);
- }
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INVALID_LOGIN);
- msg.makeSubstitution(signonInfo.getHostname(), buf.toString());
- _errorMessage = msg;
- }
- }
- }
- rxIn.close();
- rxOut.close();
- rexecCall.close();
-
- }
- catch (Exception e)
- {
- System.out.println(e);
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_REXEC_NOTSTARTED);
- msg.makeSubstitution(""+rexecPort, signonInfo.getHostname(), e.getMessage());
- _errorMessage = msg;
- }
-
- return port;
- } // end of launch method
- */
- /* original method
- public Object launch(IProgressMonitor monitor) throws Exception
- {
- _errorMessage = null;
- String port = new String("0"); // default no port
- try
- {
-
- // establish socket for rexec connection
- Socket rexecCall = new Socket(signonInfo.getHostname(), rexecPort); // rexec listens here - 512
-
- // set up data streams on rexec socket
- DataOutputStream rxOut = new DataOutputStream(rexecCall.getOutputStream());
- DataInputStream rxIn = new DataInputStream(rexecCall.getInputStream());
-
- // we're not opening a socket for stderr to circumvent problems that
- // may arise if the client is behind a firewall with respect to the
- // host, in which case the rexec daemon may have trouble connecting
- // to the client error port.
- // Not sending a port number at this point indicates to the daemon
- // that there is no error socket to establish.
- rxOut.writeByte((int) 0); // send null terminator
- rxOut.flush();
-
- // send userid and password on rexec socket
- rxOut.writeBytes(signonInfo.getUserid());
- rxOut.writeByte((int) 0); // send null terminator
- rxOut.writeBytes(signonInfo.getPassword());
- rxOut.writeByte((int) 0); // send null terminator
- rxOut.flush();
-
- // send the command on rexec socket to start datastore daemon listening
- // on any port
- // TODO - assumes a particular script and location to start the server,
- // this should be stored in some resource bundle later
- //cmd = new String ("echo USSTEST;cd ~/dstore;start_anyport");
- //cmd = new String("echo " + ASCII_TEST_STRING + ";cd ~/rseserver;start_anyport");
- cmd = new String("echo " + ASCII_TEST_STRING + ";cd " + this.cwd + ";" + this.invocation);
-
- rxOut.writeBytes(cmd);
- rxOut.writeByte((int) 0); // send null terminator
- rxOut.flush();
-
- // wait until host responds with some data - at least should send null byte
-
- char cChar;
- int inBytes = rxIn.available(); // any data available?
- StringBuffer buf = new StringBuffer();
- String chunk = null;
-
- while (inBytes == 0)
- {
- if (monitor.isCanceled())
- return "0";
-
- // try for more input
- Thread.sleep(100);
-
- inBytes = rxIn.available();
- }
-
- // get command output on socket, one byte at a time until
- // got the datastore port number or EOF is reached for this input
- byte[] bDSPort = new byte[4];
- byte[] byteBuf = new byte[8];
- int index;
- if (inBytes > 0)
- {
- byte aByte = rxIn.readByte();
- cChar = (char)aByte; // discard first null byte
-
- // should have at least 8 bytes plus newline from the "echo USSTEST" command. This is
- // used to test if the data being returned is ASCII or EBCDIC
- for (index = 0; index < ASCII_TEST_STRING.length(); index++)
- { // include newline too
- aByte = rxIn.readByte();
- cChar = (char)aByte;
- buf.append(cChar);
- byteBuf[index] = aByte;
- }
- chunk = new String(buf);
-
- if (chunk.indexOf(ASCII_TEST_STRING) >= 0)
- {
- // returned data is ASCII
- port = getPortASCII(rxIn);
- }
- else
- {
-
- chunk = convertFromEBCDICToASCII(byteBuf);
- if (chunk.indexOf(ASCII_TEST_STRING) >= 0)
- {
-
- // returned data is EBCDIC
- port = getPortEBCDIC(rxIn);
- }
- else
- {
- // rexec error!
- // there's an error
- while (cChar != '\n')
- {
- cChar = (char) rxIn.readByte();
- buf.append(cChar);
- }
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INVALID_LOGIN);
- msg.makeSubstitution(signonInfo.getHostname(), buf.toString());
- _errorMessage = msg;
- }
- }
-
- }
- rxIn.close();
- rxOut.close();
- rexecCall.close();
-
- }
- catch (Exception e)
- {
- System.out.println(e);
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_REXEC_NOTSTARTED);
- msg.makeSubstitution(""+rexecPort, signonInfo.getHostname(), e.getMessage());
- _errorMessage = msg;
- }
-
- return port;
- } // end of launch method
-*/
- /**
- * Determine if we are connected to the remote server or not.
- * @return true if we are connected, false otherwise.
- */
- public boolean isConnected()
- {
- if (clientConnection != null)
- {
- return clientConnection.isConnected();
- }
- return false;
- }
-
- /**
- * Connect to the remote server.
- * @param connectPort the port to use for launching the server
- * @param monitor a monitor for showing progress
- * @see #getErrorMessage()
- * @return Anything you want.
- */
- public Object connect(int connectPort, IProgressMonitor monitor) throws Exception
- {
- clientConnection.setPort(Integer.toString(connectPort));
-
- if (monitor != null)
- {
- String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort());
- monitor.subTask(cmsg);
- }
-
- // connect to launched server
- ConnectionStatus connectStatus = clientConnection.connect(null);
-
- return connectStatus;
- }
-
- /**
- * Disconnect from the remote server
- * @see #getErrorMessage()
- */
- public void disconnect() throws Exception
- {
- if (clientConnection != null)
- {
- /* TODO!
- // Is disconnect being called because the network (connection) went down?
- if (_connectionStatusListener != null && _connectionStatusListener.isConnectionDown())
- {
- fireCommunicationsEvent(CommunicationsEvent.CONNECTION_ERROR);
- }
- else
- {
- // Fire comm event to signal state about to change
- fireCommunicationsEvent(CommunicationsEvent.BEFORE_DISCONNECT);
- }
-
- DataStore dataStore = getDataStore();
- if (dataStore != null && _connectionStatusListener != null)
- {
- dataStore.getDomainNotifier().removeDomainListener(_connectionStatusListener);
- }
-
- clientConnection.disconnect();
- clientConnection = null;
- getUserId(); // Clear any cached local user IDs
- sysInfo = null;
-
- // Fire comm event to signal state changed
- fireCommunicationsEvent(CommunicationsEvent.AFTER_DISCONNECT);
- */
- clientConnection.disconnect();
- clientConnection = null;
- }
- }
-
- /**
- * Return the last error message issued
- */
- public SystemMessage getErrorMessage()
- {
- return _errorMessage;
- }
-
- // ------------------
- // PRIVATE METHODS...
- // ------------------
-/*
- // sam private String convertFromEBCDICToASCII(byte[] eBytes)
- private String convertFromEBCDICToASCII(char[] eBytes)
- {
-
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < eBytes.length; i++)
- {
- byte bByte = (byte)eBytes[i];
- int index = bByte;
- if (index < 0)
- {
- index = 256 + index;
- }
- char cChar = ebcdictounicode[index];
- buf.append(cChar);
- }
- return buf.toString();
- }
-*/
- /**
- * Read the data returned on the rexec port as ASCII characters and
- * detect the port number in the datastore server messages
- * @param rxIn
- * @return String port number
- */
- /*
- private String getPortASCII(DataInputStream rxIn)
- {
- String port = new String("0"); // default to no port
- char cChar;
- byte bByte;
- int numPortChars = 5;
- byte[] bDSPort = new byte[numPortChars];
- StringBuffer buf = new StringBuffer();
- StringBuffer diagnosticString = new StringBuffer();
- String chunk = null;
- boolean serverStartedMsg = false;
- while (true)
- {
- try
- {
- cChar = (char) rxIn.readByte();
- if (cChar == '\n')
- { // hit a newline
- chunk = new String(buf);
-
- // DKM: need to handle mixed order cases
-
- if (chunk.indexOf("Server Started Successfully") >= 0)
- {
- serverStartedMsg = true;
- // this server output precedes the datastore server port number
- buf.delete(0, buf.length()); // clear buffer
-
- // might have already got port
- // check first
- if (port.equals("0"))
- {
- rxIn.read(bDSPort, 0, numPortChars); // get next 4 bytes - datastore port #
- for (int i = 0; i < numPortChars; i++)
- {
- char c = (char) bDSPort[i];
- if (Character.isDigit(c))
- buf.append(c);
- }
- port = new String(buf); // got port where datastore server is listening
-
- // check for valid port
- try
- {
- int possiblePort = Integer.parseInt(port);
- break;
-
- }
- catch (Exception e)
- {
- // not valid
- }
- }
-
- }
- else
- {
- // might be the port
- try
- {
- int possiblePort = Integer.parseInt(chunk);
- port = chunk;
- if (serverStartedMsg)
- break;
- }
- catch (Exception e)
- {
- }
- }
-
- buf.delete(0, buf.length()); // clear buffer
- }
- else
- {
- diagnosticString.append(cChar);
- buf.append(cChar);
- }
- }
- // EOF indicates no more lines to come through on error socket
- catch (EOFException e)
- {
- break;
- }
- catch (IOException e)
- {
- break;
- }
- } // end of while true
-
- // if port is somethign wierd...log this
- if (port.equals("0"))
- {
- // port is weird!
-
- try
- {
-
- int available = rxIn.available();
- while (available > 0)
- {
- rxIn.read(bDSPort, 0, numPortChars);
- for (int i = 0; i < numPortChars; i++)
- {
- char c = (char) bDSPort[i];
- diagnosticString.append(c);
- }
- available = rxIn.available();
- }
-
- }
- catch (Exception ex)
- {
- }
-
- SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_SERVER_NOTSTARTED);
- diagnosticString.insert(0, "\n\n");
- msg.makeSubstitution(signonInfo.getHostname(), diagnosticString.toString());
-
- _errorMessage = msg;
- }
-
- return port;
- }
-*/
- /**
- * Read the data returned on the rexec port as EBCDIC characters and
- * convert to unicode. Detect the port number in the datastore server messages
- * @param rxIn
- * @return String port number
- */
- /*
- private String getPortEBCDIC(DataInputStream rxIn)
- {
- String port = new String("0"); // default to no port
- int index;
- char cChar;
- byte bByte;
- byte[] bDSPort = new byte[4];
- StringBuffer buf = new StringBuffer();
- String chunk = null;
- while (true)
- {
- try
- {
- bByte = rxIn.readByte();
- index = bByte;
- if (index < 0)
- {
- index = 256 + index;
- }
- cChar = ebcdictounicode[index];
- if (cChar == '\n')
- { // hit a newline
- chunk = new String(buf);
-
- if (chunk.indexOf("Server Started Successfully") >= 0)
- {
- // this server output precedes the datastore server port number
- buf.delete(0, buf.length()); // clear buffer
- rxIn.read(bDSPort, 0, 4); // get next 4 bytes - datastore port #
- for (int i = 0; i < 4; i++)
- {
- index = bDSPort[i];
- if (index < 0)
- {
- index = 256 + index;
- }
- buf.append(ebcdictounicode[index]);
- }
- port = new String(buf); // got port where datastore server is listening
- break;
- }
- buf.delete(0, buf.length()); // clear buffer
- }
- else
- {
- buf.append(cChar);
- }
- }
- // EOF indicates no more lines to come through on error socket
- catch (EOFException e)
- {
- break;
- }
- catch (IOException e)
- {
- break;
- }
- } // end of while true
- return port;
- }
- */
- private String extractPortNumber (String hostResponse) {
- String port ="0"; //$NON-NLS-1$
- logMessage("Going to find port number. "); //$NON-NLS-1$
- int index = hostResponse.indexOf(PORT_LEADING_STRING);
- if ( index < 0 )
- return null;
- logMessage("Found the leading string. "); //$NON-NLS-1$
- String portString = hostResponse.substring(index + PORT_LEADING_STRING.length());
- logMessage("Removed the leading string as " + portString); //$NON-NLS-1$
- if (portString != null && portString.startsWith("\n")) //$NON-NLS-1$
- portString = portString.substring(1);
- if (portString == null)
- return null;
-
- //if (portString.length() < 4)
- // return null;
-
- // change to support 5 digit ports
- StringBuffer portBuffer = new StringBuffer();
-
- for (int i = 0; i < portString.length(); i++)
- {
- char c = portString.charAt(i);
- if (Character.isDigit(c))
- {
- portBuffer.append(c);
- }
- }
-
- if (portString.length() != portBuffer.length())
- {
- port = portBuffer.toString();
- // old code - didn't support 5 digits
- //port = portString.substring(0,4);
-
- logMessage("Got the port " + port); //$NON-NLS-1$
- try
- {
- Integer.parseInt(port);
- logMessage("Going to return port " + port); //$NON-NLS-1$
- return port;
- }
- catch (RuntimeException e)
- {
- e.printStackTrace();
- logMessage("Got the wrong port " + port); //$NON-NLS-1$
- checkPort=false;
- return null;
- }
- }
- else
- {
- return null;
- }
- }
- private char convertFromEBCDICToASCII(byte eByte)
- {
- int index = eByte;
- if (index < 0)
- {
- index = 256 + index;
- }
- return ebcdictounicode[index];
- }
- private byte convertFromASCIIToEBCDIC(byte eByte)
- {
- int index = eByte;
- for (int i = 0; i <ebcdictounicode.length; i++) {
- if (index == ebcdictounicode[i]){
- if (i > 128)
- return (byte )(i - 256);
- return (byte)i;
- }
-
- }
- return (byte)0;
- }
- private void logMessage (String message) {
- if (logInfo)
- SystemBasePlugin.logError("RexecDstoreServer :" + message); //$NON-NLS-1$
- }
-
- public void setSocketTimeoutValue(int value)
- {
- _socketTimeoutValue = value;
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ui/propertypages/DStorePreferencePage.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ui/propertypages/DStorePreferencePage.java
deleted file mode 100644
index 58f95f2a1..000000000
--- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/internal/connectorservice/dstore/ui/propertypages/DStorePreferencePage.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2008 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.
- *
- * Contributors:
- * David McKnight (IBM) - [216596] dstore preferences (timeout, and others)
- * David McKnight (IBM) - [220123][dstore] Configurable timeout on irresponsiveness
- * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
- * David Dykstal (IBM) - [232317] add help for this preference page
- ********************************************************************************/
-package org.eclipse.rse.internal.connectorservice.dstore.ui.propertypages;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants;
-import org.eclipse.rse.internal.connectorservice.dstore.DStoreResources;
-import org.eclipse.rse.ui.RSEUIPlugin;
-import org.eclipse.rse.ui.SystemWidgetHelpers;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-public class DStorePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener
-{
-
- private Text _connectionTimeout;
- private Button _doKeepaliveButton;
- private Text _keepaliveResponseTimeout;
- private Text _socketReadTimeout;
-
-// private Button _cacheRemoteClassesButton;
- private Button _showMismatchedServerWarningButton;
-
- protected Control createContents(Composite gparent) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), RSEUIPlugin.HELPPREFIX + "DStorePreferencePage"); //$NON-NLS-1$
-
- Composite parent = SystemWidgetHelpers.createComposite(gparent, 2);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite connectComposite = SystemWidgetHelpers.createComposite(parent, 2);
-
- SystemWidgetHelpers.createLabel(connectComposite, DStoreResources.RESID_PREFERENCE_CONNECTION_TIMEOUT_LABEL);
-
- _connectionTimeout = new Text(connectComposite, SWT.BORDER);
- //GridData gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.widthHint = 75;
- gd.horizontalSpan =1;
- _connectionTimeout.setLayoutData(gd);
- _connectionTimeout.setTextLimit(10);
- _connectionTimeout.setToolTipText(DStoreResources.RESID_PREFERENCE_CONNECTION_TIMEOUT_TOOLTIP);
- _connectionTimeout.addVerifyListener(new VerifyListener()
- {
- public void verifyText(VerifyEvent e)
- {
- e.doit = true;
- for (int loop = 0; loop < e.text.length(); loop++)
- {
- if (!Character.isDigit(e.text.charAt(loop)))
- e.doit = false;
- }
- }
- });
-
-
-// _cacheRemoteClassesButton = SystemWidgetHelpers.createCheckBox(parent, DStoreResources.RESID_PREFERENCE_CACHE_REMOTE_CLASSES_LABEL, this);
-// _cacheRemoteClassesButton.setToolTipText(DStoreResources.RESID_PREFERENCE_CACHE_REMOTE_CLASSES_TOOLTIP);
-// _cacheRemoteClassesButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
-// ((GridData)_cacheRemoteClassesButton.getLayoutData()).horizontalSpan = 2;
-
- _showMismatchedServerWarningButton = SystemWidgetHelpers.createCheckBox(parent, DStoreResources.RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_LABEL, this);
- _showMismatchedServerWarningButton.setToolTipText(DStoreResources.RESID_PREFERENCE_SHOW_MISMATCHED_SERVER_TOOLTIP);
- _showMismatchedServerWarningButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
- ((GridData)_showMismatchedServerWarningButton.getLayoutData()).horizontalSpan = 2;
-
-
- // keepalive stuff
- Group keepaliveGroup = SystemWidgetHelpers.createGroupComposite(parent, 2, DStoreResources.RESID_PREFERENCE_KEEPALIVE_LABEL);
- layout = new GridLayout();
- layout.numColumns = 2;
- keepaliveGroup.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.GRAB_HORIZONTAL);
- keepaliveGroup.setLayoutData(data);
-
-
-
- _doKeepaliveButton = SystemWidgetHelpers.createCheckBox(keepaliveGroup, DStoreResources.RESID_PREFERENCE_DO_KEEPALIVE_LABEL, this);
- _doKeepaliveButton.setToolTipText(DStoreResources.RESID_PREFERENCE_DO_KEEPALIVE_TOOLTIP);
- _doKeepaliveButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
- ((GridData)_doKeepaliveButton.getLayoutData()).horizontalSpan = 2;
-
-
- SystemWidgetHelpers.createLabel(keepaliveGroup, DStoreResources.RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_LABEL);
-
- _socketReadTimeout = new Text(keepaliveGroup, SWT.BORDER);
- gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
- gd.widthHint = 75;
- gd.horizontalSpan =1;
- _socketReadTimeout.setLayoutData(gd);
- _socketReadTimeout.setTextLimit(10);
- _socketReadTimeout.setToolTipText(DStoreResources.RESID_PREFERENCE_KEEPALIVE_SOCKET_READ_TIMEOUT_TOOLTIP);
- _socketReadTimeout.addVerifyListener(new VerifyListener()
- {
- public void verifyText(VerifyEvent e)
- {
- e.doit = true;
- for (int loop = 0; loop < e.text.length(); loop++)
- {
- if (!Character.isDigit(e.text.charAt(loop)))
- e.doit = false;
- }
- }
- });
-
- SystemWidgetHelpers.createLabel(keepaliveGroup, DStoreResources.RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_LABEL);
-
- _keepaliveResponseTimeout = new Text(keepaliveGroup, SWT.BORDER);
- gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
- gd.widthHint = 75;
- gd.horizontalSpan =1;
- _keepaliveResponseTimeout.setLayoutData(gd);
- _keepaliveResponseTimeout.setTextLimit(10);
- _keepaliveResponseTimeout.setToolTipText(DStoreResources.RESID_PREFERENCE_KEEPALIVE_RESPONSE_TIMEOUT_TOOLTIP);
- _keepaliveResponseTimeout.addVerifyListener(new VerifyListener()
- {
- public void verifyText(VerifyEvent e)
- {
- e.doit = true;
- for (int loop = 0; loop < e.text.length(); loop++)
- {
- if (!Character.isDigit(e.text.charAt(loop)))
- e.doit = false;
- }
- }
- });
-
-
-
-
- initControls();
- return parent;
- }
-
- private void initControls()
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
-
-
- // timeout
- int timeout = 0;
- if (store.contains(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT)){
- timeout = store.getInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT);
- }
- else {
- timeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT);
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, timeout);
- }
- _connectionTimeout.setText(""+timeout); //$NON-NLS-1$
-
-
- // cache remote classes
- boolean cacheRemoteClasses = false;
- if (store.contains(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES)) {
- cacheRemoteClasses = store.getBoolean(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES);
- }
- else {
- cacheRemoteClasses = store.getDefaultBoolean(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES);
- store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, cacheRemoteClasses);
- }
-// _cacheRemoteClassesButton.setSelection(cacheRemoteClasses);
-
-
- // do keepalive
- boolean doKeepalive = false;
- if (store.contains(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE)){
- doKeepalive = store.getBoolean(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE);
- }
- else {
- doKeepalive = store.getDefaultBoolean(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE);
- }
- _doKeepaliveButton.setSelection(doKeepalive);
-
- int socketTimeout = 0;
- if (store.contains(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT)){
- socketTimeout = store.getInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT);
- }
- else {
- socketTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT);
- }
- _socketReadTimeout.setText(""+socketTimeout); //$NON-NLS-1$
- _socketReadTimeout.setEnabled(doKeepalive);
-
- int keepaliveTimeout = 0;
- if (store.contains(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT)){
- keepaliveTimeout = store.getInt(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
- }
- else {
- keepaliveTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
- }
- _keepaliveResponseTimeout.setText(""+keepaliveTimeout); //$NON-NLS-1$
- _keepaliveResponseTimeout.setEnabled(doKeepalive);
-
- // show mismatched server warning
- boolean showMismatchedWarning = false;
- if (store.contains(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)){
- showMismatchedWarning = store.getBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER);
- }
- else {
- showMismatchedWarning = store.getDefaultBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER);
- }
- _showMismatchedServerWarningButton.setSelection(showMismatchedWarning);
- }
-
- protected void performApply() {
- super.performApply();
- applyValues();
- }
-
- protected void performDefaults() {
- super.performDefaults();
-
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
-
- int timeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT);
- _connectionTimeout.setText(""+timeout); //$NON-NLS-1$
-
- // do keepalive
- boolean doKeepalive = store.getDefaultBoolean(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE);
- _doKeepaliveButton.setSelection(doKeepalive);
-
- // socket read timeout
- int socketTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT);
-
- _socketReadTimeout.setText(""+socketTimeout); //$NON-NLS-1$
- _socketReadTimeout.setEnabled(doKeepalive);
-
- // keepalive response timeout
- int keepaliveTimeout = store.getDefaultInt(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
- _keepaliveResponseTimeout.setText(""+keepaliveTimeout); //$NON-NLS-1$
- _keepaliveResponseTimeout.setEnabled(doKeepalive);
-
-
- // show mismatched server warning
- boolean showMismatchedWarning = store.getDefaultBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER);
- _showMismatchedServerWarningButton.setSelection(showMismatchedWarning);
-
- // cache remote classes
-// boolean cacheRemoteClasses = store.getDefaultBoolean(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES);
-// _cacheRemoteClassesButton.setSelection(cacheRemoteClasses);
-
- }
-
- public void init(IWorkbench workbench) {
-
- }
-
- public void handleEvent(Event event) {
- if (event.widget == _doKeepaliveButton){
- boolean isEnabled = _doKeepaliveButton.getSelection();
-
- _socketReadTimeout.setEnabled(isEnabled);
- _keepaliveResponseTimeout.setEnabled(isEnabled);
-
- }
- }
-
- private void applyValues()
- {
- IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
-
- // timeout
- String timeoutStr = _connectionTimeout.getText();
- int timeout = Integer.parseInt(timeoutStr);
- store.setValue(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, timeout);
-
- // do keepalive
- boolean doKeepalive = _doKeepaliveButton.getSelection();
- store.setValue(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, doKeepalive);
-
-
- // socket read timeout
- String socketTimeoutStr = _socketReadTimeout.getText();
- int socketTimeout = Integer.parseInt(socketTimeoutStr);
- store.setValue(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT, socketTimeout);
-
- // keepalive response timeout
- String keepaliveTimeoutStr = _keepaliveResponseTimeout.getText();
- int keepaliveTimeout = Integer.parseInt(keepaliveTimeoutStr);
- store.setValue(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT, keepaliveTimeout);
-
-
- // cache remote classes
-// boolean cacheRemoteClasses = _cacheRemoteClassesButton.getSelection();
-// store.setValue(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, cacheRemoteClasses);
-
- // show mismatched server warning
- boolean showMismatchedWarning = _showMismatchedServerWarningButton.getSelection();
- store.setValue(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, showMismatchedWarning);
-
- }
-
- public boolean performOk() {
- applyValues();
- return super.performOk();
- }
-
-
-
-}

Back to the top