@ThreadSafe public abstract class DsePlainTextAuthProviderBase extends Object implements com.datastax.oss.driver.api.core.auth.AuthProvider
This can be reused to write an implementation that retrieves the credentials from another source than the configuration.
| Modifier and Type | Class and Description |
|---|---|
static class |
DsePlainTextAuthProviderBase.Credentials |
protected static class |
DsePlainTextAuthProviderBase.PlainTextAuthenticator |
| Modifier | Constructor and Description |
|---|---|
protected |
DsePlainTextAuthProviderBase(String logPrefix) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract DsePlainTextAuthProviderBase.Credentials |
getCredentials(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint,
String serverAuthenticator)
Retrieves the credentials from the underlying source.
|
com.datastax.oss.driver.api.core.auth.Authenticator |
newAuthenticator(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint,
String serverAuthenticator) |
void |
onMissingChallenge(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint) |
protected DsePlainTextAuthProviderBase(@NonNull
String logPrefix)
logPrefix - a string that will get prepended to the logs (this is used for discrimination
when you have multiple driver instances executing in the same JVM). Config-based
implementations fill this with Session.getName().@NonNull protected abstract DsePlainTextAuthProviderBase.Credentials getCredentials(@NonNull com.datastax.oss.driver.api.core.metadata.EndPoint endPoint, @NonNull String serverAuthenticator)
This is invoked every time the driver opens a new connection.
@NonNull
public com.datastax.oss.driver.api.core.auth.Authenticator newAuthenticator(@NonNull
com.datastax.oss.driver.api.core.metadata.EndPoint endPoint,
@NonNull
String serverAuthenticator)
throws com.datastax.oss.driver.api.core.auth.AuthenticationException
newAuthenticator in interface com.datastax.oss.driver.api.core.auth.AuthProvidercom.datastax.oss.driver.api.core.auth.AuthenticationExceptionpublic void onMissingChallenge(@NonNull
com.datastax.oss.driver.api.core.metadata.EndPoint endPoint)
onMissingChallenge in interface com.datastax.oss.driver.api.core.auth.AuthProviderpublic void close()
close in interface AutoCloseableCopyright © 2017–2019. All rights reserved.