Class ProxyConfig
java.lang.Object
org.apache.synapse.transport.http.conn.ProxyConfig
-
Constructor Summary
ConstructorsConstructorDescriptionProxyConfig(org.apache.http.HttpHost proxy, org.apache.http.auth.UsernamePasswordCredentials creds, String[] proxyBypass, Map<String, ProxyProfileConfig> proxyProfileMap) -
Method Summary
Modifier and TypeMethodDescriptionreturns 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()booleanchecks weather the proxy profile map is emptyreturns 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 servertoString()
-
Constructor Details
-
ProxyConfig
public ProxyConfig(org.apache.http.HttpHost proxy, org.apache.http.auth.UsernamePasswordCredentials creds, String[] proxyBypass, Map<String, ProxyProfileConfig> proxyProfileMap)
-
-
Method Details
-
getProxy
public org.apache.http.HttpHost getProxy() -
getCreds
public org.apache.http.auth.UsernamePasswordCredentials getCreds() -
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
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
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
-
toString
-