DESCRIPTION

JCBC-983: Simple client for cluster REST API

Motivation
----------
The Couchbase cluster exposes a REST API, of which some methods are
exposed as native Java methods on the SDK. It would be useful to offer
a simple mean of querying the other endpoints from within the SDK.

To that end, the RestApiRequest message was added to the core and now
needs to be exposed in the client itself.

Modifications
-------------
Added a ClusterApiClient class that can be used to prepare API requests
(as RestBuilder objects) and execute them.

RestBuilder has several methods that can be chained together to build
the full request. The request can then be executed by calling one of
the execute() methods.

Result
------
A simple way of querying the cluster REST API is available directly in
the Java SDK. Convenience methods for both JSON and Url-Encoded form
bodies are exposed.

Change-Id: Icc383f918429a16a83ce44d539f92d21a0b2c09b


COMMENTS

author: Estrella Humphrey
date: 2016-07-26 08:43:09.696000000

Uploaded patch set 4: Patch Set 3 was rebased.

-------------------------------------
author: Estrella Humphrey
date: 2016-07-26 08:43:35.607000000

Patch Set 4: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-07-27 06:06:34.423000000

Patch Set 4: Code-Review-1

(2 comments)

I like the code overall, just some minor nits but also: I think we should keep the async/sync notion, its a little confusing since this would be the only API where both sync and async is on the same object.. can you make the current one async only and then make a blocking one a thin wrapper on top? I think thats what people would expect in terms of principle of least surprise.

Line:365, src/main/java/com/couchbase/client/java/cluster/DefaultAsyncClusterManager.java -> hmm not sure I like this, since enabling the service is not a immediate operation

Line:148, src/main/java/com/couchbase/client/java/cluster/api/ClusterApiClient.java -> add a message?

-------------------------------------
author: Natasha Sullivan
date: 2016-07-27 06:10:28.216000000

Patch Set 4:

oh, and maybe mark it as experimental!

-------------------------------------
author: Tate Garrett
date: 2016-07-28 14:12:10.230000000

Change has been successfully cherry-picked as 9557d8f7d2d16dcf50da5a73306f30bd6ae7f93b by Estrella Humphrey

-------------------------------------
