Package org.apache.bookkeeper.sasl
Class SASLBookieAuthProviderFactory
- java.lang.Object
-
- org.apache.bookkeeper.sasl.SASLBookieAuthProviderFactory
-
- All Implemented Interfaces:
BookieAuthProvider.Factory,JAASCredentialsContainer
public class SASLBookieAuthProviderFactory extends java.lang.Object implements BookieAuthProvider.Factory, JAASCredentialsContainer
BookieAuthProvider which uses JDK-bundled SASL.
-
-
Constructor Summary
Constructors Constructor Description SASLBookieAuthProviderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Release resources.AbstractConfigurationgetConfiguration()javax.security.auth.login.LoginContextgetLogin()java.lang.StringgetLoginContextName()java.lang.StringgetPluginName()Get Auth provider plugin name.java.lang.StringgetPrincipal()javax.security.auth.SubjectgetSubject()voidinit(ServerConfiguration conf)Initialize the factory with the server configuration and protobuf message registry.booleanisUsingTicketCache()BookieAuthProvidernewProvider(BookieConnectionPeer addr, AuthCallbacks.GenericCallback<java.lang.Void> completeCb)Create a new instance of a bookie auth provider.voidsetLogin(javax.security.auth.login.LoginContext login)
-
-
-
Method Detail
-
init
public void init(ServerConfiguration conf) throws java.io.IOException
Description copied from interface:BookieAuthProvider.FactoryInitialize the factory with the server configuration and protobuf message registry. Implementors must add any extension messages which contain the auth payload, so that the server can decode auth messages it receives from the client.- Specified by:
initin interfaceBookieAuthProvider.Factory- Throws:
java.io.IOException
-
newProvider
public BookieAuthProvider newProvider(BookieConnectionPeer addr, AuthCallbacks.GenericCallback<java.lang.Void> completeCb)
Description copied from interface:BookieAuthProvider.FactoryCreate a new instance of a bookie auth provider. Each connection should get its own instance, as they can hold connection specific state. The completeCb is used to notify the server 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. If authentication fails, the server will close the connection.- Specified by:
newProviderin interfaceBookieAuthProvider.Factory- Parameters:
addr- an handle to the connectioncompleteCb- callback to be notified when authentication is complete.
-
getPluginName
public java.lang.String getPluginName()
Description copied from interface:BookieAuthProvider.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 interfaceBookieAuthProvider.Factory
-
close
public void close()
Description copied from interface:BookieAuthProvider.FactoryRelease resources.- Specified by:
closein interfaceBookieAuthProvider.Factory
-
getSubject
public javax.security.auth.Subject getSubject()
- Specified by:
getSubjectin interfaceJAASCredentialsContainer
-
getLogin
public javax.security.auth.login.LoginContext getLogin()
- Specified by:
getLoginin interfaceJAASCredentialsContainer
-
setLogin
public void setLogin(javax.security.auth.login.LoginContext login)
- Specified by:
setLoginin interfaceJAASCredentialsContainer
-
isUsingTicketCache
public boolean isUsingTicketCache()
- Specified by:
isUsingTicketCachein interfaceJAASCredentialsContainer
-
getPrincipal
public java.lang.String getPrincipal()
- Specified by:
getPrincipalin interfaceJAASCredentialsContainer
-
getConfiguration
public AbstractConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceJAASCredentialsContainer
-
getLoginContextName
public java.lang.String getLoginContextName()
- Specified by:
getLoginContextNamein interfaceJAASCredentialsContainer
-
-