Class ProxyMappings
- java.lang.Object
-
- org.keycloak.connections.httpclient.ProxyMappings
-
public class ProxyMappings extends Object
ProxyMappingsdescribes an ordered mapping for hostname regex patterns to aHttpHostproxy.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 classProxyMappings.ProxyMappingProxyMappings.ProxyMappingdescribes a Proxy Mapping with a HostnamePatternthat is mapped to a proxyHttpHost.
-
Constructor Summary
Constructors Constructor Description ProxyMappings(List<ProxyMappings.ProxyMapping> entries)Creates aProxyMappingsfrom the providedEntries.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearCache()ProxyMappings.ProxyMappinggetProxyFor(String hostname)booleanisEmpty()static ProxyMappingsvalueOf(String... proxyMappings)Creates a newProxyMappingsfrom the providedString[]of proxy mapping strings.static ProxyMappingsvalueOf(List<String> proxyMappings)Creates a newProxyMappingsfrom the providedListof proxy mapping strings.static ProxyMappingswithFixedProxyMapping(String httpProxy, String noProxy)Creates a newProxyMappingsfrom provided parameters representing the establishedHTTP(S)_PROXYandNO_PROXYenvironment variables.
-
-
-
Constructor Detail
-
ProxyMappings
public ProxyMappings(List<ProxyMappings.ProxyMapping> entries)
Creates aProxyMappingsfrom the providedEntries.- Parameters:
entries-
-
-
Method Detail
-
valueOf
public static ProxyMappings valueOf(List<String> proxyMappings)
Creates a newProxyMappingsfrom the providedListof proxy mapping strings.- Parameters:
proxyMappings-
-
valueOf
public static ProxyMappings valueOf(String... proxyMappings)
Creates a newProxyMappingsfrom 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 newProxyMappingsfrom provided parameters representing the establishedHTTP(S)_PROXYandNO_PROXYenvironment variables.- Parameters:
httpProxy- a proxy used for all hosts except the ones specified innoProxynoProxy- 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.ProxyMappingassociated with the first matching hostnamePatternor theProxyMappings.ProxyMappingincluding null asHttpHostif none matches.
-
clearCache
public static void clearCache()
-
-