DESCRIPTION

JCBC-1086 Add getUser api to cluster manager

Motivation
----------
The recent RFC changes are to add getUser and endpoint change for
getUsers.

Changes
-------
Both ClusterManager and AsyncClusterManager support getUser with a
username. getUser and getUsers use the same GetUsersRequest by passing
empty string or username.

Results
-------
getUser api is added. Verification tests pass.

Change-Id: I3c5b6bcaaa7699dffcb5c8377870705943f62385


COMMENTS

author: Marques Ellis
date: 2017-06-28 16:40:54.879000000

Patch Set 3: Published edit on patch set 2.

-------------------------------------
author: Natasha Sullivan
date: 2017-06-29 05:12:59.152000000

Patch Set 3: Code-Review-1

(4 comments)

Line:360, src/main/java/com/couchbase/client/java/cluster/DefaultAsyncClusterManager.java -> I'd not rely on empty string passed in and rather also check if its not null and not empty (since if its null the userid.compareTo will throw a NPE I think)

Line:365, src/main/java/com/couchbase/client/java/cluster/DefaultAsyncClusterManager.java -> GetUserRequest? (see core change comment)

Line:385, src/main/java/com/couchbase/client/java/cluster/DefaultAsyncClusterManager.java -> null check

Line:154, src/main/java/com/couchbase/client/java/cluster/DefaultClusterManager.java -> you can just call the other blocking method with the default timeout settings, DRY :)

-------------------------------------
author: Carmen Buckley
date: 2017-08-07 22:09:04.527000000

Patch Set 3:

(3 comments)

Line:386, src/main/java/com/couchbase/client/java/cluster/ClusterManager.java -> Could use xxx@xxx.xxx Javadoc tag here:

xxx@xxx.xxx TimeoutException If the timeout is exceeded.
xxx@xxx.xxx CouchbaseException If the underlying resources could not be enabled properly.
xxx@xxx.xxx TranscodingException If the server response could not be decoded

Line:76, src/integration/java/com/couchbase/client/java/rbac/BucketAndClusterManagerUserTest.java -> These assertions should probably be made with org.junit.Assert.assertTrue() instead of the built-in assert keyword. Otherwise the tests won't fail correctly unless they're run with the -ea (enabled assertions) option.

Line:78, src/integration/java/com/couchbase/client/java/rbac/BucketAndClusterManagerUserTest.java -> To assert string equality (with a static import for org.junit.Assert.assertEquals):
    assertEquals(username, user.userId());

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