Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tools/remotetools/org.eclipse.ptp.remotetools.environment.core')
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/.classpath7
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/.project34
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.settings/org.eclipse.jdt.core.prefs8
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/META-INF/MANIFEST.MF24
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/about.html22
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/build.properties8
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.properties11
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.xml7
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/childrenProvider.exsd112
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/remoteEnvironmentControlDelegate.exsd112
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/EnvironmentPlugin.java164
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControl.java117
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventListener.java30
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventProvider.java41
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlJobListener.java17
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetJob.java35
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetStatus.java25
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/PoolingTargetControlEventProvider.java146
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/SSHTargetControl.java463
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/TargetControlledJob.java95
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ChildrenProviderManager.java76
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElement.java40
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElementStatus.java43
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEnvironmentEventListener.java46
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEventListener.java31
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetElement.java152
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentEventManager.java127
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentManager.java396
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetTypeElement.java75
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/Messages.java21
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/messages.properties7
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/IChildrenProvider.java31
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/INode.java45
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetTypeExtension.java76
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetVariables.java25
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/AbstractEnvironmentDialogPage.java71
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.java38
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.properties14
-rwxr-xr-xtools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/EnvironmentWizard.java126
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/AttributeVerification.java294
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/ControlAttributes.java365
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/IllegalAttributeException.java67
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/Messages.java31
-rw-r--r--tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/messages.properties17
44 files changed, 0 insertions, 3692 deletions
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.classpath b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.classpath
deleted file mode 100755
index 64c5e31b7..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.project b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.project
deleted file mode 100755
index ae9a1f234..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ptp.remotetools.environment.core</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/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.settings/org.eclipse.jdt.core.prefs b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 64d2aeacf..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Fri Apr 16 12:58:15 EDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/META-INF/MANIFEST.MF b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/META-INF/MANIFEST.MF
deleted file mode 100755
index 8745a0229..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.ptp.remotetools.environment.core;singleton:=true
-Bundle-Version: 1.3.3.qualifier
-Bundle-Activator: org.eclipse.ptp.remotetools.environment.EnvironmentPlugin
-Bundle-Vendor: %pluginProvider
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.ptp.remotetools.core,
- org.eclipse.ptp.remotetools.utils,
- org.eclipse.core.filesystem,
- org.eclipse.equinox.security;bundle-version="1.0.1",
- org.eclipse.ptp.utils.core;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.ptp.remotetools.environment,
- org.eclipse.ptp.remotetools.environment.control,
- org.eclipse.ptp.remotetools.environment.core,
- org.eclipse.ptp.remotetools.environment.extension,
- org.eclipse.ptp.remotetools.environment.wizard,
- org.eclipse.ptp.remotetools.utils.verification
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/about.html b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/about.html
deleted file mode 100755
index a78242d7f..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>May 2, 2006</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.</p>
-
-</body>
-</html>
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/build.properties b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/build.properties
deleted file mode 100755
index 1ac9adf92..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- schema/,\
- about.html,\
- plugin.properties
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.properties b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.properties
deleted file mode 100644
index b51d86833..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.properties
+++ /dev/null
@@ -1,11 +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
-#
-###############################################################################
-
-pluginName=PTP Remote Tools Target Environments Core
-pluginProvider=Eclipse.org
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.xml b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.xml
deleted file mode 100755
index b0782c37d..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/plugin.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="remoteEnvironmentControlDelegate" name="Remote Environment Control Delegate" schema="schema/remoteEnvironmentControlDelegate.exsd"/>
- <extension-point id="childrenProvider" name="Target Element Children Provider" schema="schema/childrenProvider.exsd"/>
-
-</plugin>
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/childrenProvider.exsd b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/childrenProvider.exsd
deleted file mode 100644
index 9930a5a4d..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/childrenProvider.exsd
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ptp.remotetools.environment.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ptp.remotetools.environment.core" id="childrenProvider" name="Target Element Children Provider"/>
- </appInfo>
- <documentation>
- Contributor contributes an instance of IChildrenProvider, which provides children to existing target elements. For contributing children of the target elements&apos; children, contributor should make them implementing INode.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="childrenProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="childrenProvider">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.ptp.remotetools.environment.extension.IChildrenProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/remoteEnvironmentControlDelegate.exsd b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/remoteEnvironmentControlDelegate.exsd
deleted file mode 100755
index b3dd9c957..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/schema/remoteEnvironmentControlDelegate.exsd
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ptp.remotetools.environment.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ptp.remotetools.environment.core" id="remoteEnvironmentControlDelegate" name="Remote Environment Control Delegate"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="control" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="control">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.ptp.remotetools.environment.extension.ITargetTypeExtension"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 2.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/EnvironmentPlugin.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/EnvironmentPlugin.java
deleted file mode 100755
index 84bef3eaf..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/EnvironmentPlugin.java
+++ /dev/null
@@ -1,164 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment;
-
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-import org.eclipse.ptp.remotetools.environment.core.ChildrenProviderManager;
-import org.eclipse.ptp.remotetools.environment.core.ITargetElement;
-import org.eclipse.ptp.remotetools.environment.core.TargetEnvironmentManager;
-import org.eclipse.ptp.remotetools.environment.core.TargetTypeElement;
-import org.eclipse.ptp.remotetools.environment.extension.ITargetTypeExtension;
-import org.eclipse.ptp.utils.core.extensionpoints.IProcessMemberVisitor;
-import org.eclipse.ptp.utils.core.extensionpoints.ProcessExtensions;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * The main plugin class to be used in the desktop.
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public class EnvironmentPlugin extends Plugin {
-
- final public static String FILENAME = "environments.xml"; //$NON-NLS-1$
- final public static String EXT_CONTROLS_ID = "org.eclipse.ptp.remotetools.environment.core.remoteEnvironmentControlDelegate"; //$NON-NLS-1$
- final private static String ID = "org.eclipse.ptp.remotetools.environment.core"; //$NON-NLS-1$
-
- //The shared instance.
- private static EnvironmentPlugin plugin;
- private TargetEnvironmentManager manager;
- private ChildrenProviderManager childrenProviderMgr;
-
- /**
- * The constructor.
- */
- public EnvironmentPlugin() {
- plugin = this;
- }
-
- public Map<String, ITargetTypeExtension> getControls() {
- final Map<String, ITargetTypeExtension> controls = new HashMap<String, ITargetTypeExtension>();
- ProcessExtensions.process(EXT_CONTROLS_ID, new IProcessMemberVisitor() {
-
- public Object process(IExtension extension, IConfigurationElement member) {
- Object mprovider;
- try {
-
- mprovider = member.createExecutableExtension("class"); //$NON-NLS-1$
- if ( ITargetTypeExtension.class.isAssignableFrom(mprovider.getClass()) ) {
- controls.put(member.getAttribute("name"), (ITargetTypeExtension)mprovider); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- mprovider = null;
- }
-
- return mprovider;
- }
-
- });
- return controls;
- }
-
- public TargetEnvironmentManager getTargetsManager() {
- if (manager == null)
- manager = new TargetEnvironmentManager();
- return manager;
- }
-
- public ChildrenProviderManager getChildrenProviderManager() {
- if (childrenProviderMgr == null) {
- childrenProviderMgr = new ChildrenProviderManager();
- }
- return childrenProviderMgr;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- manager.writeToFile();
- plugin = null;
- }
-
- /**
- * Notifies all target elements of the plugin that includes
- * the parameter class. This parameter class must implement the
- * ITargetTypeExtension interface.
- *
- * @param Class The class that implements the ITargetTypeExtension interface
- */
- @SuppressWarnings("unchecked")
- public synchronized void destroyTypeElements(Class extensionClass) {
- // Find the TargetTypeElement that contains an extension which class is
- // equivalent to the argument.
- List<TargetTypeElement> typeList = getTargetsManager().getTypeElements();
- for (TargetTypeElement typeElement : typeList) {
- if(typeElement.getExtension().getClass().equals(extensionClass)) {
- // NOTE: At this point the called plugin should not be closed, so
- // its safe to play around with its values.
-
- // Call the destroy method of all elements of the given type
- List<ITargetElement> elemList = typeElement.getElements();
- for (ITargetElement el : elemList) {
- try { // Errors could happen when disabling the environment. Just ignore.
- ITargetControl ctl = el.getControl();
- ctl.destroy();
- } catch (Throwable t) { }
- }
- }
- }
- }
-
-
- /**
- * Returns the shared instance.
- */
- public static EnvironmentPlugin getDefault() {
- return plugin;
- }
-
- public static String getUniqueIdentifier() {
-
- return ID;
- }
-
- /*
- * Unique ID generation for environment instances
- * This ID is generation comes from the system's timestamp.
- */
- public String getEnvironmentUniqueID() {
- long envID = System.currentTimeMillis();
- return String.valueOf(envID);
- }
-
-// Key that address the unique identifier of a given environment instance
- public static final String ATTR_CORE_ENVIRONMENTID = "core-environmentid"; //$NON-NLS-1$
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControl.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControl.java
deleted file mode 100755
index 7bf210905..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControl.java
+++ /dev/null
@@ -1,117 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ptp.remotetools.core.IRemoteConnection;
-
-
-/**
- * Controls an instance of a target created from the Environment.
- * @author Ricardo M. Matinata, Daniel Felix Ferber, Richard Maciel
- * @since 1.1
- */
-public interface ITargetControl {
- /**
- * Called to create an instance of the target.
- * @param monitor
- * @return
- * @throws CoreException
- */
- public boolean create(IProgressMonitor monitor) throws CoreException;
-
- /**
- * Called to halt the instance of the target.
- * @param monitor
- * @return
- * @throws CoreException
- */
- public boolean kill(IProgressMonitor monitor) throws CoreException;
-
- /**
- * Called to remove information associated with the instance of the target
- * because the it was removed.
- * @throws CoreException
- */
- public void destroy() throws CoreException;
-
- public int query();
-
- public boolean resume(IProgressMonitor monitor) throws CoreException;
-
- public boolean stop(IProgressMonitor monitor) throws CoreException;
-
- /**
- * This method is a callback called when the ITargetControl implementing class
- * must update its configuration because an external change occurred.
- *
- * @throws CoreException
- */
- public void updateConfiguration() throws CoreException;
-
- /**
- * @deprecated
- */
- public boolean executeRemoteCommand(IProgressMonitor monitor, String command, String[] args) throws CoreException;
-
- /**
- * Gets the execution framework.
- * @deprecated
- * @return
- */
- public IRemoteConnection getConnection();
-
- /**
- * Adds a new job to the set of running jobs on the environment.
- * The job will begin execution as soon as possible after being added.
- * @param job The job to be added and executed.
- * @return The job encapsulated as a IRemoteControlledJob
- * @throws CoreException
- */
- public void startJob(ITargetJob job) throws CoreException;
-
- /**
- * Returns how many jobs are being managed by the control.
- */
- public int getJobCount();
-
- /**
- * Returns an array of all jobs running remotely.
- * All jobs are returned, regardless if WAITING or RUNNING.
- * Finished jobs are automatically removed from the list.
- *
- * @return The array of remote jobs.
- */
- public ITargetJob [] getJobs();
-
- public class TargetSocket {
- public String host;
- public int port;
- }
- /**
- * Create a bridge to a listening socket on the target environment.
- * @throws CoreException
- */
- public TargetSocket createTargetSocket(int port) throws CoreException;
-
- /**
- * Add a new job listener.
- */
- public void addJobListener(ITargetControlJobListener listener);
-
- /**
- * Remove a job listener.
- */
- public void removeJobListener(ITargetControlJobListener listener);
-} \ No newline at end of file
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventListener.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventListener.java
deleted file mode 100755
index bca71b10c..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventListener.java
+++ /dev/null
@@ -1,30 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-/**
- * Interface for target control event listeners.
- *
- * @author Ricardo M. Matinata
- * @since 1.2
- */
-public interface ITargetControlEventListener {
-
- /**
- * Notifies the listener that the state change event has occurred.
- *
- * @param event the event code as in {@link ITargetStatus}
- * @param from the originating control
- */
- public void handleStateChangeEvent(int event, ITargetControl from);
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventProvider.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventProvider.java
deleted file mode 100755
index 75e46f2a0..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlEventProvider.java
+++ /dev/null
@@ -1,41 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-/**
- *
- * Interface definition of event providers for Target Controls.
- * {@link ITargetControl} instances can optionally provide an implementation of this interface thru the
- * IAdaptable mechanism.
- *
- * @author Ricardo M. Matinata
- * @since 1.2
- */
-public interface ITargetControlEventProvider {
-
- /**
- * Registers a listener to the event provider, keyed by a control instance.
- *
- * @param control the control generating events
- * @param listener the interested listener
- */
- public void registerControlAndListener(ITargetControl control, ITargetControlEventListener listener);
-
- /**
- * Unregisters a control,listener tuple from this event provider
- *
- * @param control the control generating events
- * @param listener the interested listener
- */
- public void unregisterControlAndListener(ITargetControl control, ITargetControlEventListener listener);
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlJobListener.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlJobListener.java
deleted file mode 100755
index b31a01cd6..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetControlJobListener.java
+++ /dev/null
@@ -1,17 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.environment.control;
-
-public interface ITargetControlJobListener {
- public void beforeJobStart(ITargetJob job);
- public void afterJobFinish(ITargetJob job);
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetJob.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetJob.java
deleted file mode 100755
index 2affa1d9c..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetJob.java
+++ /dev/null
@@ -1,35 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-import org.eclipse.ptp.remotetools.core.IRemoteExecutionManager;
-
-/**
- * Describes a job that will run on a remote host.
- * <p>
- * Job is a collection of sequential operations executed using the IRemoteExecutionManager
- * on the target environment.
- * <p>
- * The ITargetJob be run as a thread inside the Job Controller.
- *
- * @author Daniel Felix Ferber
- * @since 1.1
- */
-public interface ITargetJob {
- /**
- * Implementation of the job.
- * <p>
- * The IRemoteExecutionManager that is capable of doing the operations
- * will be provided automatically.
- */
- void run(IRemoteExecutionManager manager);
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetStatus.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetStatus.java
deleted file mode 100755
index eadb1ad4b..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/ITargetStatus.java
+++ /dev/null
@@ -1,25 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-/**
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public interface ITargetStatus {
-
- final public static int STARTED = 0;
- final public static int STOPPED = 1;
- final public static int RESUMED = 2;
- final public static int PAUSED = 3;
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/PoolingTargetControlEventProvider.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/PoolingTargetControlEventProvider.java
deleted file mode 100755
index 866b8431f..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/PoolingTargetControlEventProvider.java
+++ /dev/null
@@ -1,146 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.ptp.remotetools.environment.control.ITargetControlEventListener;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControlEventProvider;
-import org.eclipse.ptp.remotetools.environment.core.messages.Messages;
-
-
-/**
- * Default implementation of the ITargetControlEventProvider interface, based
- * on a simple pooling algorithm.
- *
- * @author Ricardo M. Matinata
- * @since 1.2
- *
- */
-public class PoolingTargetControlEventProvider implements
- ITargetControlEventProvider {
-
- public Thread monitorThread = null;
- private int monitorInterval = 4000; // milliseconds
- private Map controls = new HashMap();
-
- class MonitorThread extends Thread {
-
- public MonitorThread() {
- super(Messages.PoolingTargetControlEventProvider_0);
- }
- public void run() {
- while (monitorThread == this)
- {
- synchronized (PoolingTargetControlEventProvider.this) {
- Iterator ctrls = controls.keySet().iterator();
-
- while(ctrls.hasNext()) {
-
- ITargetControl control = (ITargetControl) ctrls.next();
- int entryStatus = control.query();
- TargetInfo info = (TargetInfo) controls.get(control);
-
- if (entryStatus != info.getStatus() ) {
- info.setStatus(entryStatus);
- controls.put(control,info);
- fireEvent(entryStatus, control);
- }
-
- }
- }
-
- try {
- sleep (monitorInterval);
- } catch (InterruptedException e) {}
- }
- }
-
- }
-
- public void fireEvent(int status, ITargetControl control) {
-
- if (control != null && controls.containsKey (control))
- {
- TargetInfo info = (TargetInfo) controls.get(control);
- ITargetControlEventListener listener = info.getListener();
- listener.handleStateChangeEvent(status, control);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.control.ITargetControlEventProviderw#registerControlAndListener()
- */
- public void registerControlAndListener(ITargetControl control, ITargetControlEventListener listener) {
-
- if (control != null && !controls.containsKey (control))
- {
- synchronized(this) {
- controls.put (control, new TargetInfo(listener,ITargetStatus.STOPPED));
- }
-
- if (monitorThread == null) {
- (monitorThread = new MonitorThread()).start();
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.control.ITargetControlEventProviderw#unregisterControlAndListener()
- */
- public void unregisterControlAndListener(ITargetControl control, ITargetControlEventListener listener) {
-
- if (control != null && controls.containsKey (control))
- {
- synchronized(this) {
- controls.remove (control);
- }
-
- if (controls.size() == 0)
- monitorThread = null;
- }
-
- }
-
- class TargetInfo {
-
- private int status;
- private ITargetControlEventListener listener;
-
- public TargetInfo(ITargetControlEventListener listener, int status) {
- this.listener = listener;
- this.status = status;
- }
-
- public ITargetControlEventListener getListener() {
- return listener;
- }
-
- public void setListener(ITargetControlEventListener listener) {
- this.listener = listener;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- }
-
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/SSHTargetControl.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/SSHTargetControl.java
deleted file mode 100755
index 30e4c5945..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/SSHTargetControl.java
+++ /dev/null
@@ -1,463 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ptp.remotetools.RemotetoolsPlugin;
-import org.eclipse.ptp.remotetools.core.AuthToken;
-import org.eclipse.ptp.remotetools.core.IRemoteConnection;
-import org.eclipse.ptp.remotetools.core.IRemoteExecutionManager;
-import org.eclipse.ptp.remotetools.core.KeyAuthToken;
-import org.eclipse.ptp.remotetools.core.PasswdAuthToken;
-import org.eclipse.ptp.remotetools.environment.core.messages.Messages;
-import org.eclipse.ptp.remotetools.exception.CancelException;
-import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
-import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;
-
-/**
- * Standard implementation of <code>IRemoteJobController</code>. Presumes a
- * target environment that accepts SSH connections.
- *
- * @see ITargetJobController
- * @author Daniel Felix Ferber
- * @since 1.2
- */
-public abstract class SSHTargetControl implements ITargetControl {
-
- /**
- * Set of jobs running on the remote target environment.
- */
- private final Map<ITargetJob, TargetControlledJob> remoteJobs = new HashMap<ITargetJob, TargetControlledJob>();
-
- /**
- * A connection (using ssh) to the remote target environment.
- */
- private IRemoteConnection remoteConnection = null;
-
- /**
- * Listeners notified when jobs ared added/removed from the target
- * environment.
- */
- private final Set<ITargetControlJobListener> jobListeners = new HashSet<ITargetControlJobListener>();
-
- /**
- * Exception to terminate the environment.
- */
- private CoreException pendingException = null;
-
- /**
- * Return a map containing the available cipher types ids and their
- * respective names
- *
- * @return a Map object containing cipher type ids and cipher type names
- */
- public static Map getCipherTypesMap() {
- // This method decouples the map from the RemotetoolsPlugin
- // so its safe to use it on the interface of each environment
- // that uses this plugin.
-
- HashMap cipherTypesMap = new HashMap(RemotetoolsPlugin.getCipherTypesMap());
-
- return cipherTypesMap;
- }
-
- /**
- * A set of parameters used for authentication with SSH.
- *
- * @author Daniel Felix Ferber
- * @since 1.2
- */
- protected class SSHParameters {
- public String hostname;
- public int port;
- public String user;
- public String password;
- public String keyPath;
- public String passphrase;
- public boolean isPasswdAuth;
- public String cipherType;
- public int timeout = 0;
-
- /**
- * Constructor for password based authentication and assuming timeout =
- * 0
- *
- * @param hostname
- * @param port
- * @param user
- * @param password
- */
- public SSHParameters(String hostname, int port, String user, String password) {
- this(hostname, port, user, password, RemotetoolsPlugin.CIPHER_DEFAULT, 0);
- }
-
- /**
- * Constructor for password based authentication
- *
- * @param hostname
- * @param port
- * @param user
- * @param password
- * @param cipherType
- * Choose among the supported ciphers
- * @param timeout
- */
- public SSHParameters(String hostname, int port, String user, String password, String cipherType, int timeout) {
- super();
- this.hostname = hostname;
- this.port = port;
- this.user = user;
- this.password = password;
- this.timeout = timeout;
- this.cipherType = cipherType;
- isPasswdAuth = true;
- }
-
- /**
- * Constructor for public/private key based authentication
- *
- * @param hostname
- * @param port
- * @param user
- * @param password
- * @param cipherType
- * Choose among the supported ciphers
- * @param timeout
- */
- public SSHParameters(String hostname, int port, String user, String keyPath, String passphrase, String cipherType,
- int timeout) {
- super();
- this.hostname = hostname;
- this.port = port;
- this.user = user;
- this.keyPath = keyPath;
- this.passphrase = passphrase;
- this.timeout = timeout;
- this.cipherType = cipherType;
- isPasswdAuth = false;
- }
-
- /**
- * Constructor for public/private key based authentication assuming
- * timeout = 0
- *
- * @param hostname
- * @param port
- * @param user
- * @param password
- */
- public SSHParameters(String hostname, int port, String user, String keyPath, String passphrase) {
- this(hostname, port, user, keyPath, passphrase, RemotetoolsPlugin.CIPHER_DEFAULT, 0);
- }
- }
-
- /**
- * The parameters used by the connection to the remote target environment.
- */
- SSHParameters sshParameters;
-
- /**
- * Facility method that raises a SimulatorException with the last error
- * detected from and observing thread.
- *
- * @throws SimulatorException
- */
- protected synchronized void throwPendingException() throws CoreException {
- if (pendingException != null) {
- throw pendingException;
- }
- }
-
- protected synchronized void notifyException(CoreException e) {
- pendingException = e;
- }
-
- /**
- * Add a new job listener.
- */
- public synchronized void addJobListener(ITargetControlJobListener listener) {
- jobListeners.add(listener);
- }
-
- /**
- * Remove a job listener.
- */
- public synchronized void removeJobListener(ITargetControlJobListener listener) {
- jobListeners.remove(listener);
- }
-
- /**
- * Create a waiting job on the
- */
- public synchronized void startJob(ITargetJob job) throws CoreException {
- if ((query() != ITargetStatus.PAUSED) && (query() != ITargetStatus.RESUMED)) {
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, Messages.SSHTargetControl_0, null));
- }
- TargetControlledJob controlledJob = new TargetControlledJob(this, job);
- remoteJobs.put(job, controlledJob);
- controlledJob.start();
- }
-
- protected synchronized void notifyStartingJob(ITargetJob job) {
- /** Notify listeners. */
- for (ITargetControlJobListener listener : jobListeners) {
- listener.beforeJobStart(job);
- }
- /** Guarantee that the target is operational. */
- try {
- resume(null);
- } catch (CoreException e) {
- // Ignore
- }
- }
-
- protected synchronized void notifyFinishedJob(ITargetJob job) {
- /** Notify listeners. */
- for (ITargetControlJobListener listener : jobListeners) {
- listener.afterJobFinish(job);
- }
- /** Remove job from list of jobs. */
- remoteJobs.remove(job);
- }
-
- /**
- * Returns the number of jobs running on the remote host.
- */
- public synchronized int getJobCount() {
- return remoteJobs.size();
- }
-
- /**
- * Returns a list of jobs running on the remote target environment.
- */
- public synchronized ITargetJob[] getJobs() {
- ITargetJob[] array = new ITargetJob[remoteJobs.size()];
- remoteJobs.keySet().toArray(array);
- return array;
- }
-
- /**
- * Set the connection parameters to be used by
- * {@link #create(IProgressMonitor)}.
- *
- * @param parameters
- */
- protected synchronized void setConnectionParameters(SSHParameters parameters) {
- this.sshParameters = parameters;
- }
-
- /**
- * Create the remote target environment by opening a SSH connection to it.
- * First,
- * {@link #setConnectionParameters(org.eclipse.ptp.remotetools.environment.control.SSHTargetControl.SSHParameters)
- * must be called.
- */
- public boolean create(IProgressMonitor monitor) throws CoreException {
- Assert.isNotNull(sshParameters, "missing ssh parameters"); //$NON-NLS-1$
- try {
- if (monitor.isCanceled()) {
- disconnect();
- throw new CoreException(new Status(IStatus.CANCEL, getPluginId(), 0, Messages.SSHTargetControl_1, null));
- }
- kill(monitor);
- connect(monitor);
- if (monitor.isCanceled()) {
- disconnect();
- throw new CoreException(new Status(IStatus.CANCEL, getPluginId(), 0, Messages.SSHTargetControl_1, null));
- }
- return true;
- } catch (RemoteConnectionException e) {
- disconnect();
- String message = e.getMessage();
- Throwable t = e.getCause();
- if (t != null) {
- message += ": " + t.getMessage(); //$NON-NLS-1$
- }
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), message));
- }
- }
-
- /**
- * Create the SSH connection to the remote target environment. First,
- * {@link #setConnectionParameters(org.eclipse.ptp.remotetools.environment.control.SSHTargetControl.SSHParameters)}
- * must be called.
- *
- * @param monitor
- * progress monitor
- * @throws RemoteConnectionException
- */
- protected synchronized void connect(IProgressMonitor monitor) throws RemoteConnectionException {
- Assert.isNotNull(sshParameters, "missing ssh parameters"); //$NON-NLS-1$
- /*
- * Try to connect, else undo the connection.
- */
- AuthToken authToken;
- if (sshParameters.isPasswdAuth) {
- authToken = new PasswdAuthToken(sshParameters.user, sshParameters.password);
- } else {
- authToken = new KeyAuthToken(sshParameters.user, new File(sshParameters.keyPath), sshParameters.passphrase);
- }
-
- if (remoteConnection == null) {
- remoteConnection = RemotetoolsPlugin.createSSHConnection();
- }
- try {
- remoteConnection.connect(authToken, sshParameters.hostname, sshParameters.port, sshParameters.cipherType,
- sshParameters.timeout, monitor);
- } catch (RemoteConnectionException e) {
- disconnect();
- throw e;
- }
- }
-
- /**
- * Returns the plugin ID.
- *
- * @return
- */
- protected abstract String getPluginId();
-
- /**
- * Destroy the remote target environment, by closing the SSH connection to
- * it.
- */
- public boolean kill(IProgressMonitor monitor) throws CoreException {
- /*
- * Try to gracefully terminate all running jobs. Might this fail, then
- * guarantee to disconnect.
- */
- try {
- terminateJobs(monitor);
- } finally {
- disconnect();
- }
- return true;
- }
-
- public boolean executeRemoteCommand(IProgressMonitor monitor, String command, String[] args) throws CoreException {
- if (remoteConnection == null) {
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), Messages.SSHTargetControl_5, null));
- }
-
- for (int i = 0; i < args.length; i++) {
- command += (" " + args[i]); //$NON-NLS-1$
- }
-
- try {
- IRemoteExecutionManager executionManager = remoteConnection.createRemoteExecutionManager();
- executionManager.getExecutionTools().executeWithExitValue(command);
- executionManager.close();
- return true;
- } catch (RemoteConnectionException e) {
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, Messages.SSHTargetControl_2, e));
- } catch (CancelException e) {
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, Messages.SSHTargetControl_3, e));
- } catch (RemoteExecutionException e) {
- throw new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, Messages.SSHTargetControl_4, e));
- }
- }
-
- /**
- * Informs how to connect to a socket that is being listened on the remote
- * target environment. If necessary, create a tunnel that forwards the
- * remote port.
- *
- * @return A {@link TargetSocket} object that encapsulates information where
- * to connect in order to connect to the remote tunnel.
- */
- public TargetSocket createTargetSocket(int port) throws CoreException {
- /*
- * Dummy implementation that assumes that the remote port is mapped to
- * the same local port.
- */
- TargetSocket test = new TargetSocket();
- test.host = "localhost"; //$NON-NLS-1$
- test.port = port;
- return test;
- }
-
- /**
- * Checks if the connection to the remote target environment is alive.
- *
- * @return
- */
- protected boolean isConnected() {
- return (remoteConnection != null) && (remoteConnection.isConnected());
- }
-
- protected synchronized void terminateJobs(IProgressMonitor monitor) {
- /*
- * Issue each job to terminate gracefully.
- */
- for (ITargetJob job : remoteJobs.keySet()) {
- TargetControlledJob controlledJob = remoteJobs.get(job);
- controlledJob.cancelExecution();
- }
-
- /*
- * Wait until all jobs have terminated.
- */
- while (getJobCount() > 0) {
- try {
- wait(500);
- } catch (InterruptedException e) {
- return;
- }
- if (monitor != null) {
- if (monitor.isCanceled()) {
- return;
- }
- }
- }
- }
-
- /**
- * Guarantees that the connection to the remote host is closed and releases
- * ressources allocated to the connection.
- */
- protected synchronized void disconnect() {
- /*
- * Any still running jobs will fail.
- */
- remoteJobs.clear();
- if (remoteConnection != null) {
- remoteConnection.disconnect();
- }
- }
-
- /**
- * Create a remote execution manager that may be used to do operations on
- * the remote target environment.
- *
- * @return
- * @throws RemoteConnectionException
- */
- protected IRemoteExecutionManager createRemoteExecutionManager() throws RemoteConnectionException {
- return remoteConnection.createRemoteExecutionManager();
- }
-
- public IRemoteConnection getConnection() {
- Assert.isTrue(false, "this method is not supported"); //$NON-NLS-1$
- return remoteConnection;
- }
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/TargetControlledJob.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/TargetControlledJob.java
deleted file mode 100755
index e1f694927..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/control/TargetControlledJob.java
+++ /dev/null
@@ -1,95 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.control;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ptp.remotetools.core.IRemoteExecutionManager;
-import org.eclipse.ptp.remotetools.environment.EnvironmentPlugin;
-import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
-
-
-/**
- * Standard implementation of <code>ITargetControlledJob</code>.
- * @see ITargetControlledJob
- * @author Daniel Felix Ferber
- * @since 1.2
- */
-class TargetControlledJob {
-
- protected static final int UNDEFINED = 0;
- protected static final int RUNNING = 1;
- protected static final int FINISHED = 2;
-
- JobRunner jobRunner;
- IRemoteExecutionManager executionManager;
- ITargetJob job;
- SSHTargetControl targetControl;
- int status = UNDEFINED;
-
- public TargetControlledJob(SSHTargetControl controller, ITargetJob job) throws CoreException {
- super();
- this.targetControl = controller;
- this.job = job;
- try {
- this.executionManager = controller.createRemoteExecutionManager();
- } catch (RemoteConnectionException e) {
- CoreException ce = new CoreException(new Status(IStatus.ERROR,
- EnvironmentPlugin.getUniqueIdentifier(), 0, e
- .getLocalizedMessage(), e));
- throw ce;
- }
- this.jobRunner = new JobRunner(this);
- }
-
- protected void start() {
- jobRunner.start();
- }
-
- protected class JobRunner extends Thread {
- private TargetControlledJob controller;
-
- protected JobRunner(TargetControlledJob controller) {
- this.controller = controller;
- }
- public void run() {
- controller.targetControl.notifyStartingJob(job);
- synchronized (controller) {
- controller.status = RUNNING;
- }
- try {
- job.run(controller.executionManager);
- } finally {
- synchronized (controller) {
- controller.status = FINISHED;
- controller.executionManager.close();
- controller.targetControl.notifyFinishedJob(job);
- }
- }
- }
- }
-
- public ITargetJob getJob() {
- return job;
- }
-
- public synchronized boolean isFinished() {
- return status == FINISHED;
- }
-
- public synchronized void cancelExecution() {
- if (status != FINISHED) {
- executionManager.cancel();
- }
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ChildrenProviderManager.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ChildrenProviderManager.java
deleted file mode 100644
index 8a4777726..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ChildrenProviderManager.java
+++ /dev/null
@@ -1,76 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.ptp.remotetools.environment.extension.IChildrenProvider;
-import org.eclipse.ptp.remotetools.environment.extension.INode;
-import org.eclipse.ptp.utils.core.extensionpoints.IProcessMemberVisitor;
-import org.eclipse.ptp.utils.core.extensionpoints.ProcessExtensions;
-
-/**
- * Manage a list of <code>IChildrenProvider</code> contributed by extensions
- *
- * @author Hong Chang Lin
- *
- */
-public class ChildrenProviderManager {
-
- private final static String EXT_PROVIDER_ID = "org.eclipse.ptp.remotetools.environment.core.childrenProvider"; //$NON-NLS-1$
-
- private List<IChildrenProvider> providers;
-
- public ChildrenProviderManager() {
- processChildrenProviders();
- }
-
- public INode[] getChildren(ITargetElement targetElement) {
- List<INode> children = new ArrayList<INode>();
- for (IChildrenProvider provider : providers) {
- INode[] objs = provider.getChildren(targetElement);
- for (int i = 0; i < objs.length; i++) {
- children.add(objs[i]);
- }
- }
-
- return children.toArray(new INode[0]);
- }
-
- private void processChildrenProviders() {
- providers = new ArrayList<IChildrenProvider>();
- ProcessExtensions.process(EXT_PROVIDER_ID, new IProcessMemberVisitor() {
-
- public Object process(IExtension extension,
- IConfigurationElement member) {
- Object mprovider;
- try {
-
- mprovider = member.createExecutableExtension("class"); //$NON-NLS-1$
- if (IChildrenProvider.class.isAssignableFrom(mprovider
- .getClass())) {
- providers.add((IChildrenProvider) mprovider); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- mprovider = null;
- }
-
- return mprovider;
- }
-
- });
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElement.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElement.java
deleted file mode 100755
index abcf2df0f..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElement.java
+++ /dev/null
@@ -1,40 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-
-
-public interface ITargetElement {
-
- public abstract Map<String, String> getAttributes();
-
- public abstract void setAttributes(Map<String, String> attributes);
-
- public abstract String getName();
-
- public abstract void setName(String name);
-
- public abstract ITargetControl getControl() throws CoreException;
-
- public abstract TargetTypeElement getType();
-
- public abstract int getStatus();
-
- public abstract String toString();
-
- public abstract String getId();
-
-} \ No newline at end of file
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElementStatus.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElementStatus.java
deleted file mode 100755
index 5f2ae1b3c..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetElementStatus.java
+++ /dev/null
@@ -1,43 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-/**
- * External status code definition for target generated events.
- *
- * @author Ricardo M. Matinata, Richard Maciel
- * @since 1.1
- */
-public interface ITargetElementStatus {
-
- /**
- * The element has been successfully configured and is available (conected)
- * to the host machine.
- */
- final public static int STARTED = 0;
-
- /**
- * The element is not conected to the host machine
- */
- final public static int STOPPED = 1;
-
- /**
- * The element is in a state that allows applications to be run in it.
- */
- final public static int RESUMED = 2;
-
- /**
- * The element is in a state that does not allow applications to be run in it,
- * although is conected (live) to the host machine.
- */
- final public static int PAUSED = 3;
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEnvironmentEventListener.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEnvironmentEventListener.java
deleted file mode 100755
index 070694a97..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEnvironmentEventListener.java
+++ /dev/null
@@ -1,46 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-/**
- * Interface definition for targets' changes listerners.
- * Two kinds of events can occur:
- * <ul>
- * <il> Add: Element was added to the pool of targets
- * <il> Remove: Element was removed from the pool of targets
- * </ul>
- *
- * @author Ricardo M. Matinata, Richard Maciel
- * @since 1.2
- *
- */
-public interface ITargetEnvironmentEventListener {
-
- public static int ADDED = 0;
-
- public static int REMOVED = 1;
-
- /**
- * Notifies that an element has just been added to the model
- *
- * @param element the added element
- */
- public void elementAdded(TargetElement element);
-
- /**
- * Notifies that an element has just been removed from the model
- *
- * @param element the lement being removed
- */
- public void elementRemoved(ITargetElement element);
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEventListener.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEventListener.java
deleted file mode 100755
index e92b298fd..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/ITargetEventListener.java
+++ /dev/null
@@ -1,31 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-/**
- * Interface definition for targets' event listeners.
- * Events are fired when a target state changes.
- *
- * @author Ricardo M. Matinata, Richard Maciel
- * @since 1.1
- */
-public interface ITargetEventListener {
-
- /**
- * Notifies the listener that the event has occured.
- *
- * @param event the event code as in org.eclipse.ptp.remotetools.environment.model.ITargetElementStatus
- * @param from the originating target element
- */
- void handleStateChangeEvent(int event, ITargetElement from);
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetElement.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetElement.java
deleted file mode 100755
index 0401d2984..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetElement.java
+++ /dev/null
@@ -1,152 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-import org.eclipse.ptp.remotetools.environment.control.ITargetStatus;
-
-
-/**
- *
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public class TargetElement implements ITargetElement {
-
- private TargetTypeElement type;
- private Map<String, String> attributes;
- private String name;
- private String id;
- private ITargetControl control;
- private int status = ITargetStatus.STOPPED;
- private boolean dirty = false;
-
- public TargetElement(TargetTypeElement type, String id) {
- super();
- this.type = type;
- this.id = id;
- }
-
- public TargetElement(TargetTypeElement type, String name, Map<String, String> attrs, String id) {
- this(type, id);
- this.attributes = attrs;
- this.name = name;
- this.type = type;
- }
-
- public void update(Map<String, String> attr) {
- try {
- ITargetControl ctrl = getControl();
- if (attr == null) {
- ctrl.updateConfiguration();
- } else {
- ctrl.updateConfiguration();
- }
- dirty = false;
- } catch (CoreException e) {
- dirty = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getAttributes()
- */
- public Map<String, String> getAttributes() {
- return attributes;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#setAttributes(java.util.Map)
- */
- public void setAttributes(Map<String, String> attributes) {
- this.attributes = attributes;
- if (getStatus() == ITargetStatus.STOPPED) {
- update(attributes);
- } else
- dirty = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getName()
- */
- public String getName() {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#setName(java.lang.String)
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getControl()
- */
- public ITargetControl getControl() throws CoreException {
- if (control == null) {
- control = type.getExtension().controlFactory(this);
- }
- return control;
- }
-
- public void setControl(ITargetControl control) {
- this.control = control;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getType()
- */
- public TargetTypeElement getType() {
- return type;
- }
-
- public void setType(TargetTypeElement type) {
- this.type = type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getStatus()
- */
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- if (status == ITargetStatus.STOPPED && dirty) {
- update(getAttributes());
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#toString()
- */
- public String toString() {
-
- return this.getName() != null ? this.getName() : super.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ptp.remotetools.environment.core.ITargetElement#getId()
- */
- public String getId() {
- return id;
- }
-
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentEventManager.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentEventManager.java
deleted file mode 100755
index 6d70dc2cb..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentEventManager.java
+++ /dev/null
@@ -1,127 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControlEventListener;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControlEventProvider;
-import org.eclipse.ptp.remotetools.environment.control.PoolingTargetControlEventProvider;
-
-
-/**
- * Manager class to support different event provider per each
- * target control instance.
- *
- * @author Ricardo M. Matinata
- * @since 1.2
- *
- */
-public class TargetEnvironmentEventManager implements ITargetControlEventListener, ITargetEnvironmentEventListener {
-
- private TargetEnvironmentManager model = null;
- private ITargetControlEventProvider defaultProvider = new PoolingTargetControlEventProvider();
- private Map controls = new HashMap();
-
- /**
- * Constructor
- */
- public TargetEnvironmentEventManager(TargetEnvironmentManager model) {
- this.model = model;
- model.addModelChangedListener(this);
- }
-
-
- public void handleStateChangeEvent(int event, ITargetControl from) {
-
- ControlInfo info = (ControlInfo) controls.get(from);
- model.fireElementEvent(event, info.getElement());
-
- }
-
- public void elementAdded(TargetElement element) {
-
- try {
- ITargetControl control = element.getControl();
- ITargetControlEventProvider provider = null;
-
- if(IAdaptable.class.isAssignableFrom(control.getClass())) {
- provider = (ITargetControlEventProvider) ((IAdaptable)control).getAdapter(ITargetControlEventProvider.class);
- }
-
- if (provider == null) {
- provider = defaultProvider;
- }
-
- controls.put(control, new ControlInfo(element,provider));
- provider.registerControlAndListener(control,this);
-
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- }
-
-
- public void elementRemoved(ITargetElement element) {
-
- try {
-
- ITargetControl control = element.getControl();
- ControlInfo info = (ControlInfo) controls.get(control);
- ITargetControlEventProvider provider = info.getProvider();
- provider.unregisterControlAndListener(control,this);
- controls.remove(control);
-
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- class ControlInfo {
-
- private TargetElement element;
- private ITargetControlEventProvider provider;
-
- public ControlInfo(TargetElement element, ITargetControlEventProvider provider) {
- this.element = element;
- this.provider = provider;
- }
-
- public TargetElement getElement() {
- return element;
- }
-
- public void setElement(TargetElement element) {
- this.element = element;
- }
-
- public ITargetControlEventProvider getProvider() {
- return provider;
- }
-
- public void setProvider(ITargetControlEventProvider provider) {
- this.provider = provider;
- }
-
- }
-
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentManager.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentManager.java
deleted file mode 100755
index 9e12b4e18..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetEnvironmentManager.java
+++ /dev/null
@@ -1,396 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.equinox.security.storage.ISecurePreferences;
-import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
-import org.eclipse.equinox.security.storage.StorageException;
-import org.eclipse.ptp.remotetools.environment.EnvironmentPlugin;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-import org.eclipse.ptp.remotetools.environment.control.ITargetStatus;
-import org.eclipse.ptp.remotetools.environment.extension.ITargetTypeExtension;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-
-/**
- * Class responsible for managing all Targets available. Its managing tasks consist on:
- * <ul>
- * <li> Read/write targets information from/to disk (sensitive data is written to a secure container)
- * <li> Keep a list of all target types elements based on extension point information. Each target type can reference a list of target elements
- * <li> Insert/remove listeners for targets events.
- * <li> Fire events for the listeners
- * <li> Provides getters for configs
- *
- * @author Ricardo M. Matinata, Richard Maciel
- * @since 1.1
- */
-public class TargetEnvironmentManager {
-
- private static String ENVIRONMENTS = "Environments"; //$NON-NLS-1$
- private static String ENVIRONMENTS_TYPE = "Type"; //$NON-NLS-1$
- private static String ENVIRONMENTS_TYPE_NAME = "Name"; //$NON-NLS-1$
- private static String ENVIRONMENTS_TYPE_CONFIG = "Configuration"; //$NON-NLS-1$
- private static String ENVIRONMENTS_TYPE_CONFIG_NAME = "CfgName"; //$NON-NLS-1$
-
- private List<TargetTypeElement> targetTypeElements = new ArrayList<TargetTypeElement>();
- private ListenerList eventListeners = new ListenerList();
- private ListenerList modelChangedListeners = new ListenerList();
-
- private Map<String, Set<String>> storedCypherEnvToKeyMap;
-
-
- public TargetEnvironmentManager() {
-
- super();
-
- new TargetEnvironmentEventManager(this);
-
- Map<String, ITargetTypeExtension> targets = EnvironmentPlugin.getDefault().getControls();
- ISecurePreferences cypherEnvTypeMap = SecurePreferencesFactory.getDefault();
-
- // Create a map that contains (environment type name, cipher key set) tuples
- storedCypherEnvToKeyMap = new HashMap<String, Set<String>>();
-
- File file = EnvironmentPlugin.getDefault().getStateLocation().append(EnvironmentPlugin.FILENAME).toFile();
- if (file.exists()) {
- try {
- FileReader reader = new FileReader(file);
- XMLMemento memento = XMLMemento.createReadRoot(reader);
- targets = initContentFromFile(memento, targets, cypherEnvTypeMap);
- } catch (FileNotFoundException e) {
- throw new RuntimeException(e);
- } catch (WorkbenchException e) {
- throw new RuntimeException(e);
- }
- }
-
- Set<String> cipherKeySet = new HashSet<String>();
- for (String name : targets.keySet()) {
- ITargetTypeExtension env = targets.get(name);
- targetTypeElements.add(new TargetTypeElement(name,env,this));
-
- // Also save the ciphered key names
- // Get cryptographed keys
- String [] controlKeysCypher = env.getControlAttributeNamesForCipheredKeys();
-
- // Add all key names to the set
- if(controlKeysCypher != null) {
- List<String> keyList = Arrays.asList(controlKeysCypher);
- cipherKeySet.addAll(keyList);
- }
-
-// Add set to the map (save it)
- storedCypherEnvToKeyMap.put(name, cipherKeySet);
- }
-
- }
-
- public Map<String, ITargetTypeExtension> initContentFromFile(XMLMemento memento,
- Map<String, ITargetTypeExtension> targets, ISecurePreferences cypherEnvTypeMap) {
-
- IMemento[] children = memento.getChildren(ENVIRONMENTS_TYPE);
- for (int i = 0; i < children.length; i++) {
- String name = children[i].getString(ENVIRONMENTS_TYPE_NAME);
- ITargetTypeExtension env = targets.get(name);
- // Get config name map from the given type name.
- ISecurePreferences cypherConfigNameMap = null;
- // Set null if the parent map is null.
- if(cypherEnvTypeMap != null) cypherConfigNameMap = cypherEnvTypeMap.node(name);
- if (env != null) {
-// Create cipher key set that will contain the name of the keys that are ciphered
- Set<String> cipherKeySet = new HashSet<String>();
-
-// Get cryptographed keys
- String [] controlKeysCypher = env.getControlAttributeNamesForCipheredKeys();
-
- // Add all key names to the set
- if(controlKeysCypher != null) {
- List<String> keyList = Arrays.asList(controlKeysCypher);
- cipherKeySet.addAll(keyList);
- }
-
-// Add set to the map
- storedCypherEnvToKeyMap.put(name, cipherKeySet);
-
- TargetTypeElement typeElement = new TargetTypeElement(name,env,this);
- IMemento[] childrenElements = children[i].getChildren(ENVIRONMENTS_TYPE_CONFIG);
- for (int j = 0; j < childrenElements.length; j++) {
- String nameElement = childrenElements[j].getString(ENVIRONMENTS_TYPE_CONFIG_NAME);
-
- Map<String,String> attrsElement = new HashMap<String,String>();
- String[] controlKeys = env.getControlAttributeNames();
- for (int k = 0; k < controlKeys.length; k++) {
- attrsElement.put(controlKeys[k],childrenElements[j].getString(controlKeys[k]));
- }
-
- // Get password key map from the given configuration name
- ISecurePreferences cypherPasswdKeyMap = null;
- // Set null if the parent map is null
- if(cypherConfigNameMap != null) cypherPasswdKeyMap = cypherConfigNameMap.node(nameElement);
-
- if(controlKeysCypher != null) {
- for(int k=0; k < controlKeysCypher.length; k++) {
- // Insert into key into the hash set to f
- // Get the passwords or set them to empty string, if map not available.
- if(cypherPasswdKeyMap == null) {
- attrsElement.put(controlKeysCypher[k], ""); //$NON-NLS-1$
- } else {
- try {
- attrsElement.put(controlKeysCypher[k], cypherPasswdKeyMap.get(controlKeysCypher[k], "")); //$NON-NLS-1$
- } catch (StorageException e) {
- attrsElement.put(controlKeysCypher[k], ""); //$NON-NLS-1$
- }
- }
- // Include key name in the set
- cipherKeySet.add(controlKeysCypher[k]);
- }
- }
-
- // Finally insert the identifier of the environment
- // Create it, if necessary.
- String id;
- if(childrenElements[j].getString(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID) == null) {
- id = EnvironmentPlugin.getDefault().getEnvironmentUniqueID();
- /*attrsElement.put(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID,
- EnvironmentPlugin.getDefault().getEnvironmentUniqueID());*/
- } else {
- id = childrenElements[j].getString(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID);
- /*attrsElement.put(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID,
- childrenElements[j].getString(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID));*/
- }
-
- typeElement.addElement(new TargetElement(typeElement,nameElement,attrsElement, id));
- }
-
- targetTypeElements.add(typeElement);
- targets.remove(name);
- }
- }
-
- return targets;
-
- }
-
- public void writeToFile() throws StorageException {
-
- // Create new ciphered Environment type map
- ISecurePreferences cypherEnvTypeMap = SecurePreferencesFactory.getDefault();
-
- File file = EnvironmentPlugin.getDefault().getStateLocation().append(EnvironmentPlugin.FILENAME).toFile();
- XMLMemento memento = XMLMemento.createWriteRoot(ENVIRONMENTS);
- for (TargetTypeElement type : targetTypeElements) {
- IMemento typeMemento = memento.createChild(ENVIRONMENTS_TYPE);
- typeMemento.putString(ENVIRONMENTS_TYPE_NAME, type.getName());
-
- // Create new ciphered configuration map
- ISecurePreferences cypherConfigNameMap = cypherEnvTypeMap.node(type.getName());
-
- // Get set of ciphered keys for this environment type name
- Set<String> cypherKeySet = storedCypherEnvToKeyMap.get(type.getName());
-
- for (ITargetElement element : type.getElements()) {
- IMemento elementMemento = typeMemento.createChild(ENVIRONMENTS_TYPE_CONFIG);
- elementMemento.putString(ENVIRONMENTS_TYPE_CONFIG_NAME,element.getName());
-
- Map<String, String> elementAttr = element.getAttributes();
-
- // Create new ciphered password key map
- ISecurePreferences cypherPasswdKeyMap = cypherConfigNameMap.node(element.getName());
-
- for (String key : elementAttr.keySet()) {
- // If is ciphered put it as a value to the ciphered password key map
- if(cypherKeySet.contains(key)) {
- cypherPasswdKeyMap.put(key, (String) elementAttr.get(key), true);
- } else {
- elementMemento.putString(key,(String) elementAttr.get(key));
- }
- }
-
- // Save the Target id from the Target Element.
- elementMemento.putString(EnvironmentPlugin.ATTR_CORE_ENVIRONMENTID,
- element.getId());
-
- }
- }
-
- Writer writer;
- try {
- writer = new FileWriter(file);
- memento.save(writer);
- } catch (IOException e) {
- // This should not happen. Throw a runtime exception
- throw new RuntimeException(e);
- }
-
- }
-
- public List<TargetTypeElement> getTypeElements() {
- return targetTypeElements;
- }
-
- public synchronized ITargetElement[] getConfigElements() {
- List<ITargetElement> rsp = new ArrayList<ITargetElement>();
- for (TargetTypeElement element : targetTypeElements) {
- rsp.addAll( element.getElements() );
- }
-
- ITargetElement[] rspObj = null;
-
- if (rsp.size() > 0) {
- rspObj = (ITargetElement[])rsp.toArray(new ITargetElement[]{});
- }
- return rspObj;
-
- }
-
- /**
- * Registers a model event listener. If the listener argument is null or already registered, this
- * method has no effect.
- */
-
- public synchronized void addModelEventListener (ITargetEventListener listener)
- {
- if (listener != null)
- {
- eventListeners.add (listener);
- }
- }
-
- /**
- * De-registers a model event listener. If the listener argument is null or not already registered, this
- * method has no effect.
- */
-
- public synchronized void removeModelEventListener (ITargetEventListener listener)
- {
- if (listener != null)
- {
- eventListeners.remove (listener);
- }
- }
-
- /**
- * Registers a model changed listener. If the listener argument is null or already registered, this
- * method has no effect.
- */
-
- public synchronized void addModelChangedListener (ITargetEnvironmentEventListener listener)
- {
- if (listener != null)
- {
- modelChangedListeners.add (listener);
- }
- }
-
- /**
- * De-registers a model changed listener. If the listener argument is null or not already registered, this
- * method has no effect.
- */
-
- public synchronized void removeModelChangedListener (ITargetEnvironmentEventListener listener)
- {
- if (listener != null)
- {
- modelChangedListeners.remove (listener);
- }
- }
-
- public void fireModelChanged(int action,ITargetElement oldElement,TargetElement newElement) {
-
- if (oldElement == null && newElement != null) {
- for (Object listener : modelChangedListeners.getListeners()) {
- ((ITargetEnvironmentEventListener)listener).elementAdded(newElement);
- }
- } else if (oldElement != null && newElement == null) {
- for (Object listener : modelChangedListeners.getListeners()) {
- ((ITargetEnvironmentEventListener)listener).elementRemoved(oldElement);
- }
- }
-
- }
-
- public synchronized void fireElementEvent(int event,TargetElement element) {
-
- int status = ITargetElementStatus.STOPPED;
- switch (event) {
- case ITargetStatus.STARTED:
- status = ITargetElementStatus.STARTED;
- break;
- case ITargetStatus.STOPPED:
- status = ITargetElementStatus.STOPPED;
- break;
- case ITargetStatus.RESUMED:
- status = ITargetElementStatus.RESUMED;
- break;
- case ITargetStatus.PAUSED:
- status = ITargetElementStatus.PAUSED;
- break;
- }
- element.setStatus(status);
-
- for (Object listener : eventListeners.getListeners()) {
- ((ITargetEventListener)listener).handleStateChangeEvent(status, element);
- }
- }
-
- // Implementation of methods from the ITargetProvider
-
- public ITargetControl selectControl(String id) {
- ITargetElement[] elements = getConfigElements();
- if (elements != null) {
- for (int i = 0; i < elements.length; i++)
- {
- ITargetElement element = elements [i];
- if (element.getName().equals(id)) {
- try {
- return element.getControl();
- } catch (CoreException e) {
-
- }
- }
- }
- }
- return null;
- }
-
- public String[] getAllConfigNames() {
- ITargetElement[] elements = getConfigElements();
- List<String> names = new ArrayList<String>();
- if (elements != null) {
- for (int i = 0; i < elements.length; i++)
- {
- ITargetElement element = elements [i];
- names.add(element.getName());
- }
- }
-
- return (String[]) names.toArray(new String[]{});
- }
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetTypeElement.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetTypeElement.java
deleted file mode 100755
index c909ba65c..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/TargetTypeElement.java
+++ /dev/null
@@ -1,75 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.core;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.ptp.remotetools.environment.extension.ITargetTypeExtension;
-
-
-/**
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public class TargetTypeElement {
-
- private String name;
- private TargetEnvironmentManager manager;
- private ITargetTypeExtension extension;
- private List<ITargetElement> elements = new ArrayList<ITargetElement>();
-
- public TargetTypeElement(String name,ITargetTypeExtension env,TargetEnvironmentManager model) {
- super();
- this.name = name;
- this.extension = env;
- this.manager = model;
-
- }
-
- public List<ITargetElement> getElements() {
- return elements;
- }
-
- public void addElement(TargetElement element) {
- this.elements.add(element);
- manager.fireModelChanged(ITargetEnvironmentEventListener.ADDED, null, element);
- }
-
- public void removeElement(ITargetElement element) {
- this.elements.remove(element);
- manager.fireModelChanged(ITargetEnvironmentEventListener.REMOVED, element, null);
- }
-
- public ITargetTypeExtension getExtension() {
- return extension;
- }
-
- public void setExtension(ITargetTypeExtension extension) {
- this.extension = extension;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String toString() {
-
- return this.getName() != null ? this.getName() : super.toString();
- }
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/Messages.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/Messages.java
deleted file mode 100644
index 95ff4690a..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/Messages.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.ptp.remotetools.environment.core.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.ptp.remotetools.environment.core.messages.messages"; //$NON-NLS-1$
- public static String PoolingTargetControlEventProvider_0;
- public static String SSHTargetControl_0;
- public static String SSHTargetControl_1;
- public static String SSHTargetControl_2;
- public static String SSHTargetControl_3;
- public static String SSHTargetControl_4;
- public static String SSHTargetControl_5;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/messages.properties b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/messages.properties
deleted file mode 100644
index 0d2b8d811..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/core/messages/messages.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-PoolingTargetControlEventProvider_0=Target Control polling
-SSHTargetControl_0=Target not ready to execute jobs
-SSHTargetControl_1=Connection to target canceled
-SSHTargetControl_2=Failed to connect with remote target environment
-SSHTargetControl_3=Cancelled execution on remote target environment
-SSHTargetControl_4=Failed to execute on remote target environment
-SSHTargetControl_5=Internal error: remote connection invalid
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/IChildrenProvider.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/IChildrenProvider.java
deleted file mode 100644
index dcd21707b..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/IChildrenProvider.java
+++ /dev/null
@@ -1,31 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.extension;
-
-import org.eclipse.ptp.remotetools.environment.core.ITargetElement;
-
-/**
- * The interface to manage the children hierarchies of a target element
- *
- * @author Hong Chang Lin
- *
- */
-public interface IChildrenProvider {
-
- /**
- * Return all the child objects of an ITargetElement
- *
- * @param
- * @return
- */
- public INode[] getChildren(ITargetElement targetElement);
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/INode.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/INode.java
deleted file mode 100644
index 764cc7466..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/INode.java
+++ /dev/null
@@ -1,45 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.extension;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Represents the children of the ITargetElement's children on
- * RemoteToolsEnvironmentView
- *
- * @author Hong Chang Lin
- *
- */
-public interface INode {
-
- /**
- * @return all the children element
- */
- public INode[] getChildren();
-
- /**
- * @return the parent element
- */
- public Object getParent();
-
- /**
- * @return the display icon
- */
- public Image getIcon();
-
- /**
- * @return the display name
- */
- public String getDisplayText();
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetTypeExtension.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetTypeExtension.java
deleted file mode 100755
index be86e3b04..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetTypeExtension.java
+++ /dev/null
@@ -1,76 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.extension;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ptp.remotetools.environment.control.ITargetControl;
-import org.eclipse.ptp.remotetools.environment.core.ITargetElement;
-import org.eclipse.ptp.remotetools.environment.wizard.AbstractEnvironmentDialogPage;
-
-/**
- * Provides an interface that is an extension of a target type. This extension
- * must be implemented by each plugin that extends the Environment Control
- * Delegate extension point, in order to define a new target type.
- *
- * @author Ricardo M. Matinata, Richard Maciel
- * @since 1.1
- */
-public interface ITargetTypeExtension {
-
- /**
- * Given the attributes, produces a fresh new control instance.
- *
- * @param element
- * TODO
- *
- * @return the control instance
- */
- ITargetControl controlFactory(ITargetElement element) throws CoreException;
-
- /**
- * Provides an array with all the attributes' name needed by the associated
- * controlFactory. Only non-ciphered attributes are listed here.
- *
- * @return an array of attributes' name
- */
- String[] getControlAttributeNames();
-
- /**
- * Provides a Dialog Page to edit the associated control's attributes This
- * should be used to edit an existent target environment
- *
- * @param attributes
- * the attributes' map. May be null in the case of a new
- * configuration.
- * @param name
- * the configuration's key name. May be null in the case of a new
- * configuration.
- * @return an wizard page
- */
- AbstractEnvironmentDialogPage dialogPageFactory(ITargetElement targetElement);
-
- /**
- * Provides a Dialog Page to edit the associated control's attributes This
- * should be used when a new Target Environment is created
- *
- * @return an wizard page
- */
- AbstractEnvironmentDialogPage dialogPageFactory();
-
- /**
- * Provides an array with all the attributes' name needed by the associated
- * controlFactory. Only ciphered attributes are listed here.
- *
- * @return an array of attributes' name
- */
- String[] getControlAttributeNamesForCipheredKeys();
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetVariables.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetVariables.java
deleted file mode 100755
index ddb1cf8a1..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/extension/ITargetVariables.java
+++ /dev/null
@@ -1,25 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.environment.extension;
-
-/**
- * Interface that provides support for resolution
- * of variables on each environment type. This interface must
- * be implemented by each plugin that extends the
- * <extension point name here> extension point
- *
- * @author Richard Maciel
- *
- */
-public interface ITargetVariables {
- public String getSystemWorkspace();
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/AbstractEnvironmentDialogPage.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/AbstractEnvironmentDialogPage.java
deleted file mode 100755
index d7b1918b2..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/AbstractEnvironmentDialogPage.java
+++ /dev/null
@@ -1,71 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.wizard;
-
-import java.util.Map;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public abstract class AbstractEnvironmentDialogPage extends WizardPage {
-
- public AbstractEnvironmentDialogPage(String pageName) {
- super(pageName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- abstract public void createControl(Composite parent);
-
- final public boolean canFinish() {
- String name = getName();
- if (name != null) {
- if (!name.equals("")) { //$NON-NLS-1$
- return isValid();
- }
-
- }
- return false;
- }
-
- /**
- * Should return the configuration's map derived from populating this own
- * page. null is not allowed.
- *
- * @return the configuration attributes map
- */
- abstract public Map getAttributes();
-
- /**
- * Provides this configuration instance key name.
- *
- * @returns the configuration's name
- */
- abstract public String getName();
-
- /**
- * Returns weather this current page information represents a valid state of
- * configuration.
- *
- * @return true if valid, false otherwise.
- */
- abstract public boolean isValid();
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.java
deleted file mode 100755
index efe828d85..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.java
+++ /dev/null
@@ -1,38 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.wizard;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- *
- * @author Ricardo M. Matinata
- * @since 1.3
- */
-public class DialogMessages {
- private static final String BUNDLE_NAME = "org.eclipse.ptp.remotetools.environment.wizard.DialogMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private DialogMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.properties b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.properties
deleted file mode 100755
index fb552b5ac..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/DialogMessages.properties
+++ /dev/null
@@ -1,14 +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
-#
-# Contributors:
-# IBM Corporation - Initial Implementation
-###############################################################################
-
-EnvironmentWizard.0=Target Environment Configuration
-EnvironmentWizard.1=Configuration name already exists
-EnvironmentWizard.2=Invalid configuration name
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/EnvironmentWizard.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/EnvironmentWizard.java
deleted file mode 100755
index 8e9584a33..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/environment/wizard/EnvironmentWizard.java
+++ /dev/null
@@ -1,126 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- */
-package org.eclipse.ptp.remotetools.environment.wizard;
-
-import java.util.Map;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ptp.remotetools.environment.EnvironmentPlugin;
-import org.eclipse.ptp.remotetools.environment.core.ITargetElement;
-import org.eclipse.ptp.remotetools.environment.core.TargetElement;
-import org.eclipse.ptp.remotetools.environment.core.TargetTypeElement;
-
-/**
- *
- * @author Ricardo M. Matinata
- * @since 1.1
- */
-public class EnvironmentWizard extends Wizard {
-
- TargetTypeElement typeElement;
- ITargetElement targetElement;
- String originalKey = ""; //$NON-NLS-1$
- boolean cancel = false;
-
- /**
- *
- */
- public EnvironmentWizard(TargetTypeElement element) {
- super();
- this.typeElement = element;
- }
-
- public EnvironmentWizard(ITargetElement element) {
- super();
- this.typeElement = element.getType();
- this.targetElement = element;
- }
-
- /**
- *
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- @Override
- public void addPages() {
- super.addPages();
- this.setWindowTitle(DialogMessages.getString("EnvironmentWizard.0")); //$NON-NLS-1$
- // Map attributes = null;
- if (targetElement != null) {
- // attributes = new HashMap(targetElement.getAttributes());
- originalKey = targetElement.getName();
- }
- // AbstractEnvironmentDialogPage page =
- // typeElement.getExtension().dialogPageFactory(attributes,originalKey);
- AbstractEnvironmentDialogPage page;
- if (targetElement != null) {
- page = typeElement.getExtension().dialogPageFactory(targetElement);
- } else {
- page = typeElement.getExtension().dialogPageFactory();
- }
- addPage(page);
- }
-
- /**
- *
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- @Override
- public boolean performFinish() {
- if (!cancel) {
- AbstractEnvironmentDialogPage page = ((AbstractEnvironmentDialogPage) getStartingPage());
- Map attributes = page.getAttributes();
-
- if (attributes == null)
- return false;
-
- if (targetElement == null) {
- String id = EnvironmentPlugin.getDefault().getEnvironmentUniqueID();
- typeElement.addElement(new TargetElement(typeElement, page.getName(), attributes, id));
- } else {
- targetElement.setAttributes(attributes);
- targetElement.setName(page.getName());
- }
- }
- return true;
- }
-
- @Override
- public boolean performCancel() {
- this.cancel = true;
- return true;
- }
-
- /**
- *
- * @see org.eclipse.jface.wizard.IWizard#canFinish()
- */
- @Override
- public boolean canFinish() {
-
- AbstractEnvironmentDialogPage page = ((AbstractEnvironmentDialogPage) getStartingPage());
- page.setErrorMessage(null);
- if (!page.getName().equals(originalKey)) {
- if (page.getName() != null) {
- if (!(EnvironmentPlugin.getDefault().getTargetsManager().selectControl(page.getName()) == null)) {
- page.setErrorMessage(DialogMessages.getString("EnvironmentWizard.1")); //$NON-NLS-1$
- return false;
- }
- } else {
- page.setErrorMessage(DialogMessages.getString("EnvironmentWizard.2")); //$NON-NLS-1$
- return false;
- }
- }
-
- return page.canFinish();
- }
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/AttributeVerification.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/AttributeVerification.java
deleted file mode 100644
index 35b48c034..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/AttributeVerification.java
+++ /dev/null
@@ -1,294 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.utils.verification;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileInfo;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-
-public class AttributeVerification {
-
- public static IStatus createStatus(String pluginID, Throwable e, int severity,
- String attributeName, String message, String value) {
- if (value == null) {
- value = Messages.AttributeVerification_NoValue;
- }
- String errorMessage = NLS.bind(Messages.AttributeVerification_ErrorMessage, new String[] { attributeName, message, value});
- return new Status(IStatus.ERROR, pluginID, 0,
- errorMessage, e);
- }
-
- /**
- * Generic convenience method for raising core exception for errors.
- *
- * @param pluginID
- * see CoreException
- * @param e
- * see CoreException
- * @param attributeName
- * see CoreException
- * @param message
- * see CoreException
- * @param value
- * see CoreException
- * @throws CoreException
- */
- public static void throwAttributeException(String pluginID, Throwable e,
- String attributeName, String message, String value)
- throws CoreException {
- throw new CoreException(createStatus(pluginID, e, IStatus.ERROR, attributeName, message, value));
- }
-
- /**
- * Generic convenience method for raising core exception for errors.
- *
- * @param pluginID
- * see CoreException
- * @param attributeName
- * see CoreException
- * @param message
- * see CoreException
- * @param value
- * see CoreException
- * @throws CoreException
- */
- public static void throwAttributeException(String pluginID,
- String attributeName, String message, String value)
- throws CoreException {
- throwAttributeException(pluginID, (Throwable) null, attributeName,
- message, value);
- }
-
- String pluginID = null;
-
- public AttributeVerification(String pluginID) {
- super();
- this.pluginID = pluginID;
- }
-
- /**
- * Throws a CoreException for the plug-in associated with this instance of
- * AttributeVerification.
- *
- * @param e
- * see CoreException
- * @param attributeName
- * see CoreException
- * @param message
- * see CoreException
- * @param value
- * see CoreException
- * @throws CoreException
- * see CoreException
- */
- public void throwAttributeException(Throwable e,
- String attributeName, String message, String value)
- throws CoreException {
- if (value == null) {
- value = Messages.AttributeVerification_NoValue;
- }
- String errorMessage = NLS.bind(Messages.AttributeVerification_ErrorMessage, new String[] { attributeName, message, value});
- throw new CoreException(new Status(IStatus.ERROR, pluginID, 0,
- errorMessage, e));
- }
-
- /**
- * Throws a CoreException for the plug-in associated with this instance of
- * AttributeVerification.
- *
- * @param attributeName
- * see CoreException
- * @param message
- * see CoreException
- * @param value
- * see CoreException
- * @throws CoreException
- * see CoreException
- */
- public void throwAttributeException(String attributeName, String message, String value) throws CoreException {
- throwAttributeException((Throwable)null, attributeName, message, value);
- }
-
- /**
- * If the string represents a valid parsable path, returns this path.
- * @param attributeName Name of the attribute
- * @param stringValue String that represents the path
- * @param pathType Class used to create path
- * @return The path represented by the string
- * @throws CoreException
- */
- public IPath verifyPath(String attributeName, String stringValue) throws CoreException {
- IPath path = new Path(stringValue);
-
- // Verify path
- // Very strange design for IPath interface for testing validity.
- if (! path.isValidPath(stringValue)) {
- throwAttributeException(attributeName, Messages.AttributeVerification_InvalidPath, stringValue);
- }
-
- return path;
- }
-
- public static final int EXIST = 1;
- public static final int WRITEABLE = 2;
- public static final int DIRECTORY = 4;
- public static final int EXECUTABLE = 8;
- public static final int FILE = 16;
- public static final int EXISTING_FILE = EXIST | FILE;
- public static final int EXISTING_EXECUTABLE = EXIST | FILE | EXECUTABLE;
- public static final int EXISTING_DIRECTORY = EXIST | DIRECTORY;
-
- public IStatus checkPath(String attributeName, IPath path) {
- return checkPath(attributeName, path, IStatus.ERROR, EXIST);
- }
-
- public IStatus checkPath(String attributeName, IPath path, int severity) {
- return checkPath(attributeName, path, severity, EXIST);
- }
-
- public IStatus checkPath(String attributeName, IPath path, int severity, int options) {
- /*
- * Path must be absolute for safe check, if not, would check against
- * some unknown current working directory.
- */
- if (! path.isAbsolute()) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_NotAnAbsolutePath, path.toOSString());
- }
-
- URI uri = URIUtil.toURI(path);
- IFileStore file;
- try {
- file = EFS.getStore(uri);
- } catch (CoreException e) {
- return e.getStatus();
- }
-
- IFileInfo info = file.fetchInfo();
-
- if ((options & EXIST) != 0) {
- if (! info.exists()) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_PathDoesNotExist, path.toOSString());
- }
- }
-
- if ((options & DIRECTORY) != 0) {
- if (! info.isDirectory()) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_PathIsNotDir, path.toOSString());
- }
- }
-
- if ((options & EXECUTABLE) != 0) {
- /*
- * On PPC, it is known that the EFS.ATTRIBUTE_EXECUTABLE is never set,
- * event if the path is an executable fiel.
- */
- if (Platform.getOSArch().equals(Platform.ARCH_PPC)) {
- // Simple ignore and assume it is an executable.
- } else {
- if (! info.getAttribute(EFS.ATTRIBUTE_EXECUTABLE)) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_PathIsNotExecutableFile, path.toOSString());
- }
- }
- }
-
- if ((options & WRITEABLE) != 0) {
- if (info.getAttribute(EFS.ATTRIBUTE_READ_ONLY)) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_PathIsNotWritable, path.toOSString());
- }
- }
-
- if ((options & FILE) != 0) {
- if (info.isDirectory()) {
- return createStatus(pluginID, null, severity, attributeName, Messages.AttributeVerification_PathIsNotFile, path.toOSString());
- }
- }
-
- return null;
- }
-
- public IPath verifyPluginRelativePath(String attributeName, Plugin plugin, IPath path) throws CoreException {
- if (path.isAbsolute()) {
- return path;
- } else {
- URL url = FileLocator.find(plugin.getBundle(), path, null);
- if (url == null) {
- throwAttributeException(attributeName, Messages.AttributeVerification_PathNotFound, path.toOSString());
- }
- try {
- url = FileLocator.resolve(url);
- URI uri = new URI(url.toString());
- File file = new File(uri);
- return new Path(file.getAbsolutePath());
- } catch (IOException e1) {
- throwAttributeException(attributeName, Messages.AttributeVerification_PathNotFound, path.toOSString());
- } catch (URISyntaxException e) {
- throwAttributeException(attributeName, Messages.AttributeVerification_MustBeLocalFile, path.toOSString());
- }
- }
- return null;
- }
-
-// public IPath verifyWorkspaceRelativePath(String attributeName, Plugin plugin, IPath path) {
-// // TODO: Implement
-//
-// }
-
- public IStatus createResultStatus(List errors) {
- /*
- * Remove null elements from list.
- */
- List oldList = errors;
- errors = new ArrayList();
- Iterator iterator = oldList.iterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object != null) {
- errors.add(object);
- }
- }
-
- if (errors.isEmpty()) {
- return new Status(IStatus.OK, pluginID, 0, Messages.AttributeVerification_ConfigurationOK, null);
- } else {
- /*
- * TODO: make code better, without iterator
- */
- MultiStatus result = new MultiStatus(pluginID, 0, Messages.AttributeVerification_InvalidConfiguration, null);
- Iterator iterator2 = errors.iterator();
- while (iterator2.hasNext()) {
- IStatus object = (IStatus) iterator2.next();
- result.add(object);
- }
- return result;
- }
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/ControlAttributes.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/ControlAttributes.java
deleted file mode 100644
index 78c53a6fd..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/ControlAttributes.java
+++ /dev/null
@@ -1,365 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.utils.verification;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-public class ControlAttributes implements Cloneable {
-
- Map currentMap = null;
-
- Map defaultMap = null;
-
- /** Create an instance without default values. */
- public ControlAttributes(Map config) {
- super();
- this.currentMap = config;
- this.defaultMap = new HashMap();
- }
-
- /** Create an instance with default values. */
- public ControlAttributes(Map currentMap, Map defaultMap) {
- super();
- this.currentMap = currentMap;
- this.defaultMap = defaultMap;
- }
-
- /** Return the current value of an attribute, if available. */
- private String getCurrent(String attributeName) {
- if (currentMap == null) {
- return null;
- }
- return (String) currentMap.get(attributeName);
- }
-
- /** Return the default value of an attribute, if available. */
- private String getDefault(String attributeName) {
- if (defaultMap == null) {
- return null;
- }
- return (String) defaultMap.get(attributeName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#clone()
- */
- public Object clone() throws CloneNotSupportedException {
- ControlAttributes newObject = new ControlAttributes(null);
- if (currentMap != null) {
- newObject.currentMap = new HashMap(currentMap);
- }
- if (defaultMap != null) {
- newObject.defaultMap = new HashMap(defaultMap);
- }
- return newObject;
- }
-
- /***************************************************************************
- * Safe GETTERS The safe getters return the current value, if available and
- * parseable. Otherwise, return the default value, if available and
- * parseable. Otherwise, return some hard-coded fallback value. If the
- * current value cannot be parsed, no exception is thrown, but the default
- * value is used.
- **************************************************************************/
- /**
- * Get the attribute as string. If not available or not parseable, get
- * default. If default not available, get <code>null</code>.
- */
- public String getAttributeOrDefault(String attributeName) {
- String value = getCurrent(attributeName);
- if (value == null) {
- return getDefault(attributeName);
- } else {
- return value;
- }
- }
-
- /**
- * Get the attribute as string. If not available or not parseable, get
- * default. If default not available or not parseable, get empty string.
- */
- public String getString(String attributeKey) {
- return getString(attributeKey, ""); //$NON-NLS-1$
- }
-
- /**
- * Get the attribute as string. If not available or not parseable, get
- * default. If default not available or not parseable, get parameter default
- * value.
- */
- public String getString(String attributeKey, String defaultValue) {
- String stringValue = getAttributeOrDefault(attributeKey);
- if (stringValue == null)
- return defaultValue;
- return stringValue;
- }
-
- /**
- * Get the attribute as text (multi line string). If not available or not
- * parseable, get default. If default not available or not parseable, get
- * empty string.
- */
- public String getText(String attributeKey) {
- return getText(attributeKey, ""); //$NON-NLS-1$
- }
-
- /**
- * Get the attribute as text (multi line string). If not available or not
- * parseable, get default. If default not available or not parseable, get
- * parameter default value.
- */
- public String getText(String attributeKey, String defaultValue) {
- String textValue = getAttributeOrDefault(attributeKey);
- if (textValue == null)
- textValue = defaultValue;
- textValue = textValue.replaceAll("\\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- textValue = textValue.replaceAll("\\\\", "\\"); //$NON-NLS-1$ //$NON-NLS-2$
- return textValue;
- }
-
- /**
- * Get the attribute as boolean. If not available or not parseable, get
- * default. If default not available or not parseable, get false.
- */
- public boolean getBoolean(String attributeKey) {
- return getBoolean(attributeKey, false);
- }
-
- /**
- * Get the attribute as boolean. If not available or not
- * parseable, get default. If default not available or not parseable, get
- * parameter default value.
- */
- public boolean getBoolean(String attributeKey, boolean defaultValue) {
- String string = getAttributeOrDefault(attributeKey);
- if (string == null) {
- return defaultValue;
- } else {
- return Boolean.valueOf(string).booleanValue();
- }
- }
-
- /**
- * Get the attribute as integer. If not available or not parseable, get
- * default. If default not available or not parseable, get zero.
- */
- public int getInteger(String attributeKey) {
- return getInteger(attributeKey, 0);
- }
-
- /**
- * Get the attribute as integer. If not available or not
- * parseable, get default. If default not available or not parseable, get
- * parameter default value.
- */
- public int getInteger(String attributeKey, int defaultValue) {
- String string = getAttributeOrDefault(attributeKey);
- if (string == null) {
- return defaultValue;
- }
- try {
- return Integer.parseInt(string);
- } catch (NumberFormatException e1) {
- try {
- string = getDefault(attributeKey);
- if (string == null) {
- return defaultValue;
- } else {
- return Integer.parseInt(string);
- }
- } catch (NumberFormatException e2) {
- return defaultValue;
- }
- }
- }
-
- /**
- * Get the attribute as double. If not available or not parseable, get
- * default. If default not available or not parseable, get zero.
- */
- public double getDouble(String attributeKey) {
- return getDoubleAttribute(attributeKey, 0.0);
- }
-
- /**
- * Get the attribute as double. If not available or not
- * parseable, get default. If default not available or not parseable, get
- * parameter default value.
- */
- public double getDouble(String attributeKey, double defaultValue) {
- String string = getAttributeOrDefault(attributeKey);
- if (string == null) {
- return defaultValue;
- }
- try {
- return Double.parseDouble(string);
- } catch (NumberFormatException e1) {
- try {
- string = getDefault(attributeKey);
- if (string == null) {
- return defaultValue;
- } else {
- return Double.parseDouble(string);
- }
- } catch (NumberFormatException e2) {
- return defaultValue;
- }
- }
- }
-
- /***************************************************************************
- * Old GETTERS They are deprecated.
- **************************************************************************/
- /** @deprecated */
- public boolean getBooleanAttribute(String attributeKey, boolean defaultValue) {
- return getBoolean(attributeKey, defaultValue);
- }
-
- /** @deprecated */
- public int getIntegerAttribute(String attributeKey, int defaultValue) {
- return getInteger(attributeKey, defaultValue);
- }
-
- /** @deprecated */
- public double getDoubleAttribute(String attributeKey, double defaultValue) {
- return getDouble(attributeKey, defaultValue);
- }
-
- /** @deprecated */
- public String getStringAttribute(String attributeKey, String defaultValue) {
- return getString(attributeKey, defaultValue);
- }
-
- /** @deprecated */
- public String getTextAttribute(String attributeKey, String defaultValue) {
- return getText(attributeKey, defaultValue);
- }
-
- /***************************************************************************
- * Verifying GETTERS
- **************************************************************************/
- /**
- * @deprecated
- */
- public int verifyIntAttribute(String attributeName, String attributeKey,
- int defaultValue) throws IllegalAttributeException {
- String stringValue = getAttributeOrDefault(attributeKey);
- if (stringValue == null) {
- return defaultValue;
- }
- try {
- return Integer.parseInt(stringValue);
- } catch (NumberFormatException e) {
- throw new IllegalAttributeException(e, attributeName,
- Messages.ControlAttributes_InvalidIntegerNumber, stringValue);
- }
- }
-
- public int verifyInt(String attributeName, String attributeKey)
- throws IllegalAttributeException {
- String stringValue = verifyString(attributeName, attributeKey);
- try {
- return Integer.parseInt(stringValue);
- } catch (NumberFormatException e) {
- throw new IllegalAttributeException(e, attributeName,
- Messages.ControlAttributes_InvalidIntegerNumber, stringValue);
- }
- }
-
- /**
- * @deprecated
- */
- public double verifyDoubleAttribute(String attributeName,
- String attributeKey, double defaultValue)
- throws IllegalAttributeException {
- String stringValue = getAttributeOrDefault(attributeKey);
- if (stringValue == null)
- return defaultValue;
- try {
- return Double.parseDouble(stringValue);
- } catch (NumberFormatException e) {
- throw new IllegalAttributeException(e, attributeName,
- Messages.ControlAttributes_InvalidDecimalNumber, stringValue);
- }
- }
-
- public double verifyDouble(String attributeName, String attributeKey)
- throws IllegalAttributeException {
- String stringValue = verifyString(attributeName, attributeKey);
- try {
- return Double.parseDouble(stringValue);
- } catch (NumberFormatException e) {
- throw new IllegalAttributeException(e, attributeName,
- Messages.ControlAttributes_InvalidDecimalNumber, stringValue);
- }
- }
-
- public IPath verifyPath(String attributeName, String attributeKey)
- throws IllegalAttributeException {
- String stringValue = verifyString(attributeName, attributeKey);
-
- // TODO: Implement a proper checking
- Path path = new Path(""); //$NON-NLS-1$
- if (!path.isValidPath(stringValue)) {
- throw new IllegalAttributeException(attributeName,
- Messages.ControlAttributes_InvalidPath, stringValue);
- }
- return new Path(stringValue);
- }
-
- public String verifyString(String attributeName, String attributeKey)
- throws IllegalAttributeException {
- String stringValue = getAttributeOrDefault(attributeKey);
- if (stringValue == null) {
- throw new IllegalAttributeException(attributeName,
- Messages.ControlAttributes_MustNotBeEmpty);
- }
- return stringValue;
- }
-
- /***************************************************************************
- * SETTERS
- **************************************************************************/
- public void setAttribute(String attributeKey, String value) {
- currentMap.put(attributeKey, value);
- }
-
- public void setStringAttribute(String attributeKey, String value) {
- setAttribute(attributeKey, value);
- }
-
- public void setIntAttribute(String attributeKey, int value) {
- setAttribute(attributeKey, Integer.toString(value));
- }
-
- public void setDoubleAttribute(String attributeKey, double value) {
- setAttribute(attributeKey, Double.toString(value));
- }
-
- public void setBooleanAttribute(String attributeKey, boolean value) {
- setAttribute(attributeKey, Boolean.toString(value));
- }
-
- public void setTextAttribute(String attributeKey, String value) {
- String textValue = value;
- textValue = textValue.replaceAll("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
- textValue = textValue.replaceAll("\n", "\\n"); //$NON-NLS-1$ //$NON-NLS-2$
- setAttribute(attributeKey, textValue);
- }
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/IllegalAttributeException.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/IllegalAttributeException.java
deleted file mode 100644
index 4ad9da25a..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/IllegalAttributeException.java
+++ /dev/null
@@ -1,67 +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
- *
- * Contributors:
- * IBM Corporation - Initial Implementation
- *
- *****************************************************************************/
-package org.eclipse.ptp.remotetools.utils.verification;
-
-public class IllegalAttributeException extends Exception {
-
- String name;
- String value;
-
- public IllegalAttributeException() {
- }
-
- public IllegalAttributeException(String arg0) {
- super(arg0);
- }
-
- public IllegalAttributeException(Throwable arg0) {
- super(arg0);
- }
-
- public IllegalAttributeException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- }
-
- public IllegalAttributeException(String message, String name) {
- super(name + ": " + message); //$NON-NLS-1$
- this.name = name;
- }
-
- public IllegalAttributeException(String message, String name, String value) {
- super(name + ": " + message + "( " + value + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- this.value = value;
- this.name = name;
- }
-
- public IllegalAttributeException(Exception e, String name, String message, String value) {
- super(name + ": " + message + "( " + value + ")", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- this.value = value;
- this.name = name;
- }
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
-
-
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/Messages.java b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/Messages.java
deleted file mode 100644
index 2c782e053..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/Messages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.ptp.remotetools.utils.verification;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.ptp.cell.utils.verification.messages"; //$NON-NLS-1$
- public static String AttributeVerification_ConfigurationOK;
- public static String AttributeVerification_ErrorMessage;
- public static String AttributeVerification_InvalidConfiguration;
- public static String AttributeVerification_InvalidPath;
- public static String AttributeVerification_MustBeLocalFile;
- public static String AttributeVerification_NotAnAbsolutePath;
- public static String AttributeVerification_NoValue;
- public static String AttributeVerification_PathDoesNotExist;
- public static String AttributeVerification_PathIsNotDir;
- public static String AttributeVerification_PathIsNotExecutableFile;
- public static String AttributeVerification_PathIsNotFile;
- public static String AttributeVerification_PathIsNotWritable;
- public static String AttributeVerification_PathNotFound;
- public static String ControlAttributes_InvalidDecimalNumber;
- public static String ControlAttributes_InvalidIntegerNumber;
- public static String ControlAttributes_InvalidPath;
- public static String ControlAttributes_MustNotBeEmpty;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/messages.properties b/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/messages.properties
deleted file mode 100644
index 0f18702ed..000000000
--- a/tools/remotetools/org.eclipse.ptp.remotetools.environment.core/src/org/eclipse/ptp/remotetools/utils/verification/messages.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-AttributeVerification_NoValue=no value
-AttributeVerification_ErrorMessage={0}: {1} ({2})
-AttributeVerification_InvalidPath=is not a valid path
-AttributeVerification_NotAnAbsolutePath=is not an absolute path
-AttributeVerification_PathDoesNotExist=Path does not exist
-AttributeVerification_PathIsNotDir=Path is not a directory
-AttributeVerification_PathIsNotExecutableFile=Path is not an executable file
-AttributeVerification_PathIsNotWritable=Path is not writable
-AttributeVerification_PathIsNotFile=Path is not a file
-AttributeVerification_PathNotFound=Path not found in plug-in
-AttributeVerification_MustBeLocalFile=Must be a local file
-AttributeVerification_ConfigurationOK=Configuration is OK
-AttributeVerification_InvalidConfiguration=Configuration contains invalid values
-ControlAttributes_InvalidIntegerNumber=is not valid integer number
-ControlAttributes_InvalidDecimalNumber=is not valid decimal number
-ControlAttributes_InvalidPath=is not valid path
-ControlAttributes_MustNotBeEmpty=must not be empty

Back to the top