|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.netflix.client.config.DefaultClientConfigImpl
public class DefaultClientConfigImpl
Default client configuration that loads properties from Archaius's ConfigurationManager.
The easiest way to configure client and load balancer is through loading properties into Archaius that conform to the specific format:
<clientName>.<nameSpace>.<propertyName>=<value>
You can define properties in a file on classpath or as system properties. If former, ConfigurationManager.loadPropertiesFromResources() API should be called to load the file.
By default, "ribbon" should be the nameSpace.
If there is no property specified for a named client, ClientFactory
will still create the client and
load balancer with default values for all necessary properties. The default
values are specified in this class as constants.
If a property is missing the clientName, it is interpreted as a property that applies to all clients. For example
ribbon.ReadTimeout=1000
This will establish the default ReadTimeout property for all clients.
You can also programmatically set properties by constructing instance of DefaultClientConfigImpl. Follow these steps:
getClientConfigWithDefaultValues(String)
to load default values,
and any properties that are already defined with Configuration in Archaius
setProperty(IClientConfigKey, Object)
API.
ClientFactory
API.
If it is desired to have properties defined in a different name space, for example, "foo"
myclient.foo.ReadTimeout=1000
You should use getClientConfigWithDefaultValues(String, String)
- in the first step above.
Constructor Summary | |
---|---|
DefaultClientConfigImpl()
Create instance with no properties in default name space DEFAULT_PROPERTY_NAME_SPACE |
|
DefaultClientConfigImpl(java.lang.String nameSpace)
Create instance with no properties in the specified name space |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Boolean DEFAULT_PRIORITIZE_VIP_ADDRESS_BASED_SERVERS
public static final java.lang.String DEFAULT_NFLOADBALANCER_PING_CLASSNAME
public static final java.lang.String DEFAULT_NFLOADBALANCER_RULE_CLASSNAME
public static final java.lang.String DEFAULT_NFLOADBALANCER_CLASSNAME
public static final java.lang.String DEFAULT_CLIENT_CLASSNAME
public static final java.lang.String DEFAULT_VIPADDRESS_RESOLVER_CLASSNAME
public static final java.lang.String DEFAULT_PRIME_CONNECTIONS_URI
public static final int DEFAULT_MAX_TOTAL_TIME_TO_PRIME_CONNECTIONS
public static final int DEFAULT_MAX_RETRIES_PER_SERVER_PRIME_CONNECTION
public static final java.lang.Boolean DEFAULT_ENABLE_PRIME_CONNECTIONS
public static final int DEFAULT_MAX_REQUESTS_ALLOWED_PER_WINDOW
public static final int DEFAULT_REQUEST_THROTTLING_WINDOW_IN_MILLIS
public static final java.lang.Boolean DEFAULT_ENABLE_REQUEST_THROTTLING
public static final java.lang.Boolean DEFAULT_ENABLE_GZIP_CONTENT_ENCODING_FILTER
public static final java.lang.Boolean DEFAULT_CONNECTION_POOL_CLEANER_TASK_ENABLED
public static final java.lang.Boolean DEFAULT_FOLLOW_REDIRECTS
public static final float DEFAULT_PERCENTAGE_NIWS_EVENT_LOGGED
public static final int DEFAULT_MAX_AUTO_RETRIES_NEXT_SERVER
public static final int DEFAULT_MAX_AUTO_RETRIES
public static final int DEFAULT_READ_TIMEOUT
public static final int DEFAULT_CONNECTION_MANAGER_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_MAX_HTTP_CONNECTIONS_PER_HOST
public static final int DEFAULT_MAX_TOTAL_HTTP_CONNECTIONS
public static final float DEFAULT_MIN_PRIME_CONNECTIONS_RATIO
public static final java.lang.String DEFAULT_PRIME_CONNECTIONS_CLASS
public static final java.lang.String DEFAULT_SEVER_LIST_CLASS
public static final int DEFAULT_CONNECTION_IDLE_TIMERTASK_REPEAT_IN_MSECS
public static final int DEFAULT_CONNECTIONIDLE_TIME_IN_MSECS
public static final int DEFAULT_POOL_MAX_THREADS
public static final int DEFAULT_POOL_MIN_THREADS
public static final long DEFAULT_POOL_KEEP_ALIVE_TIME
public static final java.util.concurrent.TimeUnit DEFAULT_POOL_KEEP_ALIVE_TIME_UNITS
public static final java.lang.Boolean DEFAULT_ENABLE_ZONE_AFFINITY
public static final java.lang.Boolean DEFAULT_ENABLE_ZONE_EXCLUSIVITY
public static final int DEFAULT_PORT
public static final java.lang.Boolean DEFAULT_ENABLE_LOADBALANCER
public static final java.lang.String DEFAULT_PROPERTY_NAME_SPACE
public static final java.lang.Boolean DEFAULT_OK_TO_RETRY_ON_ALL_OPERATIONS
public static final java.lang.Boolean DEFAULT_ENABLE_NIWS_EVENT_LOGGING
Constructor Detail |
---|
public DefaultClientConfigImpl()
DEFAULT_PROPERTY_NAME_SPACE
public DefaultClientConfigImpl(java.lang.String nameSpace)
Method Detail |
---|
public java.lang.Boolean getDefaultPrioritizeVipAddressBasedServers()
public java.lang.String getDefaultNfloadbalancerPingClassname()
public java.lang.String getDefaultNfloadbalancerRuleClassname()
public java.lang.String getDefaultNfloadbalancerClassname()
public java.lang.String getDefaultClientClassname()
public java.lang.String getDefaultVipaddressResolverClassname()
public java.lang.String getDefaultPrimeConnectionsUri()
public int getDefaultMaxTotalTimeToPrimeConnections()
public int getDefaultMaxRetriesPerServerPrimeConnection()
public java.lang.Boolean getDefaultEnablePrimeConnections()
public int getDefaultMaxRequestsAllowedPerWindow()
public int getDefaultRequestThrottlingWindowInMillis()
public java.lang.Boolean getDefaultEnableRequestThrottling()
public java.lang.Boolean getDefaultEnableGzipContentEncodingFilter()
public java.lang.Boolean getDefaultConnectionPoolCleanerTaskEnabled()
public java.lang.Boolean getDefaultFollowRedirects()
public float getDefaultPercentageNiwsEventLogged()
public int getDefaultMaxAutoRetriesNextServer()
public int getDefaultMaxAutoRetries()
public int getDefaultReadTimeout()
public int getDefaultConnectionManagerTimeout()
public int getDefaultConnectTimeout()
public int getDefaultMaxHttpConnectionsPerHost()
public int getDefaultMaxTotalHttpConnections()
public float getDefaultMinPrimeConnectionsRatio()
public java.lang.String getDefaultPrimeConnectionsClass()
public java.lang.String getDefaultSeverListClass()
public int getDefaultConnectionIdleTimertaskRepeatInMsecs()
public int getDefaultConnectionidleTimeInMsecs()
public VipAddressResolver getResolver()
public boolean isEnableDynamicProperties()
public int getDefaultPoolMaxThreads()
public int getDefaultPoolMinThreads()
public long getDefaultPoolKeepAliveTime()
public java.util.concurrent.TimeUnit getDefaultPoolKeepAliveTimeUnits()
public java.lang.Boolean getDefaultEnableZoneAffinity()
public java.lang.Boolean getDefaultEnableZoneExclusivity()
public int getDefaultPort()
public java.lang.Boolean getDefaultEnableLoadbalancer()
public java.lang.Boolean getDefaultOkToRetryOnAllOperations()
protected void loadDefaultValues()
public java.lang.String getDefaultPropName(IClientConfigKey propName)
public void setClientName(java.lang.String clientName)
public java.lang.String getClientName()
getClientName
in interface IClientConfig
public void loadProperties(java.lang.String restClientName)
loadProperties
in interface IClientConfig
public java.lang.String resolveDeploymentContextbasedVipAddresses()
IClientConfig
resolveDeploymentContextbasedVipAddresses
in interface IClientConfig
public java.lang.String getAppName()
public java.lang.String getVersion()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface IClientConfig
public void setProperty(IClientConfigKey key, java.lang.Object value)
setProperty
in interface IClientConfig
public IClientConfig applyOverride(IClientConfig override)
public java.lang.Object getProperty(IClientConfigKey key)
getProperty
in interface IClientConfig
public java.lang.Object getProperty(IClientConfigKey key, java.lang.Object defaultVal)
getProperty
in interface IClientConfig
public static java.lang.Object getProperty(java.util.Map<java.lang.String,java.lang.Object> config, IClientConfigKey key, java.lang.Object defaultVal)
public static java.lang.Object getProperty(java.util.Map<java.lang.String,java.lang.Object> config, IClientConfigKey key)
public boolean isSecure()
public boolean containsProperty(IClientConfigKey key)
containsProperty
in interface IClientConfig
public java.lang.String toString()
toString
in class java.lang.Object
public void setProperty(java.util.Properties props, java.lang.String restClientName, java.lang.String key, java.lang.String value)
public java.lang.String getInstancePropName(java.lang.String restClientName, IClientConfigKey configKey)
public java.lang.String getInstancePropName(java.lang.String restClientName, java.lang.String key)
public java.lang.String getNameSpace()
getNameSpace
in interface IClientConfig
public static DefaultClientConfigImpl getClientConfigWithDefaultValues(java.lang.String clientName)
public static DefaultClientConfigImpl getClientConfigWithDefaultValues(java.lang.String clientName, java.lang.String nameSpace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |