Java Code Examples for com.netflix.client.config.IClientConfig#containsProperty()
The following examples show how to use
com.netflix.client.config.IClientConfig#containsProperty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DiscoveryServerList.java From s2g-zuul with MIT License | 4 votes |
@Override public void initWithNiwsConfig(IClientConfig clientConfig) { clientName = clientConfig.getClientName(); isSecure = Boolean.parseBoolean("" + clientConfig.getProperty(CommonClientConfigKey.IsSecure, "false")); prioritizeVipAddressBasedServers = Boolean.parseBoolean("" + clientConfig .getProperty(CommonClientConfigKey.PrioritizeVipAddressBasedServers, prioritizeVipAddressBasedServers)); datacenter = ConfigurationManager.getDeploymentContext().getDeploymentDatacenter(); targetRegion = (String) clientConfig.getProperty(CommonClientConfigKey.TargetRegion); shouldUseIpAddr = clientConfig.getPropertyAsBoolean(CommonClientConfigKey.UseIPAddrForServer, DefaultClientConfigImpl.DEFAULT_USEIPADDRESS_FOR_SERVER); // override client configuration and use client-defined port if (clientConfig.getPropertyAsBoolean(CommonClientConfigKey.ForceClientPortConfiguration, false)) { if (isSecure) { if (clientConfig.containsProperty(CommonClientConfigKey.SecurePort)) { overridePort = clientConfig.getPropertyAsInteger(CommonClientConfigKey.SecurePort, DefaultClientConfigImpl.DEFAULT_PORT); shouldUseOverridePort = true; } else { logger.warn(clientName + " set to force client port but no secure port is set, so ignoring"); } } else { if (clientConfig.containsProperty(CommonClientConfigKey.Port)) { overridePort = clientConfig.getPropertyAsInteger(CommonClientConfigKey.Port, DefaultClientConfigImpl.DEFAULT_PORT); shouldUseOverridePort = true; } else { logger.warn(clientName + " set to force client port but no port is set, so ignoring"); } } } }
Example 2
Source File: RestClient.java From s2g-zuul with MIT License | 3 votes |
private boolean getBooleanFromConfig(IClientConfig overriddenClientConfig, IClientConfigKey key, boolean defaultValue){ if(overriddenClientConfig != null && overriddenClientConfig.containsProperty(key)){ defaultValue = Boolean.parseBoolean(overriddenClientConfig.getProperty(key).toString()); } return defaultValue; }