Package com.netflix.astyanax

Examples of com.netflix.astyanax.AuthenticationCredentials


    int port = cpConfig.getPort();
    int protocolVersion = -1; // use default
   
    AuthProvider authProvider = AuthProvider.NONE;
   
    AuthenticationCredentials creds = cpConfig.getAuthenticationCredentials();
    if (creds != null) {
      authProvider = new PlainTextAuthProvider(creds.getUsername(), creds.getPassword());
    }
   
    return new ProtocolOptions(port, protocolVersion, null, authProvider);
  }
View Full Code Here


                    transport.open();

                cassandraClient = new Cassandra.Client(new TBinaryProtocol.Factory().getProtocol(transport));
                monitor.incConnectionCreated(getHost());

                AuthenticationCredentials credentials = cpConfig.getAuthenticationCredentials();
                if (credentials != null) {
                    Map<String, String> thriftCredentials = Maps.newHashMapWithExpectedSize(2);
                    thriftCredentials.put("username", credentials.getUsername());
                    thriftCredentials.put("password", credentials.getPassword());
                    cassandraClient.login(new AuthenticationRequest(thriftCredentials));
                }
            }
            catch (Exception e) {
                pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.AuthenticationCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.