Package org.apache.zookeeper.client
Class ZKClientConfig
- java.lang.Object
- 
- org.apache.zookeeper.common.ZKConfig
- 
- org.apache.zookeeper.client.ZKClientConfig
 
 
- 
 @Public public class ZKClientConfig extends ZKConfig Handles client specific properties- Since:
- 3.5.2
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intCLIENT_MAX_PACKET_LENGTH_DEFAULTstatic StringDISABLE_AUTO_WATCH_RESETThis controls whether automatic watch resetting is enabled.static StringENABLE_CLIENT_SASL_DEFAULTstatic StringENABLE_CLIENT_SASL_KEYstatic StringLOGIN_CONTEXT_NAME_KEYstatic StringLOGIN_CONTEXT_NAME_KEY_DEFAULTstatic StringSECURE_CLIENTSetting this to "true" will enable encrypted client-server communication.static StringZK_SASL_CLIENT_CANONICALIZE_HOSTNAMEstatic StringZK_SASL_CLIENT_CANONICALIZE_HOSTNAME_DEFAULTstatic StringZK_SASL_CLIENT_USERNAMEstatic StringZK_SASL_CLIENT_USERNAME_DEFAULTstatic StringZOOKEEPER_CLIENT_CNXN_SOCKETstatic StringZOOKEEPER_REQUEST_TIMEOUTstatic longZOOKEEPER_REQUEST_TIMEOUT_DEFAULTFeature is disabled by default.static StringZOOKEEPER_SERVER_PRINCIPALstatic StringZOOKEEPER_SERVER_REALM- 
Fields inherited from class org.apache.zookeeper.common.ZKConfigJGSS_NATIVE, JUTE_MAXBUFFER, KINIT_COMMAND
 
- 
 - 
Constructor SummaryConstructors Constructor Description ZKClientConfig()ZKClientConfig(File configFile)ZKClientConfig(String configPath)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLong(String key, long defaultValue)Get the value of thekeyproperty as anlong.protected voidhandleBackwardCompatibility()Now onwards client code will use properties from this class but older clients still be setting properties through system properties.booleanisSaslClientEnabled()Returns true if the SASL client is enabled.- 
Methods inherited from class org.apache.zookeeper.common.ZKConfigaddConfiguration, addConfiguration, getBoolean, getBoolean, getInt, getJaasConfKey, getProperty, getProperty, setProperty
 
- 
 
- 
- 
- 
Field Detail- 
ZK_SASL_CLIENT_USERNAMEpublic static final String ZK_SASL_CLIENT_USERNAME - See Also:
- Constant Field Values
 
 - 
ZK_SASL_CLIENT_USERNAME_DEFAULTpublic static final String ZK_SASL_CLIENT_USERNAME_DEFAULT - See Also:
- Constant Field Values
 
 - 
ZK_SASL_CLIENT_CANONICALIZE_HOSTNAMEpublic static final String ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME - See Also:
- Constant Field Values
 
 - 
ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME_DEFAULTpublic static final String ZK_SASL_CLIENT_CANONICALIZE_HOSTNAME_DEFAULT - See Also:
- Constant Field Values
 
 - 
LOGIN_CONTEXT_NAME_KEYpublic static final String LOGIN_CONTEXT_NAME_KEY - See Also:
- Constant Field Values
 
 - 
LOGIN_CONTEXT_NAME_KEY_DEFAULTpublic static final String LOGIN_CONTEXT_NAME_KEY_DEFAULT - See Also:
- Constant Field Values
 
 - 
ENABLE_CLIENT_SASL_KEYpublic static final String ENABLE_CLIENT_SASL_KEY - See Also:
- Constant Field Values
 
 - 
ENABLE_CLIENT_SASL_DEFAULTpublic static final String ENABLE_CLIENT_SASL_DEFAULT - See Also:
- Constant Field Values
 
 - 
ZOOKEEPER_SERVER_REALMpublic static final String ZOOKEEPER_SERVER_REALM - See Also:
- Constant Field Values
 
 - 
DISABLE_AUTO_WATCH_RESETpublic static final String DISABLE_AUTO_WATCH_RESET This controls whether automatic watch resetting is enabled. Clients automatically reset watches during session reconnect, this option allows the client to turn off this behavior by setting the property "zookeeper.disableAutoWatchReset" to "true"- See Also:
- Constant Field Values
 
 - 
ZOOKEEPER_CLIENT_CNXN_SOCKETpublic static final String ZOOKEEPER_CLIENT_CNXN_SOCKET - See Also:
- Constant Field Values
 
 - 
SECURE_CLIENTpublic static final String SECURE_CLIENT Setting this to "true" will enable encrypted client-server communication.- See Also:
- Constant Field Values
 
 - 
CLIENT_MAX_PACKET_LENGTH_DEFAULTpublic static final int CLIENT_MAX_PACKET_LENGTH_DEFAULT - See Also:
- Constant Field Values
 
 - 
ZOOKEEPER_REQUEST_TIMEOUTpublic static final String ZOOKEEPER_REQUEST_TIMEOUT - See Also:
- Constant Field Values
 
 - 
ZOOKEEPER_SERVER_PRINCIPALpublic static final String ZOOKEEPER_SERVER_PRINCIPAL - See Also:
- Constant Field Values
 
 - 
ZOOKEEPER_REQUEST_TIMEOUT_DEFAULTpublic static final long ZOOKEEPER_REQUEST_TIMEOUT_DEFAULT Feature is disabled by default.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ZKClientConfigpublic ZKClientConfig() 
 - 
ZKClientConfigpublic ZKClientConfig(File configFile) throws QuorumPeerConfig.ConfigException - Throws:
- QuorumPeerConfig.ConfigException
 
 - 
ZKClientConfigpublic ZKClientConfig(String configPath) throws QuorumPeerConfig.ConfigException - Throws:
- QuorumPeerConfig.ConfigException
 
 
- 
 - 
Method Detail- 
handleBackwardCompatibilityprotected void handleBackwardCompatibility() Description copied from class:ZKConfigNow onwards client code will use properties from this class but older clients still be setting properties through system properties. So to make this change backward compatible we should set old system properties in this configuration.- Overrides:
- handleBackwardCompatibilityin class- ZKConfig
 
 - 
isSaslClientEnabledpublic boolean isSaslClientEnabled() Returns true if the SASL client is enabled. By default, the client is enabled but can be disabled by setting the system propertyzookeeper.sasl.clienttofalse. See ZOOKEEPER-1657 for more information.- Returns:
- true if the SASL client is enabled.
 
 - 
getLongpublic long getLong(String key, long defaultValue) Get the value of thekeyproperty as anlong. If property is not set, the provideddefaultValueis returned- Parameters:
- key- property key.
- defaultValue- default value.
- Returns:
- return property value as an long, ordefaultValue
- Throws:
- NumberFormatException- when the value is invalid
 
 
- 
 
-