Interface Authentication
- All Superinterfaces:
AutoCloseable,Closeable
Pluggable authentication provider for Pulsar clients.
Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionauthData()Get the authentication data to be sent to the broker.default AuthenticationDataGet the authentication data for a specific broker host.The authentication method name (e.g., "token", "tls").default voidclose()default voidInitialize the authentication provider.
-
Method Details
-
authMethodName
String authMethodName()The authentication method name (e.g., "token", "tls").- Returns:
- the authentication method identifier string
-
authData
Get the authentication data to be sent to the broker.- Returns:
- the authentication data containing credentials for the broker
- Throws:
PulsarClientException- if the authentication data could not be obtained
-
authData
Get the authentication data for a specific broker host.The default implementation delegates to
authData().- Parameters:
brokerHostName- the hostname of the broker to authenticate against- Returns:
- the authentication data containing credentials for the specified broker
- Throws:
PulsarClientException- if the authentication data could not be obtained
-
initialize
Initialize the authentication provider. Called once when the client is created.- Throws:
PulsarClientException- if initialization fails
-
close
default void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-