Class ProxyConfig
- java.lang.Object
-
- org.apache.synapse.transport.http.conn.ProxyConfig
-
public class ProxyConfig extends Object
-
-
Constructor Summary
Constructors Constructor Description ProxyConfig(org.apache.http.HttpHost proxy, org.apache.http.auth.UsernamePasswordCredentials creds, String[] proxyBypass, Map<String,ProxyProfileConfig> proxyProfileMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProxyAuthenticatorcreateProxyAuthenticator()returns DefaultProxyAuthenticator if single proxy server is configured ProfileProxyAuthenticator if proxy profile is configuredorg.apache.http.auth.UsernamePasswordCredentialsgetCredentialsForTargetHost(String targetHost)select the proxy credential for the targetHostorg.apache.http.auth.UsernamePasswordCredentialsgetCreds()org.apache.http.HttpHostgetProxy()Set<String>getProxyBypass()booleanisProxyProfileConfigured()checks weather the proxy profile map is emptyStringlogProxyConfig()returns appropriate log message based on the proxy configuration whether loading proxy profile or single proxy server or no proxy configuredorg.apache.http.HttpHostselectProxy(org.apache.http.HttpHost target)Selects the configured proxy serverStringtoString()
-
-
-
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()
-
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
-
-