If you want to use SASL to provide secure connectivity to your
Couchbase server then you could create a
CouchbaseConnectionFactory that defines the
SASL connection type, userbucket and password.
The connection to Couchbase uses the underlying protocol for SASL.
This is similar to the earlier example except that we use the
CouchbaseConnectionFactory.
List<URI> baseURIs = new ArrayList<URI>(); baseURIs.add(base); CouchbaseConnectionFactory cf = new CouchbaseConnectionFactory(baseURIs, "userbucket", "password"); client = new CouchbaseClient((CouchbaseConnectionFactory) cf);