| author | john.r.misinco | 2011-06-17 13:54:01 (EDT) |
|---|---|---|
| committer | Ryan D. Brooks | 2011-06-17 13:54:01 (EDT) |
| commit | d5eefc51feb72e47c133dea7f147fccf46941c2d (patch) (side-by-side diff) | |
| tree | 3ab8283608bce3a34fd671236bfa70ab30a15bd1 | |
| parent | 9d20f002654e95f72c93c04b53c1a10b62eb25d0 (diff) | |
| download | org.eclipse.osee-d5eefc51feb72e47c133dea7f147fccf46941c2d.zip org.eclipse.osee-d5eefc51feb72e47c133dea7f147fccf46941c2d.tar.gz org.eclipse.osee-d5eefc51feb72e47c133dea7f147fccf46941c2d.tar.bz2 | |
feature[bgz_348289]: Allow HttpProcessor to bypass proxy settings0.9.8.v201106200029_SR2_RC
2 files changed, 32 insertions, 20 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/HttpProcessor.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/HttpProcessor.java index 8ea3c82..e1ba637 100644 --- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/HttpProcessor.java +++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/util/HttpProcessor.java @@ -44,6 +44,7 @@ import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.internal.Activator; import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.jdk.core.util.Lib; +import org.eclipse.osee.framework.jdk.core.util.OseeProperties; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.logging.OseeLog; import org.osgi.framework.BundleContext; @@ -78,27 +79,30 @@ public class HttpProcessor { } private static void configureProxyData(URI uri, HostConfiguration config) { - if (proxyService == null) { - BundleContext context = Activator.getBundleContext(); - ServiceReference reference = context.getServiceReference(IProxyService.class.getName()); - proxyService = (IProxyService) context.getService(reference); - proxyService.addProxyChangeListener(new IProxyChangeListener() { - - @Override - public void proxyInfoChanged(IProxyChangeEvent event) { - proxiedData.clear(); - } - }); - } + boolean proxyBypass = OseeProperties.getOseeProxyBypassEnabled(); + if (!proxyBypass) { + if (proxyService == null) { + BundleContext context = Activator.getBundleContext(); + ServiceReference reference = context.getServiceReference(IProxyService.class.getName()); + proxyService = (IProxyService) context.getService(reference); + proxyService.addProxyChangeListener(new IProxyChangeListener() { + + @Override + public void proxyInfoChanged(IProxyChangeEvent event) { + proxiedData.clear(); + } + }); + } - String key = String.format("%s_%s", uri.getScheme(), uri.getHost()); - IProxyData[] datas = proxiedData.get(key); - if (datas == null) { - datas = proxyService.select(uri); - proxiedData.put(key, datas); - } - for (IProxyData data : datas) { - config.setProxy(data.getHost(), data.getPort()); + String key = String.format("%s_%s", uri.getScheme(), uri.getHost()); + IProxyData[] datas = proxiedData.get(key); + if (datas == null) { + datas = proxyService.select(uri); + proxiedData.put(key, datas); + } + for (IProxyData data : datas) { + config.setProxy(data.getHost(), data.getPort()); + } } OseeLog.format(Activator.class, Level.INFO, "Http-Request: [%s] [%s]", requests++, uri.toASCIIString()); } diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/OseeProperties.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/OseeProperties.java index f6e0a34..b7cf02b 100644 --- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/OseeProperties.java +++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/OseeProperties.java @@ -31,6 +31,7 @@ public class OseeProperties { private static final String OSEE_CONNECTION_INFO_URI = "osee.connection.info.uri"; private static final String OSEE_EMBEDDED_DB_SERVER = "osee.db.embedded.server"; private static final String OSEE_DEFAULT_BROKER_URI = "osee.default.broker.uri"; + private static final String OSEE_PROXY_BYPASS_ENABLED = "osee.proxy.bypass.enabled"; protected OseeProperties() { // Utility Class @@ -165,6 +166,13 @@ public class OseeProperties { } } + /** + * @return whether proxy settings should be ignored for HttpRequests + */ + public static boolean getOseeProxyBypassEnabled() { + return Boolean.valueOf(System.getProperty(OSEE_PROXY_BYPASS_ENABLED, "false")); + } + @Override public String toString() { List<String> list = new ArrayList<String>(); |

