[Mantisconnect-cvs] SF.net SVN: mantisconnect:[205] mantisconnect/trunk/clients/java/client-api
Brought to you by:
vboctor
From: <pl...@us...> - 2010-12-05 20:33:02
|
Revision: 205 http://mantisconnect.svn.sourceforge.net/mantisconnect/?rev=205&view=rev Author: planser Date: 2010-12-05 20:32:56 +0000 (Sun, 05 Dec 2010) Log Message: ----------- defined configurations settings for proxy Modified Paths: -------------- mantisconnect/trunk/clients/java/client-api/README.txt mantisconnect/trunk/clients/java/client-api/src/main/org/mantisbt/connect/axis/Proxy.java Modified: mantisconnect/trunk/clients/java/client-api/README.txt =================================================================== --- mantisconnect/trunk/clients/java/client-api/README.txt 2010-12-02 08:12:31 UTC (rev 204) +++ mantisconnect/trunk/clients/java/client-api/README.txt 2010-12-05 20:32:56 UTC (rev 205) @@ -39,10 +39,10 @@ This is version 1.1.2.0 which means that it's compatible with webservices versioned 1.1 respectively 1.1.x (first two parts). -It is the first version of the Client API (1.0 - the second two parts). +It is the second version of the Client API (2.0 - the second two parts). The next bugfix release for the MantisConnect Java Client API would be named -1.1.1.1. +1.1.2.1. 3. Building the source distribution =================================== @@ -104,7 +104,7 @@ [...] -Proxy.setProxy("localhost", 8080); +Proxy.configure("localhost", 8080); IMCSession session = new MCSession(url, user, pwd); [...] Modified: mantisconnect/trunk/clients/java/client-api/src/main/org/mantisbt/connect/axis/Proxy.java =================================================================== --- mantisconnect/trunk/clients/java/client-api/src/main/org/mantisbt/connect/axis/Proxy.java 2010-12-02 08:12:31 UTC (rev 204) +++ mantisconnect/trunk/clients/java/client-api/src/main/org/mantisbt/connect/axis/Proxy.java 2010-12-05 20:32:56 UTC (rev 205) @@ -26,8 +26,7 @@ * A class which acts as a HTTP proxy for Axis. * </p> * <p> - * To configure a HTTP proxy use the static method - * <code>setProxy(String, int).</code> + * To configure a HTTP proxy use one of the static configure methods. * </p> * * @author Peter Lanser, pl...@us... @@ -39,34 +38,77 @@ "org.mantisbt.connect.axis.Proxy"); } - private static String proxyHost; + private static String host; + private static String port; + private static String user; + private static String password; + private static String nonProxyHosts; - private static String proxyPort; - public String getProxyHost() { - if (proxyHost != null) { - return proxyHost; + if (Proxy.host != null) { + return Proxy.host; } else { return super.getProxyHost(); } } public String getProxyPort() { - if (proxyPort != null) { - return String.valueOf(proxyPort); + if (Proxy.port != null) { + return Proxy.port; } else { return super.getProxyPort(); } } - - public static void setProxy(String proxyHost, int proxyPort) { - if (proxyHost == null || proxyPort == 0) { - Proxy.proxyHost = null; - Proxy.proxyPort = null; + + public String getProxyUser() { + if (Proxy.user != null) { + return Proxy.user; } else { - Proxy.proxyHost = proxyHost; - Proxy.proxyPort = String.valueOf(proxyPort); + return super.getProxyUser(); } } + + public String getProxyPassword() { + if (Proxy.password != null) { + return Proxy.password; + } else { + return super.getProxyPassword(); + } + } + + public String getNonProxyHosts() { + if (Proxy.nonProxyHosts != null) { + return Proxy.nonProxyHosts; + } else { + return super.getNonProxyHosts(); + } + } + + public static void configure(String host, int port) { + configure(host, port, null, null, null); + } + + public static void configure(String host, int port, String nonProxyHosts) { + configure(host, port, null, null, nonProxyHosts); + } + + public static void configure(String host, int port, String user, String password) { + configure(host, port, user, password, null); + } + + public static void configure(String host, int port, String user, String password, String nonProxyHosts) { + Proxy.host = host; + Proxy.port = String.valueOf(port); + Proxy.user = user; + Proxy.password = password; + Proxy.nonProxyHosts = nonProxyHosts; + } + /** + * @deprecated Use <tt>configure(String host, int port)</tt> instead. + */ + public static void setProxy(String host, int port) { + configure(host, port); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |