Package com.couchbase.client

Examples of com.couchbase.client.CouchbaseClient


*/
public class CouchbaseTemplateViewListener extends DependencyInjectionTestExecutionListener {

  @Override
  public void beforeTestClass(final TestContext testContext) throws Exception {
    CouchbaseClient client = (CouchbaseClient) testContext.getApplicationContext().getBean("couchbaseClient");
    populateTestData(client);
    createAndWaitForDesignDocs(client);
  }
View Full Code Here


   */
  @Bean(destroyMethod = "shutdown")
  public CouchbaseClient couchbaseClient() throws Exception {
    setLoggerProperty(couchbaseLogger());

    return new CouchbaseClient(
      bootstrapUris(bootstrapHosts()),
      getBucketName(),
      getBucketPassword()
    );
  }
View Full Code Here

    nodes = nodes != null ? nodes : Arrays.asList(new URI("http://" + DEFAULT_NODE + ":8091/pools"));
    bucket = bucket != null ? bucket : DEFAULT_BUCKET;
    password = password != null ? password : DEFAULT_PASSWORD;

    CouchbaseConnectionFactory factory = builder.buildCouchbaseConnection(nodes, bucket, password);
    couchbaseClient = new CouchbaseClient(factory);
  }
View Full Code Here

*/
public class SimpleCouchbaseRepositoryListener extends DependencyInjectionTestExecutionListener {

  @Override
  public void beforeTestClass(final TestContext testContext) throws Exception {
    CouchbaseClient client = (CouchbaseClient) testContext.getApplicationContext().getBean("couchbaseClient");
    populateTestData(client);
    createAndWaitForDesignDocs(client);
  }
View Full Code Here

*/
public class CouchbaseRepositoryViewListener extends DependencyInjectionTestExecutionListener {

  @Override
  public void beforeTestClass(final TestContext testContext) throws Exception {
    CouchbaseClient client = (CouchbaseClient) testContext.getApplicationContext().getBean("couchbaseClient");
    populateTestData(client);
    createAndWaitForDesignDocs(client);
  }
View Full Code Here

            // And: http://code.google.com/p/spymemcached/wiki/Examples#Establishing_a_Membase_Connection
            final CouchbaseConnectionFactoryBuilder factory = newCouchbaseConnectionFactoryBuilder();
            factory.setOpTimeout(operationTimeout);
            factory.setMaxReconnectDelay(maxReconnectDelay);
            factory.setFailureMode(FailureMode.Redistribute);
            return new CouchbaseClient(factory.buildCouchbaseConnection(memcachedNodesManager.getCouchbaseBucketURIs(), username, password));
        } catch (final Exception e) {
            throw new RuntimeException("Could not create memcached client", e);
        }
    }
View Full Code Here

            // Password of the bucket (empty) string if none
            String password = "";

            // Connect to the Cluster
            client = new CouchbaseClient(hosts, bucket, password);
        } catch (URISyntaxException | IOException ex) {
            Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here

            LOG.info("Closing existing couchbase client.");
            mc.shutdown();
        }
        final List<URI> uris = getURIs();
        LOG.info("Creating new couchbase client with uris " + uris);
        mc = new CouchbaseClient(uris, "default", "");
    }
View Full Code Here

      throws IOException
  {
    super ();
    if (useBucket) {
      @SuppressWarnings ("unchecked") final List<URI> nodes = (List<URI>) servers;
      this.mcClient = new CouchbaseClient (nodes, bucket, user, password);
    } else {
      @SuppressWarnings ("unchecked") final List<URI> nodes = (List<URI>) servers;
      final CouchbaseConnectionFactory factory = new CouchbaseConnectionFactory (nodes, "default", "");
      this.mcClient = new CouchbaseClient (factory);
    }
  }
View Full Code Here

TOP

Related Classes of com.couchbase.client.CouchbaseClient

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.