New Features and Behaviour Changes in 1.0.0
The spymemcached
library functionality is now
avaliable via Couchbase-client
and
spymemcached
libraries. Couchbase
Connections, Connection Factory and the storage and retrieval
operations is abstracted in the Couchbase-client library and
ought to be the predominant library to be used by Java programs.
Memcached functionality is still available with
spymemcached
.
Consequently, the package structure has a new
com.couchbase.client
package in addition to the
exisiting net.spy.memcached
package.
For example, the connection to Couchbase can be obtained using the Couchbase-client library objects and methods.
List<URI> uris = new LinkedList<URI>(); // Connect to localhost or to the appropriate URI uris.add(URI.create("http://127.0.0.1:8091/pools")); try { client = new CouchbaseClient(uris, "default", ""); } catch (Exception e) { System.err.println("Error connecting to Couchbase: " + e.getMessage()); System.exit(0); }
or using the CouchbaseConnectionFactory
as
below.
CouchbaseConnectionFactory cf = new CouchbaseConnectionFactory(uris, "rags", "password"); client = new CouchbaseClient((CouchbaseConnectionFactory) cf);