Package org.apache.bookkeeper.auth
Interface ClientAuthProvider.Factory
-
- All Known Implementing Classes:
SASLClientProviderFactory
- Enclosing interface:
- ClientAuthProvider
public static interface ClientAuthProvider.Factory
A factory to create the authentication providers for bookkeeper clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Release resources.java.lang.String
getPluginName()
Get Auth provider plugin name.void
init(ClientConfiguration conf)
Initialize the factory with the client configuration and protobuf message registry.ClientAuthProvider
newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<java.lang.Void> completeCb)
Create a new instance of a client auth provider.
-
-
-
Method Detail
-
init
void init(ClientConfiguration conf) throws java.io.IOException
Initialize 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.- Throws:
java.io.IOException
-
newProvider
ClientAuthProvider newProvider(ClientConnectionPeer connection, AuthCallbacks.GenericCallback<java.lang.Void> completeCb)
Create 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.- Parameters:
connection
- an handle to the connectioncompleteCb
- callback to be notified when authentication is complete.
-
getPluginName
java.lang.String getPluginName()
Get Auth provider plugin name. Used as a sanity check to ensure that the bookie and the client. are using the same auth provider.
-
close
default void close()
Release resources.
-
-