Class ProxyConfig


  • public class ProxyConfig
    extends Object
    • Constructor Detail

      • ProxyConfig

        public ProxyConfig​(org.apache.http.HttpHost proxy,
                           org.apache.http.auth.UsernamePasswordCredentials creds,
                           String[] proxyBypass,
                           Map<String,​ProxyProfileConfig> proxyProfileMap)
    • Method Detail

      • getProxy

        public org.apache.http.HttpHost getProxy()
      • getCreds

        public org.apache.http.auth.UsernamePasswordCredentials getCreds()
      • getProxyBypass

        public Set<String> getProxyBypass()
      • selectProxy

        public org.apache.http.HttpHost selectProxy​(org.apache.http.HttpHost target)
        Selects the configured proxy server
        Parameters:
        target - request endpoint
        Returns:
        proxy host based on the proxy profile or http.proxyHost, null when no proxy is configured or if the target is matched with proxy bypass
      • isProxyProfileConfigured

        public boolean isProxyProfileConfigured()
        checks weather the proxy profile map is empty
        Returns:
        true if proxy profile map is not empty, false otherwise
      • getCredentialsForTargetHost

        public org.apache.http.auth.UsernamePasswordCredentials getCredentialsForTargetHost​(String targetHost)
        select the proxy credential for the targetHost
        Parameters:
        targetHost - targeted host
        Returns:
        proxy credential for the given end point, if not returns null
      • logProxyConfig

        public String logProxyConfig()
        returns appropriate log message based on the proxy configuration whether loading proxy profile or single proxy server or no proxy configured
        Returns:
        log message
      • createProxyAuthenticator

        public ProxyAuthenticator createProxyAuthenticator()
                                                    throws org.apache.axis2.AxisFault
        returns DefaultProxyAuthenticator if single proxy server is configured ProfileProxyAuthenticator if proxy profile is configured
        Returns:
        ProxyAuthenticator, if proxy is not configured null
        Throws:
        org.apache.axis2.AxisFault