Package org.apache.zookeeper.client
Class ZooKeeperSaslClient
- java.lang.Object
-
- org.apache.zookeeper.client.ZooKeeperSaslClient
-
public class ZooKeeperSaslClient extends Object
This class manages SASL authentication for the client. It allows ClientCnxn to authenticate using SASL with a ZooKeeper server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZooKeeperSaslClient.SaslStatestatic classZooKeeperSaslClient.ServerSaslResponseCallback
-
Field Summary
Fields Modifier and Type Field Description static StringENABLE_CLIENT_SASL_DEFAULTDeprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_DEFAULTinstead.static StringENABLE_CLIENT_SASL_KEYDeprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEYinstead.static StringLOGIN_CONTEXT_NAME_KEYDeprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEYinstead.
-
Constructor Summary
Constructors Constructor Description ZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig, AtomicReference<Login> loginRef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanclientTunneledAuthenticationInProgress()StringgetConfigStatus()Watcher.Event.KeeperStategetKeeperState()StringgetLoginContext()ZooKeeperSaslClient.SaslStategetSaslState()voidinitialize(ClientCnxn cnxn)booleanisComplete()static booleanisEnabled()Deprecated.UseZKClientConfig.isSaslClientEnabled()insteadbooleanisFailed()voidrespondToServer(byte[] serverToken, ClientCnxn cnxn)
-
-
-
Field Detail
-
LOGIN_CONTEXT_NAME_KEY
@Deprecated public static final String LOGIN_CONTEXT_NAME_KEY
Deprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEYinstead.- See Also:
- Constant Field Values
-
ENABLE_CLIENT_SASL_KEY
@Deprecated public static final String ENABLE_CLIENT_SASL_KEY
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEYinstead.- See Also:
- Constant Field Values
-
ENABLE_CLIENT_SASL_DEFAULT
@Deprecated public static final String ENABLE_CLIENT_SASL_DEFAULT
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_DEFAULTinstead.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ZooKeeperSaslClient
public ZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig, AtomicReference<Login> loginRef) throws LoginException
- Throws:
LoginException
-
-
Method Detail
-
isEnabled
@Deprecated public static boolean isEnabled()
Deprecated.UseZKClientConfig.isSaslClientEnabled()insteadReturns 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.
-
getSaslState
public ZooKeeperSaslClient.SaslState getSaslState()
-
getLoginContext
public String getLoginContext()
-
getConfigStatus
public String getConfigStatus()
- Returns:
- informational message indicating the current configuration status.
-
isComplete
public boolean isComplete()
-
isFailed
public boolean isFailed()
-
respondToServer
public void respondToServer(byte[] serverToken, ClientCnxn cnxn)
-
getKeeperState
public Watcher.Event.KeeperState getKeeperState()
-
initialize
public void initialize(ClientCnxn cnxn) throws SaslException
- Throws:
SaslException
-
clientTunneledAuthenticationInProgress
public boolean clientTunneledAuthenticationInProgress()
-
-