Class HTTPProxyConfigurator
java.lang.Object
org.apache.axis2.transport.http.impl.httpclient5.HTTPProxyConfigurator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(org.apache.axis2.context.MessageContext messageContext, org.apache.hc.client5.http.config.RequestConfig.Builder requestConfig, org.apache.hc.client5.http.protocol.HttpClientContext clientContext) Configure HTTP Proxy settings of httpcomponents HostConfiguration.static booleanisHostInNonProxyList(String host, String nonProxyHosts) Check if the specified host is in the list of non proxy hosts.static booleanisProxyEnabled(org.apache.axis2.context.MessageContext messageContext, URL targetURL) Check whether http proxy is configured or active.
-
Constructor Details
-
HTTPProxyConfigurator
public HTTPProxyConfigurator()
-
-
Method Details
-
configure
public static void configure(org.apache.axis2.context.MessageContext messageContext, org.apache.hc.client5.http.config.RequestConfig.Builder requestConfig, org.apache.hc.client5.http.protocol.HttpClientContext clientContext) throws org.apache.axis2.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:
org.apache.axis2.AxisFault- if Proxy settings are invalid
-
isProxyEnabled
public static boolean isProxyEnabled(org.apache.axis2.context.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
-
isHostInNonProxyList
Check if the specified host is in the list of non proxy hosts.- Parameters:
host- host namenonProxyHosts- string containing the list of non proxy hosts- Returns:
- true/false
-