DESCRIPTION

JCBC-982: BucketSettings raw and customSettings

Motivation
----------
Methods of BucketSettings don't cover the full range of possible values
either from the server (when getting bucket info) or when configuring
a bucket. It also varies with each major Couchbase version.

Getting the buckets info could be enriched with a generic raw() method,
while configuring a bucket could take additional generic map of custom
settings.

Modifications
-------------
BucketSettings now has a raw() method to represent the raw information
as returned by the server.
It is set when calling build() on the default builder.

BucketSettings for configuration (from client to server) can now have
additional settings through the customSettings() method. These are set
on the builder via the withSetting and withSettings methods.

The insert/update bucket payload is built using a testable method that
will consider the customSettings(), BUT will ignore them if they would
overwrite a setting that has a corresponding method.

Result
------
Bucket settings can now be read fully from the server and also set
fully, even if native methods are missing. This is more future-proof.

Change-Id: I7a9e6a433a177b617168e714bd85d62d07ad47be


COMMENTS

author: Estrella Humphrey
date: 2016-07-26 14:21:18.755000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2016-07-26 14:50:11.860000000

Patch Set 1: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-07-27 06:58:59.537000000

Patch Set 1:

I like the idea, but I'm thinking that technically the custom settings and raw do the same thing - they give you insight into all possible stuff..

What do you think about the idea of unifying both? so there is just raw() and also something like setRaw() on the builder?

-------------------------------------
author: Natasha Sullivan
date: 2016-07-27 06:59:06.134000000

Patch Set 1: Code-Review-1

-------------------------------------
author: Estrella Humphrey
date: 2016-07-27 07:59:01.905000000

Patch Set 1:

yeah I thought about unifiying them at first, but as it turns out the raw JSON obtained from server is wildly different from the input expected by UpsertBucket/InsertBucket endpoint. merging the two together could lead to having users try to getBucket() then chain it with a few modifications of the BucketSettings then upsertBucket()...

before it wasn't a problem, since the BucketSettings only had a limited amount of information anyway, but now with a single field it would introduce a lot of garbage in the payload...

-------------------------------------
author: Natasha Sullivan
date: 2016-07-27 08:43:15.963000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Tate Garrett
date: 2016-07-27 09:53:07.853000000

Change has been successfully cherry-picked as c5fd66dd1d08871a4e2a47ebc6765764b590b272 by Estrella Humphrey

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