Fix checkstyle errors

Change-Id: I9d2395e78d174f6e29e1bbad6df5a0744b2ecd29
Reviewed-on: http://review.couchbase.org/21351
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Changing Copyright Years and URL.

This small fix just updates copyright years and the couchbase
java sdk url.

Change-Id: I1b789b3b6b83ec1921f90e63768fcf25aaf9543d
Reviewed-on: http://review.couchbase.org/21219
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Adding a ComplexKey class and tests for querying with arrays.

This changeset extends the capabilities of the ComplexKey
class, fixes a few issues and adds test cases for all
supported operations. It also adds docblocks where
appropriate.

Change-Id: I9e0e31179e08fa482f7615370798b7af254dfdc5
Reviewed-on: http://review.couchbase.org/21353
Tested-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Documentation improvements for the constructors.

Improving documentation for the constructors and making
it clear that - for the moment - different usernames and
bucketnames are not possible.

Change-Id: I9e130f05009a888031cad76a76dc1fcc0f7411dd
Reviewed-on: http://review.couchbase.org/21217
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Add more unit tests for the Query class

Change-Id: Ib9b863838eef8fb7e1f0d4a6f438a513edccae44
Reviewed-on: http://review.couchbase.org/21354
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Remove the update_seq query parameter

Change-Id: I0e8d0a2096deeba981696f428df850e08e5f564d
Reviewed-on: http://review.couchbase.org/21355
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Add javadocs to public functions in Query class

Change-Id: Ia9ab7b631a0966fdc6326cf360c2707b12caaeae
Reviewed-on: http://review.couchbase.org/21356
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
JCBC-105: Add key stats operation

Change-Id: I5d5300ae29cdc7d73477a488b4554126325213bc
Reviewed-on: http://review.couchbase.org/21202
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
JCBC-120: Fix NPE on null for password

This changeset sets the password to an empty string if it is passed
in as null. This fixes a NPE exception down the stack in the spy
memcached library that tries to access it. This of course also sets
it for couchbase connections, but since an empty string is always
allowd it makes it more consistent.

Change-Id: Ic62558d2dbbef8e67f7570eb605207587718aec7
Reviewed-on: http://review.couchbase.org/21446
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
JCBC-128: Allow replicateTo without persistTo

This changeset makes it possible to run mutation operations
like add,set,replace or cas only with replicateTo set and
persistTo to zero. This adds a security net to operations
that need to be fast but dont have to be persistet at the
same time.

Change-Id: Ic261eb027d39111d925a53271b36465349fdcd3b
Reviewed-on: http://review.couchbase.org/21416
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-129: Improve Documentation for PersistTo and ReplicateTo.

This changeset adds a bunch of docblocks describing the way how
the PersistTo and ReplicateTo argument work and what they may be
used for.

Change-Id: I38a9f24c26072e9e8bb9ea54d26c0442f29240df
Reviewed-on: http://review.couchbase.org/21417
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-41: Allows better query options through ComplexKey.

Related Issues: JCBC-90, JCBC-48

This changeset provides more flexible options on how to provide
the query params, especially if someone wants to add numeric
strings and not want them to be casted to pure numbers. Since we
only allow Strings or ComplexKeys as params, the ComplexKey class
can be used to hint the correct type and enfore it down to the
HTTP query layer. See the added test cases for more details.

Change-Id: I0d56bda1d3d9727455bfe26fa7a1311dbcce00a8
Reviewed-on: http://review.couchbase.org/21337
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Return correct result on hasPendingRequests.

This fixes a simple logic-bug which returns true when no pending
requests are in the queue.

Change-Id: Id917fa22ad3551b118ef0f3a3cbb8769a4cf999b
Reviewed-on: http://review.couchbase.org/21372
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-126: Properly encode view values.

This changeset encodes all view property values so that they are
sent correctly over the wire. It encodes special characters like
spaces or brackets. This changeset also adapts the tests.

Change-Id: I347e4dce20181c0cd932a0d6d30e34f90475035d
Reviewed-on: http://review.couchbase.org/21423
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-119: Allow NULL for persist/replicate.

This changeset adds the possibility of using null for persistTo
and/or replicateTo. It defaults to ZERO for both enums, which
are the defaults and are equal to "dont observe at all". Tests
are also attached.

Change-Id: I0d69c971792ad8118f5d9035ccf3e0d8bca0215b
Reviewed-on: http://review.couchbase.org/21421
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
JCBC-100: Add better error handling on view fetches.

This changeset adds better error handling for synchronous
view fetches (getView and getViews) and adds documentation
to the asynchronous methods to remind the developer that
he has to check on the future object himself.

Change-Id: Ic1a74310f1f789b7b83bfae09496526b27ee7247
Reviewed-on: http://review.couchbase.org/21338
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Cancel view requests when the operation is cancelled.

This changeset makes sure that the corresponding http
requests are cancelled as well when the operatiion is
cancelled. This prevents a possible issue on blocking
the caller thread when the connection cant be
established.

Change-Id: I4c62eb8196a098ab5215e09659765fbd95010e1a
Reviewed-on: http://review.couchbase.org/21915
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
Renaming log message to remove CouchDB reference.

This changeset changes the log message to not refer to
CouchDB anymore but to a Couchbase HTTP connection
instead.

Change-Id: Idd21b8c6df2c50c3ce6616bf775c908ecc2c8d14
Reviewed-on: http://review.couchbase.org/21872
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Prevent doctype clash in view test.

This changeset prevents the pagination tests to fail because
of recently added tests. It modifies the view function to only
emit the correct documents.

Change-Id: Ic0e809b070c75ce440402972588de578344d3258
Reviewed-on: http://review.couchbase.org/21827
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Overriding spy tests to work correctly with couchbase

This changesets overrides two test cases that fail but
dont need to do so. They are overridden from spy because
the assertions are not correct with respect to couchbase
functionality.

Change-Id: I32c60869e1feb26345b29123fb0c22d0b6cc90f3
Reviewed-on: http://review.couchbase.org/21867
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>