Examples of AuthDescriptor


Examples of net.spy.memcached.auth.AuthDescriptor

  @Override
  public AuthDescriptor getAuthDescriptor() {
    if (!configurationProvider.getAnonymousAuthBucket().equals(bucket)
        && bucket != null) {
      return new AuthDescriptor(new String[] {},
        new PlainCallbackHandler(bucket, pass));
    } else {
      return null;
    }
  }
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

  @Override
  public AuthDescriptor getAuthDescriptor() {
    if (!configurationProvider.getAnonymousAuthBucket().equals(bucket)
        && bucket != null) {
      return new AuthDescriptor(new String[] {},
        new PlainCallbackHandler(bucket, pass));
    } else {
      return null;
    }
  }
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

            ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder();
            builder.setProtocol( protocol );
            if( username != null && !username.isEmpty() )
            {
                builder.setAuthDescriptor(
                    new AuthDescriptor(
                        new String[]
                        {
                            authMech
                        },
                        new PlainCallbackHandler( username, password )
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

  }

  @Override
  protected ConnectionFactoryBuilder getConnectionFactoryBuilder() {
    ConnectionFactoryBuilder factoryBuilder = super.getConnectionFactoryBuilder();
    AuthDescriptor ad = new AuthDescriptor(new String[] {"PLAIN"}, new PlainCallbackHandler(_username, _password));
    factoryBuilder.setAuthDescriptor(ad);
    return factoryBuilder;
  }
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

        if (memcachedUser != null) {
               
            String memcachePassword = ninjaProperties.getOrDie(NinjaConstant.MEMCACHED_PASSWORD);
           
            // Use plain SASL to connect to memcached
            AuthDescriptor ad = new AuthDescriptor(new String[]{"PLAIN"},
                                    new PlainCallbackHandler(memcachedUser, memcachePassword));
            ConnectionFactory cf = new ConnectionFactoryBuilder()
                                        .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
                                        .setAuthDescriptor(ad)
                                        .build();
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

  @Override
  public AuthDescriptor getAuthDescriptor() {
    if (!configurationProvider.getAnonymousAuthBucket().equals(bucket)
        && bucket != null) {
      return new AuthDescriptor(new String[] {},
        new PlainCallbackHandler(bucket, pass));
    } else {
      return null;
    }
  }
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

  @Override
  public AuthDescriptor getAuthDescriptor() {
    if (!configurationProvider.getAnonymousAuthBucket().equals(bucket)
        && bucket != null) {
      return new AuthDescriptor(new String[] {},
        new PlainCallbackHandler(bucket, pass));
    } else {
      return null;
    }
  }
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

            if (memcachePassword == null) {
                throw new ConfigurationException("Bad configuration for memcached: missing password");
            }
           
            // Use plain SASL to connect to memcached
            AuthDescriptor ad = new AuthDescriptor(new String[]{"PLAIN"},
                                    new PlainCallbackHandler(memcacheUser, memcachePassword));
            ConnectionFactory cf = new ConnectionFactoryBuilder()
                                        .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
                                        .setAuthDescriptor(ad)
                                        .build();
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

    protected ConnectionFactory createConnectionFactory(final MemcachedNodesManager memcachedNodesManager,
            final ConnectionType connectionType, final String memcachedProtocol, final String username, final String password, final long operationTimeout,
            final long maxReconnectDelay, final Statistics statistics ) {
        if (PROTOCOL_BINARY.equals( memcachedProtocol )) {
            if (connectionType.isSASL()) {
                final AuthDescriptor authDescriptor = new AuthDescriptor(new String[]{"PLAIN"}, new PlainCallbackHandler(username, password));
                return memcachedNodesManager.isEncodeNodeIdInSessionId()
                        ? new SuffixLocatorBinaryConnectionFactory( memcachedNodesManager,
                                memcachedNodesManager.getSessionIdFormat(), statistics, operationTimeout, maxReconnectDelay,
                                authDescriptor)
                        : new ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
View Full Code Here

Examples of net.spy.memcached.auth.AuthDescriptor

        .setLocatorType(ConnectionFactoryBuilder.Locator.CONSISTENT);
    } else {
      throw new ConfigurationException("Bucket type not supported or JSON response unexpected");
    }
    if (!this.configurationProvider.getAnonymousAuthBucket().equals(bucketName) && usr != null) {
      AuthDescriptor ad = new AuthDescriptor(new String[]{"PLAIN"},
        new PlainCallbackHandler(usr, pwd));
      cfb.setAuthDescriptor(ad);
    }
    ConnectionFactory cf = cfb.build();
    List<InetSocketAddress> addrs = AddrUtil.getAddresses(bucket.getConfig().getServers());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.