Package org.apache.cassandra.thrift

Examples of org.apache.cassandra.thrift.AuthenticationRequest$AuthenticationRequestStandardScheme


            if (ConfigHelper.getInputKeyspaceUserName(conf) != null)
            {
                Map<String, String> creds = new HashMap<String, String>();
                creds.put(SimpleAuthenticator.USERNAME_KEY, ConfigHelper.getInputKeyspaceUserName(conf));
                creds.put(SimpleAuthenticator.PASSWORD_KEY, ConfigHelper.getInputKeyspacePassword(conf));
                AuthenticationRequest authRequest = new AuthenticationRequest(creds);
                client.login(authRequest);
            }
        }
        catch (Exception e)
        {
View Full Code Here


            if (username != null && password != null)
            {
                Map<String, String> cred = new HashMap<String, String>();
                cred.put("username", username);
                cred.put("password", password);
                AuthenticationRequest req = new AuthenticationRequest(cred);
                try
                {
                    client.login(req);
                }
                catch (Exception e)
View Full Code Here

                    if (userName != null)
                    {
                        Map<String, String> credentials = new HashMap<String, String>();
                        credentials.put("username", userName);
                        credentials.put("password", password);
                        AuthenticationRequest auth_request = new AuthenticationRequest(credentials);
                        cassandra_client.login(auth_request);
                    }
                }
                return true;
            }
View Full Code Here

        try
        {
            Map<String, String> credentials = new HashMap<String, String>();
            credentials.put(IAuthenticator.USERNAME_KEY, userName);
            credentials.put(IAuthenticator.PASSWORD_KEY, password);
            CassandraCli.client.login(new AuthenticationRequest(credentials));

            CassandraCli.createKeySpace("KunderaAuthentication");

            ksDef = CassandraCli.client.describe_keyspace("KunderaAuthentication");
            CassandraCli.client.set_keyspace("KunderaAuthentication");
View Full Code Here

        if (ConfigHelper.getInputKeyspaceUserName(conf) != null)
        {
            Map<String, String> creds = new HashMap<String, String>();
            creds.put(IAuthenticator.USERNAME_KEY, ConfigHelper.getInputKeyspaceUserName(conf));
            creds.put(IAuthenticator.PASSWORD_KEY, ConfigHelper.getInputKeyspacePassword(conf));
            AuthenticationRequest authRequest = new AuthenticationRequest(creds);
            client.login(authRequest);
        }
        logger.debug("Authenticated client for CF input format created successfully");
        return client;
    }
View Full Code Here

        pool = getClientFromLBPolicy(excludeHosts);
        client = pool.borrowClient();
        Cassandra.Client c = client.getCassandra(op.keyspaceName);
        // Keyspace can be null for some system_* api calls
        if ( op.credentials != null && !op.credentials.isEmpty() ) {
          c.login(new AuthenticationRequest(op.credentials));
        }

        op.executeAndSetResult(c, pool.getCassandraHost());
        success = true;
        timer.stop(timerToken, op.stopWatchTagName, true);
View Full Code Here

                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());
                closeClient();
View Full Code Here

        String node = "node1";
        Cluster cluster = new Cluster(node, 5555, false, new SimpleConnectionAuthenticator(USERNAME,PASSWORD));
        assertNotNull("Incorrect connection authentication config",cluster.getConnectionConfig().getConnectionAuthenticator());
        assertEquals("Incorrect connection authenticator class"
            ,cluster.getConnectionConfig().getConnectionAuthenticator().getClass(),SimpleConnectionAuthenticator.class);
        AuthenticationRequest request = cluster.getConnectionConfig().getConnectionAuthenticator().getAuthenticationRequest();
        assertNotNull("Invalid authentication request",request);
        assertNotNull("Invalid authentication request credentials",request.getCredentials());
        assertEquals("Invalid authentication username",request.getCredentials().get(SimpleConnectionAuthenticator.USERNAME_KEY),USERNAME);
        assertEquals("Invalid authentication username",request.getCredentials().get(SimpleConnectionAuthenticator.PASSWORD_KEY),PASSWORD);
    }
View Full Code Here

  @Override
  public AuthenticationRequest getAuthenticationRequest() {
    Map<String, String> params = new HashMap<String, String>();
    params.put(USERNAME_KEY, username);
    params.put(PASSWORD_KEY, password);
    return new AuthenticationRequest(params);
  }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.thrift.AuthenticationRequest$AuthenticationRequestStandardScheme

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.