com.couchbase.client
Class ClusterManager

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by com.couchbase.client.ClusterManager

public class ClusterManager
extends net.spy.memcached.compat.SpyObject

A client for the Couchbase REST API.


Constructor Summary
ClusterManager(java.util.List<java.net.URI> uris, java.lang.String username, java.lang.String password)
          Creates a connection to the Couchbase REST interface.
 
Method Summary
 void createDefaultBucket(BucketType type, int memorySizeMB, int replicas, boolean flushEnabled)
          Creates the default bucket.
 void createNamedBucket(BucketType type, java.lang.String name, int memorySizeMB, int replicas, java.lang.String authPassword, boolean flushEnabled)
          Creates a named bucket with a given password for SASL authentication.
 void createPortBucket(BucketType type, java.lang.String name, int memorySizeMB, int replicas, int port, boolean flush)
          Creates the a sasl bucket.
 void deleteBucket(java.lang.String name)
          Deletes a bucket.
 FlushResponse flushBucket(java.lang.String name)
          Deletes all data in a bucket.
 java.util.List<java.lang.String> listBuckets()
          Lists all buckets in a Couchbase cluster.
 boolean shutdown()
           
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterManager

public ClusterManager(java.util.List<java.net.URI> uris,
                      java.lang.String username,
                      java.lang.String password)
Creates a connection to the Couchbase REST interface.

Parameters:
uris - A list of servers in the cluster.
username - The cluster admin user name.
password - The cluster admin password.
Method Detail

createDefaultBucket

public void createDefaultBucket(BucketType type,
                                int memorySizeMB,
                                int replicas,
                                boolean flushEnabled)
Creates the default bucket.

Parameters:
type - The bucket type to create.
memorySizeMB - The amount of memory to allocate to this bucket.
replicas - The number of replicas for this bucket.
flushEnabled - If flush should be enabled on this bucket.

createNamedBucket

public void createNamedBucket(BucketType type,
                              java.lang.String name,
                              int memorySizeMB,
                              int replicas,
                              java.lang.String authPassword,
                              boolean flushEnabled)
Creates a named bucket with a given password for SASL authentication.

Parameters:
type - The bucket type to create.
name - The name of the bucket.
memorySizeMB - The amount of memory to allocate to this bucket.
replicas - The number of replicas for this bucket.
authPassword - The password for this bucket.
flushEnabled - If flush should be enabled on this bucket.

createPortBucket

public void createPortBucket(BucketType type,
                             java.lang.String name,
                             int memorySizeMB,
                             int replicas,
                             int port,
                             boolean flush)
Creates the a sasl bucket.

Parameters:
type - The bucket type to create.
name - The name of the bucket.
memorySizeMB - The amount of memory to allocate to this bucket.
replicas - The number of replicas for this bucket.
port - The port for this bucket to listen on.

deleteBucket

public void deleteBucket(java.lang.String name)
Deletes a bucket.

Parameters:
name - The name of the bucket to delete.

listBuckets

public java.util.List<java.lang.String> listBuckets()
Lists all buckets in a Couchbase cluster.


flushBucket

public FlushResponse flushBucket(java.lang.String name)
Deletes all data in a bucket.

Parameters:
name - The bucket to flush.

shutdown

public boolean shutdown()


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.