Class HTTPProxyConfigurator
- java.lang.Object
-
- org.apache.axis2.transport.http.impl.httpclient4.HTTPProxyConfigurator
-
public class HTTPProxyConfigurator extends Object
-
-
Constructor Summary
Constructors Constructor Description HTTPProxyConfigurator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
configure(MessageContext messageContext, org.apache.http.client.config.RequestConfig.Builder requestConfig, org.apache.http.client.protocol.HttpClientContext clientContext)
Configure HTTP Proxy settings of httpcomponents HostConfiguration.static boolean
isHostInNonProxyList(String host, String nonProxyHosts)
Check if the specified host is in the list of non proxy hosts.static boolean
isProxyEnabled(MessageContext messageContext, URL targetURL)
Check whether http proxy is configured or active.
-
-
-
Method Detail
-
configure
public static void configure(MessageContext messageContext, org.apache.http.client.config.RequestConfig.Builder requestConfig, org.apache.http.client.protocol.HttpClientContext clientContext) throws AxisFault
Configure HTTP Proxy settings of httpcomponents HostConfiguration. Proxy settings can be get from axis2.xml, Java proxy settings or can be override through property in message context. HTTP Proxy setting element format:example.org 3128 EXAMPLE/John password - Parameters:
messageContext
- in message context forrequestConfig
- the request configuration to fill inclientContext
- the HTTP client context- Throws:
AxisFault
- if Proxy settings are invalid
-
isProxyEnabled
public static boolean isProxyEnabled(MessageContext messageContext, URL targetURL)
Check whether http proxy is configured or active. This is not a deep check.- Parameters:
messageContext
- in message contexttargetURL
- URL of the edpoint which we are sending the request- Returns:
- true if proxy is enabled, false otherwise
-
-