The Java Client Libraries support the core Couchbase API methods as direct calls to the Couchbase server through the API call. These direct methods can be used to provide instant storage, retrieval and updating of Couchbase key/value pairs.
For example, the following fragment stores and retrieves a single key/value pair:
client.set("someKey", 3600, someObject); Object myObject = client.get("someKey");
In the example code above, the client get()
call will wait until a response has been received from the
appropriately configured Couchbase servers before returning the
required value or an exception.