Class ProxyMappings
java.lang.Object
org.keycloak.connections.httpclient.ProxyMappings
ProxyMappings
describes an ordered mapping for hostname regex patterns to a HttpHost
proxy.
Mappings can be created via valueOf(String...)
or valueOf(List)
.
For a description of the mapping format see ProxyMappings.ProxyMapping.valueOf(String)
- Author:
- Thomas Darimont
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ProxyMappings.ProxyMapping
describes a Proxy Mapping with a HostnamePattern
that is mapped to a proxyHttpHost
. -
Constructor Summary
ConstructorDescriptionProxyMappings
(List<ProxyMappings.ProxyMapping> entries) Creates aProxyMappings
from the providedEntries
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
getProxyFor
(String hostname) boolean
isEmpty()
static ProxyMappings
Creates a newProxyMappings
from the providedString[]
of proxy mapping strings.static ProxyMappings
Creates a newProxyMappings
from the providedList
of proxy mapping strings.static ProxyMappings
withFixedProxyMapping
(String httpProxy, String noProxy) Creates a newProxyMappings
from provided parameters representing the establishedHTTP(S)_PROXY
andNO_PROXY
environment variables.
-
Constructor Details
-
ProxyMappings
Creates aProxyMappings
from the providedEntries
.- Parameters:
entries
-
-
-
Method Details
-
valueOf
Creates a newProxyMappings
from the providedList
of proxy mapping strings.- Parameters:
proxyMappings
-
-
valueOf
Creates a newProxyMappings
from the providedString[]
of proxy mapping strings.- Parameters:
proxyMappings
-- Returns:
- See Also:
-
withFixedProxyMapping
Creates a newProxyMappings
from provided parameters representing the establishedHTTP(S)_PROXY
andNO_PROXY
environment variables.- Parameters:
httpProxy
- a proxy used for all hosts except the ones specified innoProxy
noProxy
- a list of hosts (separated by comma) that should not use proxy; all suffixes are matched too (e.g. redhat.com will also match access.redhat.com)- Returns:
- See Also:
-
isEmpty
public boolean isEmpty() -
getProxyFor
- Parameters:
hostname
-- Returns:
- the
ProxyMappings.ProxyMapping
associated with the first matching hostnamePattern
or theProxyMappings.ProxyMapping
including null asHttpHost
if none matches.
-
clearCache
public static void clearCache()
-