public class PlainTextAuthProvider extends Object implements AuthProvider
AuthProvider
implementation.
This provider allows to programmatically define authentication information that will then apply to all hosts. The PlainTextAuthenticator instances it returns support SASL authentication using the PLAIN mechanism for version 2 (or above) of the CQL native protocol.
NONE
Constructor and Description |
---|
PlainTextAuthProvider(String username,
String password)
Creates a new simple authentication information provider with the supplied credentials.
|
Modifier and Type | Method and Description |
---|---|
Authenticator |
newAuthenticator(InetSocketAddress host,
String authenticator)
Uses the supplied credentials and the SASL PLAIN mechanism to login to the server.
|
void |
setPassword(String password)
Changes the password.
|
void |
setUsername(String username)
Changes the user name.
|
public void setUsername(String username)
The new credentials will be used for all connections initiated after this method was called.
username
- the new name.public void setPassword(String password)
The new credentials will be used for all connections initiated after this method was called.
password
- the new password.public Authenticator newAuthenticator(InetSocketAddress host, String authenticator)
newAuthenticator
in interface AuthProvider
host
- the Cassandra host with which we want to authenticateauthenticator
- the configured authenticator on the hostCopyright © 2012–2018. All rights reserved.