com.datastax.driver.core
Class PlainTextAuthProvider

java.lang.Object
  extended by com.datastax.driver.core.PlainTextAuthProvider
All Implemented Interfaces:
AuthProvider

public class PlainTextAuthProvider
extends Object
implements AuthProvider

A simple 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 of the CQL native protocol.


Field Summary
 
Fields inherited from interface com.datastax.driver.core.AuthProvider
NONE
 
Constructor Summary
PlainTextAuthProvider(String username, String password)
          Creates a new simple authentication information provider with the supplied credentials.
 
Method Summary
 Authenticator newAuthenticator(InetAddress host)
          Uses the supplied credentials and the SASL PLAIN mechanism to login to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainTextAuthProvider

public PlainTextAuthProvider(String username,
                             String password)
Creates a new simple authentication information provider with the supplied credentials.

Parameters:
username - to use for authentication requests
password - to use for authentication requests
Method Detail

newAuthenticator

public Authenticator newAuthenticator(InetAddress host)
Uses the supplied credentials and the SASL PLAIN mechanism to login to the server.

Specified by:
newAuthenticator in interface AuthProvider
Parameters:
host - the Cassandra host with which we want to authenticate
Returns:
an Authenticator instance which can be used to perform authentication negotiations on behalf of the client
Throws:
SaslException - if an unsupported SASL mechanism is supplied or an error is encountered when initialising the authenticator


Copyright © 2013. All Rights Reserved.