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)
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)
username
- the new name.public void setPassword(String password)
password
- the new password.public Authenticator newAuthenticator(InetSocketAddress host)
newAuthenticator
in interface AuthProvider
host
- the Cassandra host with which we want to authenticate