Class HTTPProxyConfigurator

java.lang.Object
org.apache.axis2.transport.http.impl.httpclient5.HTTPProxyConfigurator

public class HTTPProxyConfigurator extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    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(org.apache.axis2.context.MessageContext messageContext, URL targetURL)
    Check whether http proxy is configured or active.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 for
      requestConfig - the request configuration to fill in
      clientContext - 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 context
      targetURL - URL of the edpoint which we are sending the request
      Returns:
      true if proxy is enabled, false otherwise
    • isHostInNonProxyList

      public static boolean isHostInNonProxyList(String host, String nonProxyHosts)
      Check if the specified host is in the list of non proxy hosts.
      Parameters:
      host - host name
      nonProxyHosts - string containing the list of non proxy hosts
      Returns:
      true/false