Class ProxyMappings
- java.lang.Object
-
- org.keycloak.connections.httpclient.ProxyMappings
-
public class ProxyMappings extends Object
ProxyMappings
describes an ordered mapping for hostname regex patterns to aHttpHost
proxy.Mappings can be created via
valueOf(String...)
orvalueOf(List)
. For a description of the mapping format seeProxyMappings.ProxyMapping.valueOf(String)
- Author:
- Thomas Darimont
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProxyMappings.ProxyMapping
ProxyMappings.ProxyMapping
describes a Proxy Mapping with a HostnamePattern
that is mapped to a proxyHttpHost
.
-
Constructor Summary
Constructors Constructor Description ProxyMappings(List<ProxyMappings.ProxyMapping> entries)
Creates aProxyMappings
from the providedEntries
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearCache()
ProxyMappings.ProxyMapping
getProxyFor(String hostname)
boolean
isEmpty()
static ProxyMappings
valueOf(String... proxyMappings)
Creates a newProxyMappings
from the providedString[]
of proxy mapping strings.static ProxyMappings
valueOf(List<String> 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 Detail
-
ProxyMappings
public ProxyMappings(List<ProxyMappings.ProxyMapping> entries)
Creates aProxyMappings
from the providedEntries
.- Parameters:
entries
-
-
-
Method Detail
-
valueOf
public static ProxyMappings valueOf(List<String> proxyMappings)
Creates a newProxyMappings
from the providedList
of proxy mapping strings.- Parameters:
proxyMappings
-
-
valueOf
public static ProxyMappings valueOf(String... proxyMappings)
Creates a newProxyMappings
from the providedString[]
of proxy mapping strings.- Parameters:
proxyMappings
-- Returns:
- See Also:
valueOf(List)
,valueOf(String...)
-
withFixedProxyMapping
public static ProxyMappings withFixedProxyMapping(String httpProxy, String noProxy)
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:
- https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/
-
isEmpty
public boolean isEmpty()
-
getProxyFor
public ProxyMappings.ProxyMapping getProxyFor(String hostname)
- 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()
-
-