Package org.apache.bookkeeper.sasl
Class SASLClientProviderFactory
java.lang.Object
org.apache.bookkeeper.sasl.SASLClientProviderFactory
- All Implemented Interfaces:
ClientAuthProvider.Factory,JAASCredentialsContainer
public class SASLClientProviderFactory
extends Object
implements ClientAuthProvider.Factory, JAASCredentialsContainer
ClientAuthProvider which uses JDK-bundled SASL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release resources.getLogin()Get Auth provider plugin name.voidinit(ClientConfiguration conf) Initialize the factory with the client configuration and protobuf message registry.booleannewProvider(ClientConnectionPeer addr, AuthCallbacks.GenericCallback<Void> completeCb) Create a new instance of a client auth provider.voidsetLogin(LoginContext login)
-
Constructor Details
-
SASLClientProviderFactory
public SASLClientProviderFactory()
-
-
Method Details
-
init
Description copied from interface:ClientAuthProvider.FactoryInitialize the factory with the client configuration and protobuf message registry. Implementors must add any extension messages which contain the auth payload, so that the client can decode auth messages it receives from the server.- Specified by:
initin interfaceClientAuthProvider.Factory- Throws:
IOException
-
newProvider
public ClientAuthProvider newProvider(ClientConnectionPeer addr, AuthCallbacks.GenericCallback<Void> completeCb) Description copied from interface:ClientAuthProvider.FactoryCreate a new instance of a client auth provider. Each connection should get its own instance, as they can hold connection specific state. The completeCb is used to notify the client that the authentication handshake is complete. CompleteCb should be called only once. If the authentication was successful, BKException.Code.OK should be passed as the return code. Otherwise, another error code should be passed.- Specified by:
newProviderin interfaceClientAuthProvider.Factory- Parameters:
addr- an handle to the connectioncompleteCb- callback to be notified when authentication is complete.
-
getPluginName
Description copied from interface:ClientAuthProvider.FactoryGet Auth provider plugin name. Used as a sanity check to ensure that the bookie and the client. are using the same auth provider.- Specified by:
getPluginNamein interfaceClientAuthProvider.Factory
-
close
public void close()Description copied from interface:ClientAuthProvider.FactoryRelease resources.- Specified by:
closein interfaceClientAuthProvider.Factory
-
getLogin
- Specified by:
getLoginin interfaceJAASCredentialsContainer
-
setLogin
- Specified by:
setLoginin interfaceJAASCredentialsContainer
-
getSubject
- Specified by:
getSubjectin interfaceJAASCredentialsContainer
-
isUsingTicketCache
public boolean isUsingTicketCache()- Specified by:
isUsingTicketCachein interfaceJAASCredentialsContainer
-
getPrincipal
- Specified by:
getPrincipalin interfaceJAASCredentialsContainer
-
getConfiguration
- Specified by:
getConfigurationin interfaceJAASCredentialsContainer
-
getLoginContextName
- Specified by:
getLoginContextNamein interfaceJAASCredentialsContainer
-