DESCRIPTION

JVMCBC-21: Adding keepAlive in kv/query/views

Motivation
----------
In previous versions of the SDK, a pinger was in place in order to try
to prevent socket closing because of idle time.
A similar feature is needed on 2.x SDK.

Modifications
-------------
Added an IdleStateHandler to KV, Query and Views pipelines. It takes its
idle time from the CoreEnvironment (keepAliveInterval, in milliseconds)
and triggers if idle time was in both reads and writes.

AbstractGenericHandler now reacts to IdleStateEvent if the method for
keepAlive request creation doesn't return null. Also, two hooks can be
overridden in order to inject some behavior when the keepAlive request
is fired and when it is responded to. The fired hook logs a message in
DEBUG while the responded hook logs a message in TRACE.

The IdleStateHandler is only added if Core's keepAliveInterval is set to
a value > 0, as documented.

KeyValueHandler creates a keepAlive request interpreted into a NOOP
Couchbase operation.

QueryHandler and ViewHandler create a keepAlive request interpreted
into an HTTP HEAD request on the root of the service.

Added tests to check that keepAlive requests are correctly generated
and responses parsed.

Results
-------
KV, Query and Views fire a keepAlive

Change-Id: I9bd94ef4f37f513e70854e5a7b882ae3008b9b72


COMMENTS

author: Estrella Humphrey
date: 2015-01-30 15:09:46.613000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2015-01-30 15:11:10.155000000

Patch Set 1: Verified+1

retry pushing http://review.couchbase.org/46139

-------------------------------------
author: Natasha Sullivan
date: 2015-01-30 15:16:54.825000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Gerrit Code Review
date: 2015-01-30 15:20:49.678000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

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