Package org.apache.zookeeper.client
Class ZooKeeperSaslClient
- java.lang.Object
-
- org.apache.zookeeper.client.ZooKeeperSaslClient
-
public class ZooKeeperSaslClient extends java.lang.ObjectThis 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 java.lang.StringENABLE_CLIENT_SASL_DEFAULTstatic java.lang.StringENABLE_CLIENT_SASL_KEYstatic java.lang.StringLOGIN_CONTEXT_NAME_KEY
-
Constructor Summary
Constructors Constructor Description ZooKeeperSaslClient(java.lang.String serverPrincipal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclientTunneledAuthenticationInProgress()java.lang.StringgetConfigStatus()Watcher.Event.KeeperStategetKeeperState()java.lang.StringgetLoginContext()ZooKeeperSaslClient.SaslStategetSaslState()voidinitialize(ClientCnxn cnxn)booleanisComplete()static booleanisEnabled()Returns true if the SASL client is enabled.booleanisFailed()voidrespondToServer(byte[] serverToken, ClientCnxn cnxn)
-
-
-
Field Detail
-
LOGIN_CONTEXT_NAME_KEY
public static final java.lang.String LOGIN_CONTEXT_NAME_KEY
- See Also:
- Constant Field Values
-
ENABLE_CLIENT_SASL_KEY
public static final java.lang.String ENABLE_CLIENT_SASL_KEY
- See Also:
- Constant Field Values
-
ENABLE_CLIENT_SASL_DEFAULT
public static final java.lang.String ENABLE_CLIENT_SASL_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public static boolean isEnabled()
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:
- If the SASL client is enabled.
-
getSaslState
public ZooKeeperSaslClient.SaslState getSaslState()
-
getLoginContext
public java.lang.String getLoginContext()
-
getConfigStatus
public java.lang.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 javax.security.sasl.SaslException
- Throws:
javax.security.sasl.SaslException
-
clientTunneledAuthenticationInProgress
public boolean clientTunneledAuthenticationInProgress()
-
-