public final class RibbonUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAMESPACE
Default Ribbon namespace.
|
static String |
VALUE_NOT_SET
Used to verify if property value is set.
|
| Modifier and Type | Method and Description |
|---|---|
static com.netflix.config.DynamicStringProperty |
getProperty(String key) |
static String |
getRibbonKey(String serviceId,
String suffix) |
static void |
initializeRibbonDefaults(String serviceId) |
static boolean |
isSecure(com.netflix.client.config.IClientConfig config,
ServerIntrospector serverIntrospector,
com.netflix.loadbalancer.Server server)
Determine if client is secure.
|
static void |
setRibbonProperty(String serviceId,
String suffix,
String value) |
static URI |
updateToHttpsIfNeeded(URI uri,
com.netflix.client.config.IClientConfig config,
ServerIntrospector serverIntrospector,
com.netflix.loadbalancer.Server server)
|
static URI |
updateToSecureConnectionIfNeeded(URI uri,
com.netflix.client.config.IClientConfig config,
ServerIntrospector serverIntrospector,
com.netflix.loadbalancer.Server server)
Replace the scheme to the secure variant if needed.
|
public static final String VALUE_NOT_SET
public static final String DEFAULT_NAMESPACE
public static void initializeRibbonDefaults(String serviceId)
public static void setRibbonProperty(String serviceId, String suffix, String value)
public static com.netflix.config.DynamicStringProperty getProperty(String key)
public static boolean isSecure(com.netflix.client.config.IClientConfig config,
ServerIntrospector serverIntrospector,
com.netflix.loadbalancer.Server server)
IClientConfig has the
CommonClientConfigKey.IsSecure set, return that value. Otherwise, query the
supplied ServerIntrospector.config - the supplied client configuration.serverIntrospector - used to verify if the server provides secure connectionsserver - to verifypublic static URI updateToHttpsIfNeeded(URI uri, com.netflix.client.config.IClientConfig config, ServerIntrospector serverIntrospector, com.netflix.loadbalancer.Server server)
updateToSecureConnectionIfNeeded(java.net.URI, org.springframework.cloud.client.ServiceInstance)isSecure(IClientConfig, ServerIntrospector, Server) is true, update the
scheme. This assumes the uri is already encoded to avoid double encoding.uri - to modify if requiredconfig - Ribbon IClientConfig configurationserverIntrospector - used to verify if the server provides secure connectionsserver - to verifyURI updated to https if necessarypublic static URI updateToSecureConnectionIfNeeded(URI uri, com.netflix.client.config.IClientConfig config, ServerIntrospector serverIntrospector, com.netflix.loadbalancer.Server server)
unsecureSchemeMapping map contains the uri scheme and
isSecure(IClientConfig, ServerIntrospector, Server) is true, update the
scheme. This assumes the uri is already encoded to avoid double encoding.uri - to modify if requiredconfig - the supplied client configurationserverIntrospector - used to verify if the server provides secure connectionsserver - to verifyURI updated if requiredCopyright © 2021 Pivotal Software, Inc.. All rights reserved.