public class RibbonUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAMESPACE |
static String |
VALUE_NOT_SET |
Constructor and Description |
---|
RibbonUtils() |
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
- server
- public 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
- config
- serverIntrospector
- server
- public 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
- config
- serverIntrospector
- server
- Copyright © 2018 Pivotal Software, Inc.. All rights reserved.