Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2008-09-29 11:10:31 +0000
committerTomasz Zarna2008-09-29 11:10:31 +0000
commita1e0c68674d905ef8436e6e51004882db08b75a2 (patch)
treea44aec698e2161d1d445ac9aba4ad3d11bda27a1 /bundles/org.eclipse.core.net/src
parentd37ce8b1ef66eae78a0682ee1623e299f068bb8c (diff)
downloadeclipse.platform.team-a1e0c68674d905ef8436e6e51004882db08b75a2.tar.gz
eclipse.platform.team-a1e0c68674d905ef8436e6e51004882db08b75a2.tar.xz
eclipse.platform.team-a1e0c68674d905ef8436e6e51004882db08b75a2.zip
bug 246072: [Net] Native proxy libraries support for getting native provider name
Diffstat (limited to 'bundles/org.eclipse.core.net/src')
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java17
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java3
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java3
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java3
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java3
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java33
6 files changed, 52 insertions, 10 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java
index af7a1791c..c3d523ee7 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java
@@ -20,12 +20,15 @@ public class ProxyData implements IProxyData {
private String user;
private String password;
private boolean requiresAuthentication;
+ private String source;
- public ProxyData(String type, String host, int port, boolean requiresAuthentication) {
+ public ProxyData(String type, String host, int port,
+ boolean requiresAuthentication, String source) {
this.type = type;
this.host = host;
this.port = port;
this.requiresAuthentication = requiresAuthentication;
+ this.source = source;
}
public ProxyData(String type) {
@@ -83,6 +86,14 @@ public class ProxyData implements IProxyData {
requiresAuthentication = false;
}
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
public String toString() {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("type: "); //$NON-NLS-1$
@@ -97,7 +108,9 @@ public class ProxyData implements IProxyData {
stringBuffer.append(password);
stringBuffer.append(" reqAuth: "); //$NON-NLS-1$
stringBuffer.append(requiresAuthentication);
- return stringBuffer.toString();
+ stringBuffer.append(" source: "); //$NON-NLS-1$
+ stringBuffer.append(source);
+ return stringBuffer.toString();
}
}
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
index 0b6505a9b..14c054415 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
@@ -445,7 +445,8 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener {
int port = getPortToMigrate(updatePrefs, isInitialize /* checkSystemProperties */);
boolean httpProxyEnable = getEnablementToMigrate(updatePrefs, isInitialize /* checkSystemProperties */);
if (httpProxyHost != null) {
- ProxyData proxyData = new ProxyData(IProxyData.HTTP_PROXY_TYPE, httpProxyHost, port, false);
+ ProxyData proxyData = new ProxyData(IProxyData.HTTP_PROXY_TYPE,
+ httpProxyHost, port, false, null);
ProxyType type = getType(proxyData);
type.updatePreferencesIfMissing(netPrefs, proxyData);
if (httpProxyEnable) {
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
index 3f973994c..207b14473 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java
@@ -135,7 +135,8 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener
host = null;
int port = node.getInt(PREF_PROXY_PORT, -1);
boolean requiresAuth = node.getBoolean(PREF_PROXY_HAS_AUTH, false);
- ProxyData proxyData = new ProxyData(type, host, port, requiresAuth);
+ ProxyData proxyData = new ProxyData(type, host, port, requiresAuth,
+ null);
loadProxyAuth(proxyData);
if (verifyFlag == VERIFY_EMPTY) {
// We are initializing so verify that the system properties are empty
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
index c2f2389e8..49b7136eb 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
@@ -127,7 +127,7 @@ public class UnixProxyProvider extends AbstractProxyProvider {
pd.setUserid(user);
pd.setPassword(password);
}
-
+ pd.setSource("LINUX_ENV"); //$NON-NLS-1$
if (Policy.DEBUG_SYSTEM_PROVIDERS)
Policy.debug("Got Env proxy: " + pd); //$NON-NLS-1$
return pd;
@@ -143,6 +143,7 @@ public class UnixProxyProvider extends AbstractProxyProvider {
pd = getGConfProxyInfo(protocol);
if (Policy.DEBUG_SYSTEM_PROVIDERS)
Policy.debug("Got Gnome proxy: " + pd); //$NON-NLS-1$
+ pd.setSource("LINUX_GNOME"); //$NON-NLS-1$
return pd;
} catch (UnsatisfiedLinkError e) {
// The library should be loaded, so this is a real exception
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
index 04f31df86..b1795e6b5 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
@@ -7,6 +7,7 @@
*
* Contributors:
* compeople AG (Stefan Liebig) - initial API and implementation
+ * IBM Corporation - bug 246072, adding IProxyData.source support
*******************************************************************************/
package org.eclipse.core.internal.net.proxy.win32.winhttp;
@@ -149,6 +150,7 @@ public final class ProxyProviderUtil {
IProxyData proxy = new ProxyData(type);
proxy.setHost(host);
proxy.setPort(port);
+ proxy.setSource("WINDOWS_IE"); //$NON-NLS-1$
return proxy;
}
@@ -219,6 +221,7 @@ public final class ProxyProviderUtil {
IProxyData proxy = new ProxyData(proxyType);
proxy.setHost(hostname);
proxy.setPort(port);
+ proxy.setSource("WINDOWS_IE"); //$NON-NLS-1$
return proxy;
}
return null;
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
index 51c600ea1..f98533acb 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,11 +11,10 @@
package org.eclipse.core.net.proxy;
/**
- * An {@link IProxyData} contains the information that is required to connect
- * to a particular proxy server.
- * <p>
- * This interface is not intended to be implemented by clients.
+ * An {@link IProxyData} contains the information that is required to connect to
+ * a particular proxy server.
*
+ * @noimplement This interface is not intended to be implemented by clients.
* @since 1.0
*/
public interface IProxyData {
@@ -141,6 +140,30 @@ public interface IProxyData {
boolean isRequiresAuthentication();
/**
+ * Returns the proxy source name. This value is useful for diagnosing
+ * purposes since many OS specific proxy sources could be available in a
+ * single environment. Null value means that the setting come from Eclipse
+ * preferences and is not OS specific.
+ *
+ * @since 1.2
+ * @return name of the proxy setting source, might be <code>null</code>
+ */
+ String getSource();
+
+ /**
+ * Sets the proxy source name. This value is useful for diagnosing purposes
+ * since many OS specific proxy sources could be available in a single
+ * environment. Null value means that the setting comes from Eclipse
+ * preferences and is not OS specific.
+ *
+ * @param source
+ * proxy setting source name to be set, might be
+ * <code>null</code>
+ * @since 1.2
+ */
+ void setSource(String source);
+
+ /**
* Set the values of this data to represent a disabling of its type.
* Note that the proxy type will not be disabled unless the client
* calls {@link IProxyService#setProxyData(IProxyData[])} with the

Back to the top